(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)
(replace-match with t))))
(with-temp-buffer
(insert-file-contents "~/.mdw.conf")
- (replace "^[ \t]*\\(#.*\\|\\)\n" "")
+ (replace "^[ \t]*\\(#.*\\)?\n" "")
(replace (concat "^[ \t]*"
"\\([-a-zA-Z0-9_.]*\\)"
"[ \t]*=[ \t]*"
- "\\(.*[^ \t\n]\\|\\)"
+ "\\(.*[^ \t\n]\\)?"
"[ \t]**\\(\n\\|$\\)")
"(\\1 . \"\\2\")\n")
(car (read-from-string
;; Fontify include files as strings.
(list (concat "^[ \t]*\\#[ \t]*"
"\\(include\\|import\\)"
- "[ \t]*\\(<[^>]+\\(>\\|\\)\\)")
+ "[ \t]*\\(<[^>]+>?\\)")
'(2 font-lock-string-face))
;; Preprocessor directives are `references'?.
;; The following isn't quite right, but it's close enough.
(list (concat "\\<\\("
"0\\([xX][0-9a-fA-F]+\\|[0-7]+\\)\\|"
- "[0-9]+\\(\\.[0-9]*\\|\\)"
- "\\([eE]\\([-+]\\|\\)[0-9]+\\|\\)\\)"
+ "[0-9]+\\(\\.[0-9]*\\)?"
+ "\\([eE][-+]?[0-9]+\\)?\\)"
"[lLfFdD]?")
'(0 mdw-number-face))
;; The following isn't quite right, but it's close enough.
(list (concat "\\_<\\("
"0\\([xX][0-9a-fA-F]+\\|[0-7]+\\)\\|"
- "[0-9]+\\(\\.[0-9]*\\|\\)"
- "\\([eE]\\([-+]\\|\\)[0-9]+\\|\\)\\)"
+ "[0-9]+\\(\\.[0-9]*\\)?"
+ "\\([eE][-+]?[0-9]+\\)?\\)"
"[lLfFdD]?")
'(0 mdw-number-face))
;; As usual, not quite right.
(list (concat "\\_<\\("
"0\\([xX][0-9a-fA-F]+\\|[0-7]+\\)\\|"
- "[0-9]+\\(\\.[0-9]*\\|\\)"
- "\\([eE]\\([-+]\\|\\)[0-9]+\\|\\)\\)"
+ "[0-9]+\\(\\.[0-9]*\\)?"
+ "\\([eE][-+]?[0-9]+\\)?\\)"
"[lLfFdD]?")
'(0 mdw-number-face))
;; The following isn't quite right, but it's close enough.
(list (concat "\\<\\("
"0\\([xX][0-9a-fA-F]+\\|[0-7]+\\)\\|"
- "[0-9]+\\(\\.[0-9]*\\|\\)"
- "\\([eE]\\([-+]\\|\\)[0-9]+\\|\\)\\)"
+ "[0-9]+\\(\\.[0-9]*\\)?"
+ "\\([eE][-+]?[0-9]+\\)?\\)"
"[lLfFdD]?")
'(0 mdw-number-face))
;; The following isn't quite right, but it's close enough.
(list (concat "\\<\\("
"0\\([xX][0-9a-fA-F]+\\|[0-7]+\\)\\|"
- "[0-9]+\\(\\.[0-9]*\\|\\)"
- "\\([eE]\\([-+]\\|\\)[0-9]+\\|\\)\\)")
+ "[0-9]+\\(\\.[0-9]*\\)?"
+ "\\([eE][-+]?[0-9]+\\)?\\)")
'(0 mdw-number-face))
;; And anything else is punctuation.
;; The following isn't quite right, but it's close enough.
(list (concat "\\<\\("
"0\\([xX][0-9a-fA-F]+\\|[0-7]+\\)\\|"
- "[0-9]+\\(\\.[0-9]*\\|\\)"
- "\\([eE]\\([-+]\\|\\)[0-9]+\\|\\)\\)"
+ "[0-9]+\\(\\.[0-9]*\\)?"
+ "\\([eE][-+]?[0-9]+\\)?\\)"
"[uUlL]*")
'(0 mdw-number-face))
;; At least numbers are simpler than C.
(list (concat "\\<0\\([xX][0-9a-fA-F_]+\\|[0-7_]+\\)\\|"
- "\\<[0-9][0-9_]*\\(\\.[0-9_]*\\|\\)"
- "\\([eE]\\([-+]\\|\\)[0-9_]+\\|\\)")
+ "\\<[0-9][0-9_]*\\(\\.[0-9_]*\\)?"
+ "\\([eE][-+]?[0-9_]+\\)?")
'(0 mdw-number-face))
;; And anything else is punctuation.
;; At least numbers are simpler than C.
(list (concat "\\_<0\\([xX][0-9a-fA-F]+\\|[oO]?[0-7]+\\|[bB][01]+\\)\\|"
- "\\_<[0-9][0-9]*\\(\\.[0-9]*\\|\\)"
- "\\([eE]\\([-+]\\|\\)[0-9]+\\|[lL]\\|\\)")
+ "\\_<[0-9][0-9]*\\(\\.[0-9]*\\)?"
+ "\\([eE][-+]?[0-9]+\\|[lL]\\)?")
'(0 mdw-number-face))
;; And anything else is punctuation.
(setq font-lock-keywords
(list
(list (concat "\\<0\\([xX][0-9a-fA-F_]+\\|[0-7_]+\\)\\|"
- "\\<[0-9][0-9_]*\\(\\.[0-9_]*\\|\\)"
- "\\([eE]\\([-+]\\|\\)[0-9_]+\\|\\)")
+ "\\<[0-9][0-9_]*\\(\\.[0-9_]*\\)?"
+ "\\([eE][-+]?[0-9_]+\\)?")
'(0 mdw-number-face))
(list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
'(0 mdw-punct-face)))))
'(0 font-lock-keyword-face))
;; At least numbers are simpler than C.
- (list (concat "\\<\\(\\~\\|\\)"
- "\\(0\\(\\([wW]\\|\\)[xX][0-9a-fA-F]+\\|"
+ (list (concat "\\<\\~?"
+ "\\(0\\([wW]?[xX][0-9a-fA-F]+\\|"
"[wW][0-9]+\\)\\|"
- "\\([0-9]+\\(\\.[0-9]+\\|\\)"
- "\\([eE]\\(\\~\\|\\)"
- "[0-9]+\\|\\)\\)\\)")
+ "\\([0-9]+\\(\\.[0-9]+\\)?"
+ "\\([eE]\\~?"
+ "[0-9]+\\)?\\)\\)")
'(0 mdw-number-face))
;; And anything else is punctuation.
(list "\\_<[A-Z]\\(\\sw+\\|\\s_+\\)*\\_>"
'(0 font-lock-variable-name-face))
(list (concat "\\_<0\\([xX][0-9a-fA-F]+\\|[oO][0-7]+\\)\\|"
- "\\_<[0-9]+\\(\\.[0-9]*\\|\\)"
- "\\([eE]\\([-+]\\|\\)[0-9]+\\|\\)")
+ "\\_<[0-9]+\\(\\.[0-9]*\\)?"
+ "\\([eE][-+]?[0-9]+\\)?")
'(0 mdw-number-face))
(list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
'(0 mdw-punct-face))))))
'(0 font-lock-keyword-face))
(list (concat "^-\\sw+\\>")
'(0 font-lock-keyword-face))
- (list "\\<[0-9]+\\(\\|#[0-9a-zA-Z]+\\|[eE][+-]?[0-9]+\\)\\>"
+ (list "\\<[0-9]+\\(#[0-9a-zA-Z]+\\|[eE][+-]?[0-9]+\\)?\\>"
'(0 mdw-number-face))
(list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
'(0 mdw-punct-face))))))
'(2 font-lock-variable-name-face))
;; Make sure we get comments properly.
- (list "@c\\(\\|omment\\)\\( .*\\)?$"
+ (list "@c\\(omment\\)?\\( .*\\)?$"
'(0 font-lock-comment-face))
;; Command names are keywords.
(setq messages-mode-keywords
(append (list (list (concat "^[ \t]*\\#[ \t]*"
"\\(include\\|import\\)"
- "[ \t]*\\(<[^>]+\\(>\\|\\)\\)")
+ "[ \t]*\\(<[^>]+\\(>\\)?\\)")
'(2 font-lock-string-face))
(list (concat "^\\([ \t]*#[ \t]*\\(\\("
preprocessor-keywords
(list
(list (concat "^%\\s *\\(}\\|\\(" keywords "\\)\\>\\).*$")
'(0 font-lock-keyword-face))
- (list "^%\\s *\\(#.*\\|\\)$"
+ (list "^%\\s *\\(#.*\\)?$"
'(0 font-lock-comment-face))
(list "^%"
'(0 font-lock-keyword-face))
(list "\\<[A-Z][a-zA-Z0-9]*\\>"
'(0 font-lock-keyword-face))
(list (concat "\\<0\\([xX][0-9a-fA-F_]+\\|[0-7_]+\\)\\|"
- "[0-9][0-9_]*\\(\\.[0-9_]*\\|\\)"
- "\\([eE]\\([-+]\\|\\)[0-9_]+\\|\\)")
+ "[0-9][0-9_]*\\(\\.[0-9_]*\\)?"
+ "\\([eE][-+]?[0-9_]+\\)?")
'(0 mdw-number-face))
(list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
'(0 mdw-punct-face)))))