(Emacs Lisp): Use `...?' rather than `\(...\|\)' in regular expressions.
[profile] / dot / emacs
index e60294d..bd4d004 100644 (file)
--- a/dot/emacs
+++ b/dot/emacs
 
 (setq mail-user-agent 'message-user-agent
       read-mail-command 'gnus)
-(setq message-signature-separator "^-- \\(\\|\\[mdw\\]\\)$"
+(setq message-signature-separator "^-- \\(\\[mdw\\]\\)?$"
       message-yank-prefix "> "
       message-yank-cited-prefix "> "
       message-send-mail-function 'message-send-mail-with-sendmail
       bbdb-user-mail-names
       (concat "^"
              "\\(" "\\(mdw\\|markw\\|root\\|postmaster\\)"
-                   "\\([-+][^@]*\\|\\)"
+                   "\\([-+][^@]*\\)?"
                    "@\\(\\(dist\\|esc\\)orted\\.org\\.uk\\|odin\\.gg\\)"
              "\\|" "\\(" "\\(mdw\\|mwooding\\)"
                          "\\(\\+[^@]*\\)?"
                    "\\|" "0" "\\(mdw\\|mwooding\\)" "k\\.[^@]*"
                    "\\)" "@"
                    "\\(chiark\\|slimy\\|coriolis\\)\\.greenend\\.org\\.uk"
-             "\\|" "distorted\\.mdw@g\\(\\|oogle\\)mail.com"
+             "\\|" "distorted\\.mdw@g\\(oogle\\)?mail.com"
              "\\|" "mwooding@\\(good\\|blackberry\\)\\.com"
              "\\|" "mark\\.wooding@trustonic\\.com"
              "\\)$")
                             ((executable-find "sudo") "sudo")
                             (t "su")))
           (this-host (concat "\\`\\(localhost\\|"
-                             (system-name) "\\|\\)\\'"))
+                             (system-name) "\\)?\\'"))
           (this-user (concat "\\`\\(" (user-login-name) "\\|"
-                             (user-real-login-name) "\\|\\)\\'")))
+                             (user-real-login-name) "\\)?\\'")))
        (setq tramp-default-method-alist
             `((,this-host nil ,rootlyness)
               (nil ,this-user "ssh")
 (setq shell-prompt-pattern "^[^]#$%>»}\n]*\\([]#$%»}]\\|>>?\\) *")
 (setq comint-password-prompt-regexp
       (concat "\\(\\([Ee]nter \\|[Oo]ld \\|[Nn]ew \\|[a-zA-Z0-9_]*'s \\|^\\)"
-             "[Pp]assword\\|[Pp]ass ?phrase\\(\\| [-a-zA-Z0-9._]+\\)\\):")
+             "[Pp]assword\\|[Pp]ass ?phrase\\( [-a-zA-Z0-9._]+\\)?\\):")
       comint-file-name-chars "~/A-Za-z0-9+@:_.$#%,={}-"
       shell-file-name-chars comint-file-name-chars)