"Read the configuration variable named SYM."
(unless mdw-config
(setq mdw-config
- (flet ((replace (what with)
- (goto-char (point-min))
- (while (re-search-forward what nil t)
- (replace-match with t))))
- (with-temp-buffer
- (insert-file-contents "~/.mdw.conf")
- (replace "^[ \t]*\\(#.*\\)?\n" "")
- (replace (concat "^[ \t]*"
- "\\([-a-zA-Z0-9_.]*\\)"
- "[ \t]*=[ \t]*"
- "\\(.*[^ \t\n]\\)?"
- "[ \t]**\\(\n\\|$\\)")
- "(\\1 . \"\\2\")\n")
- (car (read-from-string
- (concat "(" (buffer-string) ")")))))))
+ (flet ((replace (what with)
+ (goto-char (point-min))
+ (while (re-search-forward what nil t)
+ (replace-match with t))))
+ (with-temp-buffer
+ (insert-file-contents "~/.mdw.conf")
+ (replace "^[ \t]*\\(#.*\\)?\n" "")
+ (replace (concat "^[ \t]*"
+ "\\([-a-zA-Z0-9_.]*\\)"
+ "[ \t]*=[ \t]*"
+ "\\(.*[^ \t\n]\\)?"
+ "[ \t]**\\(\n\\|$\\)")
+ "(\\1 . \"\\2\")\n")
+ (car (read-from-string
+ (concat "(" (buffer-string) ")")))))))
(cdr (assq sym mdw-config)))
;; Width configuration.
(insert e)
(setq anyp t)))
(setq ad-return-value
- (and anyp (buffer-string))))))
+ (and anyp (buffer-string))))))
;; Fighting with Org-mode's evil key maps.
(eval-after-load "org-latex"
'(setq org-export-latex-classes
- (append mdw-org-latex-defs org-export-latex-classes)))
+ (append mdw-org-latex-defs org-export-latex-classes)))
(eval-after-load "ox-latex"
'(setq org-latex-classes (append mdw-org-latex-defs org-latex-classes)
(setq org-export-docbook-xslt-proc-command "xsltproc --output %o %s %i"
org-export-docbook-xsl-fo-proc-command "fop %i.safe %o"
org-export-docbook-xslt-stylesheet
- "/usr/share/xml/docbook/stylesheet/docbook-xsl/fo/docbook.xsl")
+ "/usr/share/xml/docbook/stylesheet/docbook-xsl/fo/docbook.xsl")
;; Glasses.
buffers in random frames.")
(setq display-buffer--other-frame-action
- '((display-buffer-reuse-window display-buffer-pop-up-frame)
- (reusable-frames . nil)
- (inhibit-same-window . t)))
+ '((display-buffer-reuse-window display-buffer-pop-up-frame)
+ (reusable-frames . nil)
+ (inhibit-same-window . t)))
(defadvice walk-windows (around mdw-inhibit activate)
"If `mdw-inhibit-walk-windows' is non-nil, then do nothing."
(unless mdw-inhibit-rename-buffer
(let ((buffer (get-file-buffer from)))
(when buffer
- (with-current-buffer buffer
- (set-visited-file-name to nil t))))))
+ (let ((to (if (not (directory-name-p to)) to
+ (concat to (file-name-nondirectory from)))))
+ (with-current-buffer buffer
+ (set-visited-file-name to nil t)))))))
;;;--------------------------------------------------------------------------
;;; Improved compilation machinery.
;; Uprated version of M-x compile.
(setq compile-command
- (let ((ncpu (with-temp-buffer
- (insert-file-contents "/proc/cpuinfo")
- (buffer-string)
- (count-matches "^processor\\s-*:"))))
- (format "make -j%d -k" (* 2 ncpu))))
+ (let ((ncpu (with-temp-buffer
+ (insert-file-contents "/proc/cpuinfo")
+ (buffer-string)
+ (count-matches "^processor\\s-*:"))))
+ (format "make -j%d -k" (* 2 ncpu))))
(defun mdw-compilation-buffer-name (mode)
(concat "*" (downcase mode) ": "
#'flymake-get-make-cmdline)))))
(setq flymake-allowed-file-name-masks
- '(("\\.\\(?:[cC]\\|cc\\|cpp\\|cxx\\|c\\+\\+\\)\\'"
- mdw-flymake-make-init)
- ("\\.\\(?:[hH]\\|hh\\|hpp\\|hxx\\|h\\+\\+\\)\\'"
- mdw-flymake-master-make-init)
- ("\\.p[lm]" flymake-perl-init)))
+ '(("\\.\\(?:[cC]\\|cc\\|cpp\\|cxx\\|c\\+\\+\\)\\'"
+ mdw-flymake-make-init)
+ ("\\.\\(?:[hH]\\|hh\\|hpp\\|hxx\\|h\\+\\+\\)\\'"
+ mdw-flymake-master-make-init)
+ ("\\.p[lm]" flymake-perl-init)))
(setq flymake-mode-map
- (let ((map (if (boundp 'flymake-mode-map)
- flymake-mode-map
- (make-sparse-keymap))))
- (define-key map [?\C-c ?\C-f ?\C-p] 'flymake-goto-prev-error)
- (define-key map [?\C-c ?\C-f ?\C-n] 'flymake-goto-next-error)
- (define-key map [?\C-c ?\C-f ?\C-c] 'flymake-compile)
- (define-key map [?\C-c ?\C-f ?\C-k] 'flymake-stop-all-syntax-checks)
- (define-key map [?\C-c ?\C-f ?\C-e] 'flymake-popup-current-error-menu)
- map))
+ (let ((map (if (boundp 'flymake-mode-map)
+ flymake-mode-map
+ (make-sparse-keymap))))
+ (define-key map [?\C-c ?\C-f ?\C-p] 'flymake-goto-prev-error)
+ (define-key map [?\C-c ?\C-f ?\C-n] 'flymake-goto-next-error)
+ (define-key map [?\C-c ?\C-f ?\C-c] 'flymake-compile)
+ (define-key map [?\C-c ?\C-f ?\C-k] 'flymake-stop-all-syntax-checks)
+ (define-key map [?\C-c ?\C-f ?\C-e] 'flymake-popup-current-error-menu)
+ map))
;;;--------------------------------------------------------------------------
;;; Mail and news hacking.
(make-local-variable 'paragraph-separate)
(make-local-variable 'paragraph-start)
(setq paragraph-start
- (concat "[ \t]*[-_][-_][-_]+$\\|^-- \\|-----\\|"
- paragraph-start))
+ (concat "[ \t]*[-_][-_][-_]+$\\|^-- \\|-----\\|"
+ paragraph-start))
(setq paragraph-separate
(concat "[ \t]*[-_][-_][-_]+$\\|^-- \\|-----\\|"
paragraph-separate))))
(backward-char 1))
(beginning-of-line)
(setq article
- (and (re-search-forward "UID \\([0-9]+\\)" (line-end-position)
- t)
- (match-string 1)))
+ (and (re-search-forward "UID \\([0-9]+\\)"
+ (line-end-position)
+ t)
+ (match-string 1)))
(setq lines nil)
(setq size
- (and (re-search-forward "RFC822.SIZE \\([0-9]+\\)"
- (line-end-position)
- t)
- (match-string 1)))
+ (and (re-search-forward "RFC822.SIZE \\([0-9]+\\)"
+ (line-end-position)
+ t)
+ (match-string 1)))
(beginning-of-line)
(when (search-forward "BODYSTRUCTURE" (line-end-position) t)
(let ((structure (ignore-errors
;; Preferred programs.
(setq mailcap-user-mime-data
- '(((type . "application/pdf") (viewer . "mupdf %s"))))
+ '(((type . "application/pdf") (viewer . "mupdf %s"))))
;;;--------------------------------------------------------------------------
;;; Utility functions.
(eq (field-at-pos (point)) 'output))
ad-do-it
(setq ad-return-value
- (constrain-to-field (line-beginning-position) (point)))))
+ (constrain-to-field (line-beginning-position) (point)))))
;;;--------------------------------------------------------------------------
;;; Dired hacking.
design it doesn't cope with anything approximating a complicated
case."
(setq mdw-fill-prefix
- `(((if (mdw-point-within-string-p)
- ,(concat "\\(\\s-*\\)" mdw-hanging-indents)
- ,(concat rx mdw-hanging-indents))
- (match . 1)
- (pad . ,(or mat 2))))))
+ `(((if (mdw-point-within-string-p)
+ ,(concat "\\(\\s-*\\)" mdw-hanging-indents)
+ ,(concat rx mdw-hanging-indents))
+ (match . 1)
+ (pad . ,(or mat 2))))))
;;;--------------------------------------------------------------------------
;;; Other common declarations.
:global nil
(let ((buffer (current-buffer)))
(setq mdw-point-overlay-buffers
- (mapcan (lambda (buf)
- (if (and (buffer-live-p buf)
- (not (eq buf buffer)))
- (list buf)))
- mdw-point-overlay-buffers))
+ (mapcan (lambda (buf)
+ (if (and (buffer-live-p buf)
+ (not (eq buf buffer)))
+ (list buf)))
+ mdw-point-overlay-buffers))
(if mdw-point-overlay-mode
(setq mdw-point-overlay-buffers
- (cons buffer mdw-point-overlay-buffers))))
+ (cons buffer mdw-point-overlay-buffers))))
(cond (mdw-point-overlay-buffers
(add-hook 'pre-command-hook 'mdw-remove-point-overlay)
(add-hook 'post-command-hook 'mdw-update-point-overlay))
(unless (and old (equal (cdr old) new))
(if old (rplacd old new)
(setq mdw-terminal-title-alist
- (cons (cons tty new) mdw-terminal-title-alist)))
+ (cons (cons tty new) mdw-terminal-title-alist)))
(send-string-to-terminal (concat "\e]2;" new "\e\\"))))))
(add-hook 'post-command-hook 'mdw-update-terminal-title)
(func (intern (concat "mdw-define-c-style/" name-string))))
`(progn
(setq ,var
- ,(if (null parent)
- `',assocs
- (let ((parent-list (intern (concat "mdw-c-style/"
- (symbol-name parent)))))
- `(mdw-merge-style-alists ',assocs ,parent-list))))
+ ,(if (null parent)
+ `',assocs
+ (let ((parent-list (intern (concat "mdw-c-style/"
+ (symbol-name parent)))))
+ `(mdw-merge-style-alists ',assocs ,parent-list))))
(defun ,func () (c-add-style ,name-string ,var))
(and (featurep 'cc-mode) (,func))
(add-hook 'mdw-define-c-styles-hook ',func)
(let ((modes (if (listp modes) modes (list modes)))
(style (symbol-name style)))
(setq c-default-style
- (append (mapcar (lambda (mode)
- (cons mode style))
- modes)
- (remove-if (lambda (assoc)
- (memq (car assoc) modes))
- (if (listp c-default-style)
- c-default-style
- (list (cons 'other c-default-style))))))))
+ (append (mapcar (lambda (mode)
+ (cons mode style))
+ modes)
+ (remove-if (lambda (assoc)
+ (memq (car assoc) modes))
+ (if (listp c-default-style)
+ c-default-style
+ (list (cons 'other c-default-style))))))))
(setq c-default-style "mdw-c")
(mdw-set-default-c-style '(c-mode c++-mode) 'mdw-c)
"selector")))
(setq font-lock-keywords
- (list
-
- ;; Fontify include files as strings.
- (list (concat "^[ \t]*\\#[ \t]*"
- "\\(include\\|import\\)"
- "[ \t]*\\(<[^>]+>?\\)")
- '(2 font-lock-string-face))
-
- ;; Preprocessor directives are `references'?.
- (list (concat "^\\([ \t]*#[ \t]*\\(\\("
- preprocessor-keywords
- "\\)\\>\\|[0-9]+\\|$\\)\\)")
- '(1 font-lock-keyword-face))
-
- ;; Handle the keywords defined above.
- (list (concat "@\\<\\(" objc-keywords "\\)\\>")
- '(0 font-lock-keyword-face))
-
- (list (concat "\\<\\(" c-keywords "\\)\\>")
- '(0 font-lock-keyword-face))
-
- (list (concat "\\<\\(" c-builtins "\\)\\>")
- '(0 font-lock-variable-name-face))
-
- ;; Handle numbers too.
- ;;
- ;; This looks strange, I know. It corresponds to the
- ;; preprocessor's idea of what a number looks like, rather than
- ;; anything sensible.
- (list (concat "\\(\\<[0-9]\\|\\.[0-9]\\)"
- "\\([Ee][+-]\\|[0-9A-Za-z_.]\\)*")
- '(0 mdw-number-face))
+ (list
- ;; And anything else is punctuation.
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face))))))
+ ;; Fontify include files as strings.
+ (list (concat "^[ \t]*\\#[ \t]*"
+ "\\(include\\|import\\)"
+ "[ \t]*\\(<[^>]+>?\\)")
+ '(2 font-lock-string-face))
+
+ ;; Preprocessor directives are `references'?.
+ (list (concat "^\\([ \t]*#[ \t]*\\(\\("
+ preprocessor-keywords
+ "\\)\\>\\|[0-9]+\\|$\\)\\)")
+ '(1 font-lock-keyword-face))
+
+ ;; Handle the keywords defined above.
+ (list (concat "@\\<\\(" objc-keywords "\\)\\>")
+ '(0 font-lock-keyword-face))
+
+ (list (concat "\\<\\(" c-keywords "\\)\\>")
+ '(0 font-lock-keyword-face))
+
+ (list (concat "\\<\\(" c-builtins "\\)\\>")
+ '(0 font-lock-variable-name-face))
+
+ ;; Handle numbers too.
+ ;;
+ ;; This looks strange, I know. It corresponds to the
+ ;; preprocessor's idea of what a number looks like, rather than
+ ;; anything sensible.
+ (list (concat "\\(\\<[0-9]\\|\\.[0-9]\\)"
+ "\\([Ee][+-]\\|[0-9A-Za-z_.]\\)*")
+ '(0 mdw-number-face))
+
+ ;; And anything else is punctuation.
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face))))))
(define-derived-mode sod-mode c-mode "Sod"
"Major mode for editing Sod code.")
"show" "static" "switch" "while" "write")))
(setq font-lock-keywords
- (list
+ (list
- ;; Handle the keywords defined above.
- (list (concat "\\<\\(" c-keywords "\\)\\>")
- '(0 font-lock-keyword-face))
+ ;; Handle the keywords defined above.
+ (list (concat "\\<\\(" c-keywords "\\)\\>")
+ '(0 font-lock-keyword-face))
- ;; Handle numbers too.
- ;;
- ;; This looks strange, I know. It corresponds to the
- ;; preprocessor's idea of what a number looks like, rather than
- ;; anything sensible.
- (list (concat "\\(\\<[0-9]\\|\\.[0-9]\\)"
- "\\([Ee][+-]\\|[0-9A-Za-z_.]\\)*")
- '(0 mdw-number-face))
+ ;; Handle numbers too.
+ ;;
+ ;; This looks strange, I know. It corresponds to the
+ ;; preprocessor's idea of what a number looks like, rather than
+ ;; anything sensible.
+ (list (concat "\\(\\<[0-9]\\|\\.[0-9]\\)"
+ "\\([Ee][+-]\\|[0-9A-Za-z_.]\\)*")
+ '(0 mdw-number-face))
- ;; And anything else is punctuation.
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face))))))
+ ;; And anything else is punctuation.
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face))))))
(progn
(add-hook 'apcalc-mode-hook 'mdw-misc-mode-config t)
(mdw-regexps "false" "null" "super" "this" "true")))
(setq font-lock-keywords
- (list
+ (list
- ;; Handle the keywords defined above.
- (list (concat "\\<\\(" java-keywords "\\)\\>")
- '(0 font-lock-keyword-face))
+ ;; Handle the keywords defined above.
+ (list (concat "\\<\\(" java-keywords "\\)\\>")
+ '(0 font-lock-keyword-face))
- ;; Handle the magic builtins defined above.
- (list (concat "\\<\\(" java-builtins "\\)\\>")
- '(0 font-lock-variable-name-face))
-
- ;; Handle numbers too.
- ;;
- ;; 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]+\\)?\\)"
- "[lLfFdD]?")
- '(0 mdw-number-face))
+ ;; Handle the magic builtins defined above.
+ (list (concat "\\<\\(" java-builtins "\\)\\>")
+ '(0 font-lock-variable-name-face))
- ;; And anything else is punctuation.
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face))))))
+ ;; Handle numbers too.
+ ;;
+ ;; 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]+\\)?\\)"
+ "[lLfFdD]?")
+ '(0 mdw-number-face))
+
+ ;; And anything else is punctuation.
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face))))))
(progn
(add-hook 'java-mode-hook 'mdw-misc-mode-config t)
"arguments" "this")))
(setq font-lock-keywords
- (list
+ (list
- ;; Handle the keywords defined above.
- (list (concat "\\_<\\(" javascript-keywords "\\)\\_>")
- '(0 font-lock-keyword-face))
+ ;; Handle the keywords defined above.
+ (list (concat "\\_<\\(" javascript-keywords "\\)\\_>")
+ '(0 font-lock-keyword-face))
- ;; Handle the predefined builtins defined above.
- (list (concat "\\_<\\(" javascript-builtins "\\)\\_>")
- '(0 font-lock-variable-name-face))
-
- ;; Handle numbers too.
- ;;
- ;; 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]+\\)?\\)"
- "[lLfFdD]?")
- '(0 mdw-number-face))
+ ;; Handle the predefined builtins defined above.
+ (list (concat "\\_<\\(" javascript-builtins "\\)\\_>")
+ '(0 font-lock-variable-name-face))
- ;; And anything else is punctuation.
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face))))))
+ ;; Handle numbers too.
+ ;;
+ ;; 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]+\\)?\\)"
+ "[lLfFdD]?")
+ '(0 mdw-number-face))
+
+ ;; And anything else is punctuation.
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face))))))
(progn
(add-hook 'js-mode-hook 'mdw-misc-mode-config t)
(punctuation "[-!%^&*=+:@#~/?\\|`]"))
(setq font-lock-keywords
- (list
+ (list
- ;; Magical identifiers between backticks.
- (list (concat "`\\([^`]+\\)`")
- '(1 font-lock-variable-name-face))
+ ;; Magical identifiers between backticks.
+ (list (concat "`\\([^`]+\\)`")
+ '(1 font-lock-variable-name-face))
- ;; Handle the keywords defined above.
- (list (concat "\\_<\\(" scala-keywords "\\)\\_>")
- '(0 font-lock-keyword-face))
+ ;; Handle the keywords defined above.
+ (list (concat "\\_<\\(" scala-keywords "\\)\\_>")
+ '(0 font-lock-keyword-face))
- ;; Handle the constants defined above.
- (list (concat "\\_<\\(" scala-constants "\\)\\_>")
- '(0 font-lock-variable-name-face))
-
- ;; Magical identifiers between backticks.
- (list (concat "`\\([^`]+\\)`")
- '(1 font-lock-variable-name-face))
-
- ;; Handle numbers too.
- ;;
- ;; As usual, not quite right.
- (list (concat "\\_<\\("
- "0\\([xX][0-9a-fA-F]+\\|[0-7]+\\)\\|"
- "[0-9]+\\(\\.[0-9]*\\)?"
- "\\([eE][-+]?[0-9]+\\)?\\)"
- "[lLfFdD]?")
- '(0 mdw-number-face))
+ ;; Handle the constants defined above.
+ (list (concat "\\_<\\(" scala-constants "\\)\\_>")
+ '(0 font-lock-variable-name-face))
- ;; And everything else is punctuation.
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face)))
+ ;; Magical identifiers between backticks.
+ (list (concat "`\\([^`]+\\)`")
+ '(1 font-lock-variable-name-face))
+
+ ;; Handle numbers too.
+ ;;
+ ;; As usual, not quite right.
+ (list (concat "\\_<\\("
+ "0\\([xX][0-9a-fA-F]+\\|[0-7]+\\)\\|"
+ "[0-9]+\\(\\.[0-9]*\\)?"
+ "\\([eE][-+]?[0-9]+\\)?\\)"
+ "[lLfFdD]?")
+ '(0 mdw-number-face))
+
+ ;; And everything else is punctuation.
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face)))
font-lock-syntactic-keywords
- (list
+ (list
- ;; Single quotes around characters. But not when used to quote
- ;; symbol names. Ugh.
- (list (concat "\\('\\)"
- "\\(" "."
- "\\|" "\\\\" "\\(" "\\\\\\\\" "\\)*"
- "u+" "[0-9a-fA-F]\\{4\\}"
- "\\|" "\\\\" "[0-7]\\{1,3\\}"
- "\\|" "\\\\" "." "\\)"
- "\\('\\)")
- '(1 "\"")
- '(4 "\""))))))
+ ;; Single quotes around characters. But not when used to quote
+ ;; symbol names. Ugh.
+ (list (concat "\\('\\)"
+ "\\(" "."
+ "\\|" "\\\\" "\\(" "\\\\\\\\" "\\)*"
+ "u+" "[0-9a-fA-F]\\{4\\}"
+ "\\|" "\\\\" "[0-7]\\{1,3\\}"
+ "\\|" "\\\\" "." "\\)"
+ "\\('\\)")
+ '(1 "\"")
+ '(4 "\""))))))
(progn
(add-hook 'scala-mode-hook 'mdw-misc-mode-config t)
(mdw-regexps "base" "false" "null" "this" "true")))
(setq font-lock-keywords
- (list
+ (list
- ;; Handle the keywords defined above.
- (list (concat "\\<\\(" csharp-keywords "\\)\\>")
- '(0 font-lock-keyword-face))
+ ;; Handle the keywords defined above.
+ (list (concat "\\<\\(" csharp-keywords "\\)\\>")
+ '(0 font-lock-keyword-face))
- ;; Handle the magic builtins defined above.
- (list (concat "\\<\\(" csharp-builtins "\\)\\>")
- '(0 font-lock-variable-name-face))
-
- ;; Handle numbers too.
- ;;
- ;; 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]+\\)?\\)"
- "[lLfFdD]?")
- '(0 mdw-number-face))
+ ;; Handle the magic builtins defined above.
+ (list (concat "\\<\\(" csharp-builtins "\\)\\>")
+ '(0 font-lock-variable-name-face))
- ;; And anything else is punctuation.
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face))))))
+ ;; Handle numbers too.
+ ;;
+ ;; 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]+\\)?\\)"
+ "[lLfFdD]?")
+ '(0 mdw-number-face))
+
+ ;; And anything else is punctuation.
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face))))))
(define-derived-mode csharp-mode java-mode "C#"
"Major mode for editing C# code.")
(mdw-regexps "if" "indent" "else" "endif")))
(setq font-lock-keywords
- (list (list (concat "\\(^\\|[^\"]\\)"
- "\\(" "(\\*"
- "[^*]*\\*+"
- "\\(" "[^)*]" "[^*]*" "\\*+" "\\)*"
- ")"
- "\\|"
- "//.*"
- "\\)")
- '(2 font-lock-comment-face))
-
- (list (concat "'" "\\("
- "\\\\"
- "\\(" "[ntbr'\\]"
- "\\|" "[0-9][0-9][0-9]"
- "\\|" "u" "[0-9a-fA-F]\\{4\\}"
- "\\|" "U" "[0-9a-fA-F]\\{8\\}"
- "\\)"
- "\\|"
- "." "\\)" "'"
- "\\|"
- "\"" "[^\"\\]*"
- "\\(" "\\\\" "\\(.\\|\n\\)"
- "[^\"\\]*" "\\)*"
- "\\(\"\\|\\'\\)")
- '(0 font-lock-string-face))
-
- (list (concat "\\_<\\(" bang-keywords "\\)!" "\\|"
- "^#[ \t]*\\(" preprocessor-keywords "\\)\\_>"
- "\\|"
- "\\_<\\(" fsharp-keywords "\\)\\_>")
- '(0 font-lock-keyword-face))
- (list (concat "\\<\\(" fsharp-builtins "\\)\\_>")
- '(0 font-lock-variable-name-face))
-
- (list (concat "\\_<"
- "\\(" "0[bB][01]+" "\\|"
- "0[oO][0-7]+" "\\|"
- "0[xX][0-9a-fA-F]+" "\\)"
- "\\(" "lf\\|LF" "\\|"
- "[uU]?[ysnlL]?" "\\)"
- "\\|"
- "\\_<"
- "[0-9]+" "\\("
- "[mMQRZING]"
+ (list (list (concat "\\(^\\|[^\"]\\)"
+ "\\(" "(\\*"
+ "[^*]*\\*+"
+ "\\(" "[^)*]" "[^*]*" "\\*+" "\\)*"
+ ")"
"\\|"
- "\\(\\.[0-9]*\\)?"
- "\\([eE][-+]?[0-9]+\\)?"
- "[fFmM]?"
+ "//.*"
+ "\\)")
+ '(2 font-lock-comment-face))
+
+ (list (concat "'" "\\("
+ "\\\\"
+ "\\(" "[ntbr'\\]"
+ "\\|" "[0-9][0-9][0-9]"
+ "\\|" "u" "[0-9a-fA-F]\\{4\\}"
+ "\\|" "U" "[0-9a-fA-F]\\{8\\}"
+ "\\)"
+ "\\|"
+ "." "\\)" "'"
"\\|"
- "[uU]?[ysnlL]?"
- "\\)")
- '(0 mdw-number-face))
+ "\"" "[^\"\\]*"
+ "\\(" "\\\\" "\\(.\\|\n\\)"
+ "[^\"\\]*" "\\)*"
+ "\\(\"\\|\\'\\)")
+ '(0 font-lock-string-face))
+
+ (list (concat "\\_<\\(" bang-keywords "\\)!" "\\|"
+ "^#[ \t]*\\(" preprocessor-keywords "\\)\\_>"
+ "\\|"
+ "\\_<\\(" fsharp-keywords "\\)\\_>")
+ '(0 font-lock-keyword-face))
+ (list (concat "\\<\\(" fsharp-builtins "\\)\\_>")
+ '(0 font-lock-variable-name-face))
+
+ (list (concat "\\_<"
+ "\\(" "0[bB][01]+" "\\|"
+ "0[oO][0-7]+" "\\|"
+ "0[xX][0-9a-fA-F]+" "\\)"
+ "\\(" "lf\\|LF" "\\|"
+ "[uU]?[ysnlL]?" "\\)"
+ "\\|"
+ "\\_<"
+ "[0-9]+" "\\("
+ "[mMQRZING]"
+ "\\|"
+ "\\(\\.[0-9]*\\)?"
+ "\\([eE][-+]?[0-9]+\\)?"
+ "[fFmM]?"
+ "\\|"
+ "[uU]?[ysnlL]?"
+ "\\)")
+ '(0 mdw-number-face))
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face))))))
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face))))))
(defun mdw-fontify-inferior-fsharp ()
(mdw-fontify-fsharp)
(setq font-lock-keywords
- (append (list (list "^[#-]" '(0 font-lock-comment-face))
- (list "^>" '(0 font-lock-keyword-face)))
- font-lock-keywords)))
+ (append (list (list "^[#-]" '(0 font-lock-comment-face))
+ (list "^>" '(0 font-lock-keyword-face)))
+ font-lock-keywords)))
(progn
(add-hook 'fsharp-mode-hook 'mdw-misc-mode-config t)
"new" "panic" "real" "recover")))
(setq font-lock-keywords
- (list
-
- ;; Handle the keywords defined above.
- (list (concat "\\<\\(" go-keywords "\\)\\>")
- '(0 font-lock-keyword-face))
- (list (concat "\\<\\(" go-intrinsics "\\)\\>")
- '(0 font-lock-variable-name-face))
-
- ;; Strings and characters.
- (list (concat "'"
- "\\(" "[^\\']" "\\|"
- "\\\\"
- "\\(" "[abfnrtv\\'\"]" "\\|"
- "[0-7]\\{3\\}" "\\|"
- "x" "[0-9A-Fa-f]\\{2\\}" "\\|"
- "u" "[0-9A-Fa-f]\\{4\\}" "\\|"
- "U" "[0-9A-Fa-f]\\{8\\}" "\\)" "\\)"
- "'"
- "\\|"
- "\""
- "\\(" "[^\n\\\"]+" "\\|" "\\\\." "\\)*"
- "\\(\"\\|$\\)"
- "\\|"
- "`" "[^`]+" "`")
- '(0 font-lock-string-face))
-
- ;; Handle numbers too.
- ;;
- ;; 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 mdw-number-face))
+ (list
- ;; And anything else is punctuation.
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face))))))
+ ;; Handle the keywords defined above.
+ (list (concat "\\<\\(" go-keywords "\\)\\>")
+ '(0 font-lock-keyword-face))
+ (list (concat "\\<\\(" go-intrinsics "\\)\\>")
+ '(0 font-lock-variable-name-face))
+
+ ;; Strings and characters.
+ (list (concat "'"
+ "\\(" "[^\\']" "\\|"
+ "\\\\"
+ "\\(" "[abfnrtv\\'\"]" "\\|"
+ "[0-7]\\{3\\}" "\\|"
+ "x" "[0-9A-Fa-f]\\{2\\}" "\\|"
+ "u" "[0-9A-Fa-f]\\{4\\}" "\\|"
+ "U" "[0-9A-Fa-f]\\{8\\}" "\\)" "\\)"
+ "'"
+ "\\|"
+ "\""
+ "\\(" "[^\n\\\"]+" "\\|" "\\\\." "\\)*"
+ "\\(\"\\|$\\)"
+ "\\|"
+ "`" "[^`]+" "`")
+ '(0 font-lock-string-face))
+
+ ;; Handle numbers too.
+ ;;
+ ;; 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 mdw-number-face))
+
+ ;; And anything else is punctuation.
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face))))))
(progn
(add-hook 'go-mode-hook 'mdw-misc-mode-config t)
(add-hook 'go-mode-hook 'mdw-fontify-go t))
"char" "str"
"self" "Self")))
(setq font-lock-keywords
- (list
+ (list
- ;; Handle the keywords defined above.
- (list (concat "\\_<\\(" rust-keywords "\\)\\_>")
- '(0 font-lock-keyword-face))
- (list (concat "\\_<\\(" rust-builtins "\\)\\_>")
- '(0 font-lock-variable-name-face))
-
- ;; Handle numbers too.
- (list (concat "\\_<\\("
- "[0-9][0-9_]*"
- "\\(" "\\(\\.[0-9_]+\\)?[eE][-+]?[0-9_]+"
- "\\|" "\\.[0-9_]+"
- "\\)"
- "\\(f32\\|f64\\)?"
- "\\|" "\\(" "[0-9][0-9_]*"
- "\\|" "0x[0-9a-fA-F_]+"
- "\\|" "0o[0-7_]+"
- "\\|" "0b[01_]+"
- "\\)"
- "\\([ui]\\(8\\|16\\|32\\|64\\|size\\)\\)?"
- "\\)\\_>")
- '(0 mdw-number-face))
-
- ;; And anything else is punctuation.
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face)))))
+ ;; Handle the keywords defined above.
+ (list (concat "\\_<\\(" rust-keywords "\\)\\_>")
+ '(0 font-lock-keyword-face))
+ (list (concat "\\_<\\(" rust-builtins "\\)\\_>")
+ '(0 font-lock-variable-name-face))
+
+ ;; Handle numbers too.
+ (list (concat "\\_<\\("
+ "[0-9][0-9_]*"
+ "\\(" "\\(\\.[0-9_]+\\)?[eE][-+]?[0-9_]+"
+ "\\|" "\\.[0-9_]+"
+ "\\)"
+ "\\(f32\\|f64\\)?"
+ "\\|" "\\(" "[0-9][0-9_]*"
+ "\\|" "0x[0-9a-fA-F_]+"
+ "\\|" "0o[0-7_]+"
+ "\\|" "0b[01_]+"
+ "\\)"
+ "\\([ui]\\(8\\|16\\|32\\|64\\|size\\)\\)?"
+ "\\)\\_>")
+ '(0 mdw-number-face))
+
+ ;; And anything else is punctuation.
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face)))))
;; Hack key bindings.
(local-set-key [?{] 'mdw-self-insert-and-indent)
"systime" "tolower" "toupper" "while")))
(setq font-lock-keywords
- (list
+ (list
- ;; Handle the keywords defined above.
- (list (concat "\\<\\(" c-keywords "\\)\\>")
- '(0 font-lock-keyword-face))
+ ;; Handle the keywords defined above.
+ (list (concat "\\<\\(" c-keywords "\\)\\>")
+ '(0 font-lock-keyword-face))
- ;; Handle numbers too.
- ;;
- ;; 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]+\\)?\\)"
- "[uUlL]*")
- '(0 mdw-number-face))
+ ;; Handle numbers too.
+ ;;
+ ;; 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]+\\)?\\)"
+ "[uUlL]*")
+ '(0 mdw-number-face))
- ;; And anything else is punctuation.
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face))))))
+ ;; And anything else is punctuation.
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face))))))
(progn
(add-hook 'awk-mode-hook 'mdw-misc-mode-config t)
"when" "while")))
(setq font-lock-keywords
- (list
+ (list
- ;; Set up the keywords defined above.
- (list (concat "\\<\\(" perl-keywords "\\)\\>")
- '(0 font-lock-keyword-face))
+ ;; Set up the keywords defined above.
+ (list (concat "\\<\\(" perl-keywords "\\)\\>")
+ '(0 font-lock-keyword-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 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 mdw-number-face))
- ;; And anything else is punctuation.
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face))))))
+ ;; And anything else is punctuation.
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face))))))
(defun perl-number-tests (&optional arg)
"Assign consecutive numbers to lines containing `#t'. With ARG,
;; Now define fontification things.
(make-local-variable 'font-lock-keywords)
(setq font-lock-keywords
- (list
+ (list
- ;; Set up the keywords defined above.
- (list (concat "\\_<\\(" keywords "\\)\\_>")
- '(0 font-lock-keyword-face))
+ ;; Set up the keywords defined above.
+ (list (concat "\\_<\\(" keywords "\\)\\_>")
+ '(0 font-lock-keyword-face))
- ;; 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 mdw-number-face))
+ ;; 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 mdw-number-face))
- ;; And anything else is punctuation.
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face)))))
+ ;; And anything else is punctuation.
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face)))))
;; Define Python fontification styles.
(define-derived-mode pyrex-mode python-mode "Pyrex"
"Major mode for editing Pyrex source code")
(setq auto-mode-alist
- (append '(("\\.pyx$" . pyrex-mode)
- ("\\.pxd$" . pyrex-mode)
- ("\\.pxi$" . pyrex-mode))
- auto-mode-alist))
+ (append '(("\\.pyx$" . pyrex-mode)
+ ("\\.pxd$" . pyrex-mode)
+ ("\\.pxi$" . pyrex-mode))
+ auto-mode-alist))
(progn
(add-hook 'python-mode-hook 'mdw-misc-mode-config t)
"nil" "not" "or" "repeat" "return" "then" "true"
"until" "while")))
(setq font-lock-keywords
- (list
-
- ;; Set up the keywords defined above.
- (list (concat "\\_<\\(" lua-keywords "\\)\\_>")
- '(0 font-lock-keyword-face))
-
- ;; At least numbers are simpler than C.
- (list (concat "\\_<\\(" "0[xX]"
- "\\(" "[0-9a-fA-F]+"
- "\\(\\.[0-9a-fA-F]*\\)?"
- "\\|" "\\.[0-9a-fA-F]+"
- "\\)"
- "\\([pP][-+]?[0-9]+\\)?"
- "\\|" "\\(" "[0-9]+"
- "\\(\\.[0-9]*\\)?"
- "\\|" "\\.[0-9]+"
- "\\)"
- "\\([eE][-+]?[0-9]+\\)?"
- "\\)")
- '(0 mdw-number-face))
+ (list
- ;; And anything else is punctuation.
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face))))))
+ ;; Set up the keywords defined above.
+ (list (concat "\\_<\\(" lua-keywords "\\)\\_>")
+ '(0 font-lock-keyword-face))
+
+ ;; At least numbers are simpler than C.
+ (list (concat "\\_<\\(" "0[xX]"
+ "\\(" "[0-9a-fA-F]+"
+ "\\(\\.[0-9a-fA-F]*\\)?"
+ "\\|" "\\.[0-9a-fA-F]+"
+ "\\)"
+ "\\([pP][-+]?[0-9]+\\)?"
+ "\\|" "\\(" "[0-9]+"
+ "\\(\\.[0-9]*\\)?"
+ "\\|" "\\.[0-9]+"
+ "\\)"
+ "\\([eE][-+]?[0-9]+\\)?"
+ "\\)")
+ '(0 mdw-number-face))
+
+ ;; And anything else is punctuation.
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face))))))
(progn
(add-hook 'lua-mode-hook 'mdw-misc-mode-config t)
(mdw-regexps "define" "else" "endif" "error" "ifdef" "ifndef"
"include" "line" "undef")))
(setq font-lock-keywords
- (list
+ (list
- ;; Set up the keywords defined above.
- (list (concat "\\<\\(" icon-keywords "\\)\\>")
- '(0 font-lock-keyword-face))
+ ;; Set up the keywords defined above.
+ (list (concat "\\<\\(" icon-keywords "\\)\\>")
+ '(0 font-lock-keyword-face))
- ;; The things that Icon calls keywords.
- (list "&\\sw+\\>" '(0 font-lock-variable-name-face))
+ ;; The things that Icon calls keywords.
+ (list "&\\sw+\\>" '(0 font-lock-variable-name-face))
- ;; At least numbers are simpler than C.
- (list (concat "\\<[0-9]+"
- "\\([rR][0-9a-zA-Z]+\\|"
- "\\.[0-9]+\\([eE][+-]?[0-9]+\\)?\\)\\>\\|"
- "\\.[0-9]+\\([eE][+-]?[0-9]+\\)?\\>")
- '(0 mdw-number-face))
+ ;; At least numbers are simpler than C.
+ (list (concat "\\<[0-9]+"
+ "\\([rR][0-9a-zA-Z]+\\|"
+ "\\.[0-9]+\\([eE][+-]?[0-9]+\\)?\\)\\>\\|"
+ "\\.[0-9]+\\([eE][+-]?[0-9]+\\)?\\>")
+ '(0 mdw-number-face))
- ;; Preprocessor.
- (list (concat "^[ \t]*$[ \t]*\\<\\("
- preprocessor-keywords
- "\\)\\>")
- '(0 font-lock-keyword-face))
+ ;; Preprocessor.
+ (list (concat "^[ \t]*$[ \t]*\\<\\("
+ preprocessor-keywords
+ "\\)\\>")
+ '(0 font-lock-keyword-face))
- ;; And anything else is punctuation.
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face))))))
+ ;; And anything else is punctuation.
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face))))))
(progn
(add-hook 'icon-mode-hook 'mdw-misc-mode-config t)
(mdw-standard-fill-prefix "\\([ \t]*#+[ \t]*\\)")
(make-local-variable 'font-lock-keywords)
(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 mdw-number-face))
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face)))))
+ (list
+ (list (concat "\\<0\\([xX][0-9a-fA-F_]+\\|[0-7_]+\\)\\|"
+ "\\<[0-9][0-9_]*\\(\\.[0-9_]*\\)?"
+ "\\([eE][-+]?[0-9_]+\\)?")
+ '(0 mdw-number-face))
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face)))))
(progn
(add-hook 'tcl-mode-hook 'mdw-misc-mode-config t)
"all-keys" "key" "next" "rest" "include"
"t" "f")))
(setq font-lock-keywords
- (list (list (concat "\\<\\(" dylan-keywords
- "\\|" "with\\(out\\)?-" word
- "\\)\\>")
- '(0 font-lock-keyword-face))
- (list (concat "\\<" word ":" "\\|"
- "#\\(" sharp-keywords "\\)\\>")
- '(0 font-lock-variable-name-face))
- (list (concat "\\("
- "\\([-+]\\|\\<\\)[0-9]+" "\\("
- "\\(\\.[0-9]+\\)?" "\\([eE][-+][0-9]+\\)?"
- "\\|" "/[0-9]+"
- "\\)"
- "\\|" "\\.[0-9]+" "\\([eE][-+][0-9]+\\)?"
- "\\|" "#b[01]+"
- "\\|" "#o[0-7]+"
- "\\|" "#x[0-9a-zA-Z]+"
- "\\)\\>")
- '(0 mdw-number-face))
- (list (concat "\\("
- "\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\|"
- "\\_<[-+*/=<>:&|]+\\_>"
- "\\)")
- '(0 mdw-punct-face))))))
+ (list (list (concat "\\<\\(" dylan-keywords
+ "\\|" "with\\(out\\)?-" word
+ "\\)\\>")
+ '(0 font-lock-keyword-face))
+ (list (concat "\\<" word ":" "\\|"
+ "#\\(" sharp-keywords "\\)\\>")
+ '(0 font-lock-variable-name-face))
+ (list (concat "\\("
+ "\\([-+]\\|\\<\\)[0-9]+" "\\("
+ "\\(\\.[0-9]+\\)?" "\\([eE][-+][0-9]+\\)?"
+ "\\|" "/[0-9]+"
+ "\\)"
+ "\\|" "\\.[0-9]+" "\\([eE][-+][0-9]+\\)?"
+ "\\|" "#b[01]+"
+ "\\|" "#o[0-7]+"
+ "\\|" "#x[0-9a-zA-Z]+"
+ "\\)\\>")
+ '(0 mdw-number-face))
+ (list (concat "\\("
+ "\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\|"
+ "\\_<[-+*/=<>:&|]+\\_>"
+ "\\)")
+ '(0 mdw-punct-face))))))
(progn
(add-hook 'dylan-mode-hook 'mdw-misc-mode-config t)
(i 1 (1+ i)))
((>= i (length word)) regexp)))))
(setq font-lock-keywords
- (list (list (concat "\\<COMMENT\\>"
- "\\(" not-comment "\\)\\{0,5\\}"
- "\\(\\'\\|\\<COMMENT\\>\\)")
- '(0 font-lock-comment-face))
- (list (concat "\\<CO\\>"
- "\\([^C]+\\|C[^O]\\)\\{0,5\\}"
- "\\($\\|\\<CO\\>\\)")
- '(0 font-lock-comment-face))
- (list "\\<[A-Z_]+\\>"
- '(0 font-lock-keyword-face))
- (list (concat "\\<"
- "[0-9]+"
- "\\(\\.[0-9]+\\)?"
- "\\([eE][-+]?[0-9]+\\)?"
- "\\>")
- '(0 mdw-number-face))
- (list "\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/"
- '(0 mdw-punct-face))))))
+ (list (list (concat "\\<COMMENT\\>"
+ "\\(" not-comment "\\)\\{0,5\\}"
+ "\\(\\'\\|\\<COMMENT\\>\\)")
+ '(0 font-lock-comment-face))
+ (list (concat "\\<CO\\>"
+ "\\([^C]+\\|C[^O]\\)\\{0,5\\}"
+ "\\($\\|\\<CO\\>\\)")
+ '(0 font-lock-comment-face))
+ (list "\\<[A-Z_]+\\>"
+ '(0 font-lock-keyword-face))
+ (list (concat "\\<"
+ "[0-9]+"
+ "\\(\\.[0-9]+\\)?"
+ "\\([eE][-+]?[0-9]+\\)?"
+ "\\>")
+ '(0 mdw-number-face))
+ (list "\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/"
+ '(0 mdw-punct-face))))))
(dolist (hook '(a68-mode-hook a68-mode-hooks))
(add-hook hook 'mdw-misc-mode-config t)
"x2d")))
(setq font-lock-keywords
- (list
+ (list
- ;; Set up the keywords defined above.
- (list (concat "\\<\\(" rexx-keywords "\\)\\>")
- '(0 font-lock-keyword-face))
+ ;; Set up the keywords defined above.
+ (list (concat "\\<\\(" rexx-keywords "\\)\\>")
+ '(0 font-lock-keyword-face))
- ;; Fontify all symbols the same way.
- (list (concat "\\<\\([0-9.][A-Za-z0-9.!?_#@$]*[Ee][+-]?[0-9]+\\|"
- "[A-Za-z0-9.!?_#@$]+\\)")
- '(0 font-lock-variable-name-face))
+ ;; Fontify all symbols the same way.
+ (list (concat "\\<\\([0-9.][A-Za-z0-9.!?_#@$]*[Ee][+-]?[0-9]+\\|"
+ "[A-Za-z0-9.!?_#@$]+\\)")
+ '(0 font-lock-variable-name-face))
- ;; And everything else is punctuation.
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face))))))
+ ;; And everything else is punctuation.
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face))))))
(progn
(add-hook 'rexx-mode-hook 'mdw-misc-mode-config t)
"where" "while" "with" "withtype")))
(setq font-lock-keywords
- (list
+ (list
- ;; Set up the keywords defined above.
- (list (concat "\\<\\(" sml-keywords "\\)\\>")
- '(0 font-lock-keyword-face))
+ ;; Set up the keywords defined above.
+ (list (concat "\\<\\(" sml-keywords "\\)\\>")
+ '(0 font-lock-keyword-face))
- ;; At least numbers are simpler than C.
- (list (concat "\\<\\~?"
- "\\(0\\([wW]?[xX][0-9a-fA-F]+\\|"
- "[wW][0-9]+\\)\\|"
- "\\([0-9]+\\(\\.[0-9]+\\)?"
- "\\([eE]\\~?"
- "[0-9]+\\)?\\)\\)")
- '(0 mdw-number-face))
+ ;; At least numbers are simpler than C.
+ (list (concat "\\<\\~?"
+ "\\(0\\([wW]?[xX][0-9a-fA-F]+\\|"
+ "[wW][0-9]+\\)\\|"
+ "\\([0-9]+\\(\\.[0-9]+\\)?"
+ "\\([eE]\\~?"
+ "[0-9]+\\)?\\)\\)")
+ '(0 mdw-number-face))
- ;; And anything else is punctuation.
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face))))))
+ ;; And anything else is punctuation.
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face))))))
(progn
(add-hook 'sml-mode-hook 'mdw-misc-mode-config t)
"SP" "STX" "SUB" "SYN" "US" "VT")))
(setq font-lock-keywords
- (list
- (list (concat "{-" "[^-]*" "\\(-+[^-}][^-]*\\)*"
- "\\(-+}\\|-*\\'\\)"
- "\\|"
- "--.*$")
- '(0 font-lock-comment-face))
- (list (concat "\\_<\\(" haskell-keywords "\\)\\_>")
- '(0 font-lock-keyword-face))
- (list (concat "'\\("
- "[^\\]"
- "\\|"
- "\\\\"
- "\\(" "[abfnrtv\\\"']" "\\|"
- "^" "\\(" control-sequences "\\|"
- "[]A-Z@[\\^_]" "\\)" "\\|"
- "\\|"
- "[0-9]+" "\\|"
- "[oO][0-7]+" "\\|"
- "[xX][0-9A-Fa-f]+"
- "\\)"
- "\\)'")
- '(0 font-lock-string-face))
- (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 mdw-number-face))
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face))))))
+ (list
+ (list (concat "{-" "[^-]*" "\\(-+[^-}][^-]*\\)*"
+ "\\(-+}\\|-*\\'\\)"
+ "\\|"
+ "--.*$")
+ '(0 font-lock-comment-face))
+ (list (concat "\\_<\\(" haskell-keywords "\\)\\_>")
+ '(0 font-lock-keyword-face))
+ (list (concat "'\\("
+ "[^\\]"
+ "\\|"
+ "\\\\"
+ "\\(" "[abfnrtv\\\"']" "\\|"
+ "^" "\\(" control-sequences "\\|"
+ "[]A-Z@[\\^_]" "\\)" "\\|"
+ "\\|"
+ "[0-9]+" "\\|"
+ "[oO][0-7]+" "\\|"
+ "[xX][0-9A-Fa-f]+"
+ "\\)"
+ "\\)'")
+ '(0 font-lock-string-face))
+ (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 mdw-number-face))
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face))))))
(progn
(add-hook 'haskell-mode-hook 'mdw-misc-mode-config t)
"query" "receive" "rem" "try" "when" "xor")))
(setq font-lock-keywords
- (list
- (list "%.*$"
- '(0 font-lock-comment-face))
- (list (concat "\\<\\(" erlang-keywords "\\)\\>")
- '(0 font-lock-keyword-face))
- (list (concat "^-\\sw+\\>")
- '(0 font-lock-keyword-face))
- (list "\\<[0-9]+\\(#[0-9a-zA-Z]+\\|[eE][+-]?[0-9]+\\)?\\>"
- '(0 mdw-number-face))
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face))))))
+ (list
+ (list "%.*$"
+ '(0 font-lock-comment-face))
+ (list (concat "\\<\\(" erlang-keywords "\\)\\>")
+ '(0 font-lock-keyword-face))
+ (list (concat "^-\\sw+\\>")
+ '(0 font-lock-keyword-face))
+ (list "\\<[0-9]+\\(#[0-9a-zA-Z]+\\|[eE][+-]?[0-9]+\\)?\\>"
+ '(0 mdw-number-face))
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face))))))
(progn
(add-hook 'erlang-mode-hook 'mdw-misc-mode-config t)
;; Real fontification things.
(make-local-variable 'font-lock-keywords)
(setq font-lock-keywords
- (list
+ (list
- ;; Environment names are keywords.
- (list "@\\(end\\) *\\([a-zA-Z]*\\)?"
- '(2 font-lock-keyword-face))
+ ;; Environment names are keywords.
+ (list "@\\(end\\) *\\([a-zA-Z]*\\)?"
+ '(2 font-lock-keyword-face))
- ;; Unmark escaped magic characters.
- (list "\\(@\\)\\([@{}]\\)"
- '(1 font-lock-keyword-face)
- '(2 font-lock-variable-name-face))
+ ;; Unmark escaped magic characters.
+ (list "\\(@\\)\\([@{}]\\)"
+ '(1 font-lock-keyword-face)
+ '(2 font-lock-variable-name-face))
- ;; Make sure we get comments properly.
- (list "@c\\(omment\\)?\\( .*\\)?$"
- '(0 font-lock-comment-face))
+ ;; Make sure we get comments properly.
+ (list "@c\\(omment\\)?\\( .*\\)?$"
+ '(0 font-lock-comment-face))
- ;; Command names are keywords.
- (list "@\\([^a-zA-Z@]\\|[a-zA-Z@]*\\)"
- '(0 font-lock-keyword-face))
+ ;; Command names are keywords.
+ (list "@\\([^a-zA-Z@]\\|[a-zA-Z@]*\\)"
+ '(0 font-lock-keyword-face))
- ;; Fontify TeX special characters as punctuation.
- (list "[{}]+"
- '(0 mdw-punct-face)))))
+ ;; Fontify TeX special characters as punctuation.
+ (list "[{}]+"
+ '(0 mdw-punct-face)))))
(dolist (hook '(texinfo-mode-hook TeXinfo-mode-hook))
(add-hook hook 'mdw-misc-mode-config t)
;; Real fontification things.
(make-local-variable 'font-lock-keywords)
(setq font-lock-keywords
- (list
-
- ;; Environment names are keywords.
- (list (concat "\\\\\\(begin\\|end\\|newenvironment\\)"
- "{\\([^}\n]*\\)}")
- '(2 font-lock-keyword-face))
-
- ;; Suspended environment names are keywords too.
- (list (concat "\\\\\\(suspend\\|resume\\)\\(\\[[^]]*\\]\\)?"
- "{\\([^}\n]*\\)}")
- '(3 font-lock-keyword-face))
-
- ;; Command names are keywords.
- (list "\\\\\\([^a-zA-Z@]\\|[a-zA-Z@]*\\)"
- '(0 font-lock-keyword-face))
-
- ;; Handle @/.../ for italics.
- ;; (list "\\(@/\\)\\([^/]*\\)\\(/\\)"
- ;; '(1 font-lock-keyword-face)
- ;; '(3 font-lock-keyword-face))
-
- ;; Handle @*...* for boldness.
- ;; (list "\\(@\\*\\)\\([^*]*\\)\\(\\*\\)"
- ;; '(1 font-lock-keyword-face)
- ;; '(3 font-lock-keyword-face))
-
- ;; Handle @`...' for literal syntax things.
- ;; (list "\\(@`\\)\\([^']*\\)\\('\\)"
- ;; '(1 font-lock-keyword-face)
- ;; '(3 font-lock-keyword-face))
-
- ;; Handle @<...> for nonterminals.
- ;; (list "\\(@<\\)\\([^>]*\\)\\(>\\)"
- ;; '(1 font-lock-keyword-face)
- ;; '(3 font-lock-keyword-face))
-
- ;; Handle other @-commands.
- ;; (list "@\\([^a-zA-Z]\\|[a-zA-Z]*\\)"
- ;; '(0 font-lock-keyword-face))
-
- ;; Make sure we get comments properly.
- (list "%.*"
- '(0 font-lock-comment-face))
-
- ;; Fontify TeX special characters as punctuation.
- (list "[$^_{}#&]"
- '(0 mdw-punct-face)))))
+ (list
+
+ ;; Environment names are keywords.
+ (list (concat "\\\\\\(begin\\|end\\|newenvironment\\)"
+ "{\\([^}\n]*\\)}")
+ '(2 font-lock-keyword-face))
+
+ ;; Suspended environment names are keywords too.
+ (list (concat "\\\\\\(suspend\\|resume\\)\\(\\[[^]]*\\]\\)?"
+ "{\\([^}\n]*\\)}")
+ '(3 font-lock-keyword-face))
+
+ ;; Command names are keywords.
+ (list "\\\\\\([^a-zA-Z@]\\|[a-zA-Z@]*\\)"
+ '(0 font-lock-keyword-face))
+
+ ;; Handle @/.../ for italics.
+ ;; (list "\\(@/\\)\\([^/]*\\)\\(/\\)"
+ ;; '(1 font-lock-keyword-face)
+ ;; '(3 font-lock-keyword-face))
+
+ ;; Handle @*...* for boldness.
+ ;; (list "\\(@\\*\\)\\([^*]*\\)\\(\\*\\)"
+ ;; '(1 font-lock-keyword-face)
+ ;; '(3 font-lock-keyword-face))
+
+ ;; Handle @`...' for literal syntax things.
+ ;; (list "\\(@`\\)\\([^']*\\)\\('\\)"
+ ;; '(1 font-lock-keyword-face)
+ ;; '(3 font-lock-keyword-face))
+
+ ;; Handle @<...> for nonterminals.
+ ;; (list "\\(@<\\)\\([^>]*\\)\\(>\\)"
+ ;; '(1 font-lock-keyword-face)
+ ;; '(3 font-lock-keyword-face))
+
+ ;; Handle other @-commands.
+ ;; (list "@\\([^a-zA-Z]\\|[a-zA-Z]*\\)"
+ ;; '(0 font-lock-keyword-face))
+
+ ;; Make sure we get comments properly.
+ (list "%.*"
+ '(0 font-lock-comment-face))
+
+ ;; Fontify TeX special characters as punctuation.
+ (list "[$^_{}#&]"
+ '(0 mdw-punct-face)))))
(setq TeX-install-font-lock 'tex-font-setup)
(restore-buffer-modified-p nil)))))))
(setq TeX-output-view-style
- '(("^dvi$"
- ("^landscape$" "^pstricks$\\|^pst-\\|^psfrag$")
- "%(o?)dvips -t landscape %d -o && xdg-open %f")
- ("^dvi$" "^pstricks$\\|^pst-\\|^psfrag$"
- "%(o?)dvips %d -o && xdg-open %f")
- ("^dvi$"
- ("^a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4$" "^landscape$")
- "%(o?)xdvi %dS -paper a4r -s 0 %d")
- ("^dvi$" "^a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4$"
- "%(o?)xdvi %dS -paper a4 %d")
- ("^dvi$"
- ("^a5\\(?:comb\\|paper\\)$" "^landscape$")
- "%(o?)xdvi %dS -paper a5r -s 0 %d")
- ("^dvi$" "^a5\\(?:comb\\|paper\\)$" "%(o?)xdvi %dS -paper a5 %d")
- ("^dvi$" "^b5paper$" "%(o?)xdvi %dS -paper b5 %d")
- ("^dvi$" "^letterpaper$" "%(o?)xdvi %dS -paper us %d")
- ("^dvi$" "^legalpaper$" "%(o?)xdvi %dS -paper legal %d")
- ("^dvi$" "^executivepaper$" "%(o?)xdvi %dS -paper 7.25x10.5in %d")
- ("^dvi$" "." "%(o?)xdvi %dS %d")
- ("^pdf$" "." "xdg-open %o")
- ("^html?$" "." "sensible-browser %o")))
+ '(("^dvi$"
+ ("^landscape$" "^pstricks$\\|^pst-\\|^psfrag$")
+ "%(o?)dvips -t landscape %d -o && xdg-open %f")
+ ("^dvi$" "^pstricks$\\|^pst-\\|^psfrag$"
+ "%(o?)dvips %d -o && xdg-open %f")
+ ("^dvi$"
+ ("^a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4$" "^landscape$")
+ "%(o?)xdvi %dS -paper a4r -s 0 %d")
+ ("^dvi$" "^a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4$"
+ "%(o?)xdvi %dS -paper a4 %d")
+ ("^dvi$"
+ ("^a5\\(?:comb\\|paper\\)$" "^landscape$")
+ "%(o?)xdvi %dS -paper a5r -s 0 %d")
+ ("^dvi$" "^a5\\(?:comb\\|paper\\)$" "%(o?)xdvi %dS -paper a5 %d")
+ ("^dvi$" "^b5paper$" "%(o?)xdvi %dS -paper b5 %d")
+ ("^dvi$" "^letterpaper$" "%(o?)xdvi %dS -paper us %d")
+ ("^dvi$" "^legalpaper$" "%(o?)xdvi %dS -paper legal %d")
+ ("^dvi$" "^executivepaper$" "%(o?)xdvi %dS -paper 7.25x10.5in %d")
+ ("^dvi$" "." "%(o?)xdvi %dS %d")
+ ("^pdf$" "." "xdg-open %o")
+ ("^html?$" "." "sensible-browser %o")))
(setq TeX-view-program-list
- '(("mupdf" ("mupdf %o" (mode-io-correlate " %(outpage)")))))
+ '(("mupdf" ("mupdf %o" (mode-io-correlate " %(outpage)")))))
(setq TeX-view-program-selection
- '(((output-dvi style-pstricks) "dvips and gv")
- (output-dvi "xdvi")
- (output-pdf "mupdf")
- (output-html "sensible-browser")))
+ '(((output-dvi style-pstricks) "dvips and gv")
+ (output-dvi "xdvi")
+ (output-pdf "mupdf")
+ (output-html "sensible-browser")))
(setq TeX-open-quote "\""
TeX-close-quote "\"")
reftex-auto-recenter-toc t)
(setq reftex-label-alist
- '(("theorem" ?T "th:" "~\\ref{%s}" t ("theorems?" "th\\.") -2)
- ("axiom" ?A "ax:" "~\\ref{%s}" t ("axioms?" "ax\\.") -2)
- ("definition" ?D "def:" "~\\ref{%s}" t ("definitions?" "def\\.") -2)
- ("proposition" ?P "prop:" "~\\ref{%s}" t
- ("propositions?" "prop\\.") -2)
- ("lemma" ?L "lem:" "~\\ref{%s}" t ("lemmas?" "lem\\.") -2)
- ("example" ?X "eg:" "~\\ref{%s}" t ("examples?") -2)
- ("exercise" ?E "ex:" "~\\ref{%s}" t ("exercises?" "ex\\.") -2)
- ("enumerate" ?i "i:" "~\\ref{%s}" item ("items?"))))
+ '(("theorem" ?T "th:" "~\\ref{%s}" t ("theorems?" "th\\.") -2)
+ ("axiom" ?A "ax:" "~\\ref{%s}" t ("axioms?" "ax\\.") -2)
+ ("definition" ?D "def:" "~\\ref{%s}" t ("definitions?" "def\\.") -2)
+ ("proposition" ?P "prop:" "~\\ref{%s}" t
+ ("propositions?" "prop\\.") -2)
+ ("lemma" ?L "lem:" "~\\ref{%s}" t ("lemmas?" "lem\\.") -2)
+ ("example" ?X "eg:" "~\\ref{%s}" t ("examples?") -2)
+ ("exercise" ?E "ex:" "~\\ref{%s}" t ("exercises?" "ex\\.") -2)
+ ("enumerate" ?i "i:" "~\\ref{%s}" item ("items?"))))
(setq reftex-section-prefixes
- '((0 . "part:")
- (1 . "ch:")
- (t . "sec:")))
+ '((0 . "part:")
+ (1 . "ch:")
+ (t . "sec:")))
(setq bibtex-field-delimiters 'double-quotes
bibtex-align-at-equal-sign t
(mdw-standard-fill-prefix "")
(make-local-variable 'sgml-delimiters)
(setq sgml-delimiters
- '("AND" "&" "COM" "--" "CRO" "&#" "DSC" "]" "DSO" "[" "DTGC" "]"
- "DTGO" "[" "ERO" "&" "ETAGO" ":e" "GRPC" ")" "GRPO" "(" "LIT" "\""
- "LITA" "'" "MDC" ">" "MDO" "<!" "MINUS" "-" "MSC" "]]" "NESTC" "{"
- "NET" "}" "OPT" "?" "OR" "|" "PERO" "%" "PIC" ">" "PIO" "<?"
- "PLUS" "+" "REFC" "." "REP" "*" "RNI" "#" "SEQ" "," "STAGO" ":"
- "TAGC" "." "VI" "=" "MS-START" "<![" "MS-END" "]]>"
- "XML-ECOM" "-->" "XML-PIC" "?>" "XML-SCOM" "<!--" "XML-TAGCE" "/>"
- "NULL" ""))
+ '("AND" "&" "COM" "--" "CRO" "&#" "DSC" "]" "DSO" "[" "DTGC" "]"
+ "DTGO" "[" "ERO" "&" "ETAGO" ":e" "GRPC" ")" "GRPO" "(" "LIT"
+ "\"" "LITA" "'" "MDC" ">" "MDO" "<!" "MINUS" "-" "MSC" "]]"
+ "NESTC" "{" "NET" "}" "OPT" "?" "OR" "|" "PERO" "%" "PIC" ">"
+ "PIO" "<?" "PLUS" "+" "REFC" "." "REP" "*" "RNI" "#" "SEQ" ","
+ "STAGO" ":" "TAGC" "." "VI" "=" "MS-START" "<![" "MS-END" "]]>"
+ "XML-ECOM" "-->" "XML-PIC" "?>" "XML-SCOM" "<!--" "XML-TAGCE"
+ "/>" "NULL" ""))
(setq major-mode 'mdw-sgml-mode)
(setq mode-name "[mdw] SGML")
(run-hooks 'mdw-sgml-mode-hook))
(if assoc
(rplacd assoc frag)
(setq sh-mode-syntax-table-input
- (cons (cons 'rc frag)
- sh-mode-syntax-table-input))))))
+ (cons (cons 'rc frag)
+ sh-mode-syntax-table-input))))))
(progn
(add-hook 'sh-mode-hook 'mdw-misc-mode-config t)
"set" "table" "tagged-optional" "union"
"variadic" "vector" "version" "version-tag")))
(setq messages-mode-keywords
- (list
- (list (concat "\\<\\(" keywords "\\)\\>:")
- '(0 font-lock-keyword-face))
- '("\\([-a-zA-Z0-9]+:\\)" (0 font-lock-warning-face))
- '("\\(\\<[a-z][-_a-zA-Z0-9]*\\)"
- (0 font-lock-variable-name-face))
- '("\\<\\([0-9]+\\)\\>" (0 mdw-number-face))
- '("\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- (0 mdw-punct-face)))))
+ (list
+ (list (concat "\\<\\(" keywords "\\)\\>:")
+ '(0 font-lock-keyword-face))
+ '("\\([-a-zA-Z0-9]+:\\)" (0 font-lock-warning-face))
+ '("\\(\\<[a-z][-_a-zA-Z0-9]*\\)"
+ (0 font-lock-variable-name-face))
+ '("\\<\\([0-9]+\\)\\>" (0 mdw-number-face))
+ '("\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ (0 mdw-punct-face)))))
(setq font-lock-defaults
- '(messages-mode-keywords nil nil nil nil))
+ '(messages-mode-keywords nil nil nil nil))
(run-hooks 'messages-file-hook))
(defun messages-mode ()
"ident" "if" "ifdef" "ifndef" "import" "include"
"line" "pragma" "unassert" "undef" "warning")))
(setq messages-mode-keywords
- (append (list (list (concat "^[ \t]*\\#[ \t]*"
- "\\(include\\|import\\)"
- "[ \t]*\\(<[^>]+\\(>\\)?\\)")
- '(2 font-lock-string-face))
- (list (concat "^\\([ \t]*#[ \t]*\\(\\("
- preprocessor-keywords
- "\\)\\>\\|[0-9]+\\|$\\)\\)")
- '(1 font-lock-keyword-face)))
- messages-mode-keywords)))
+ (append (list (list (concat "^[ \t]*\\#[ \t]*"
+ "\\(include\\|import\\)"
+ "[ \t]*\\(<[^>]+\\(>\\)?\\)")
+ '(2 font-lock-string-face))
+ (list (concat "^\\([ \t]*#[ \t]*\\(\\("
+ preprocessor-keywords
+ "\\)\\>\\|[0-9]+\\|$\\)\\)")
+ '(1 font-lock-keyword-face)))
+ messages-mode-keywords)))
(run-hooks 'cpp-messages-mode-hook))
(progn
(mdw-regexps "each" "divert" "file" "if"
"perl" "set" "string" "type" "write")))
(setq mallow-driver-mode-keywords
- (list
- (list (concat "^%\\s *\\(}\\|\\(" keywords "\\)\\>\\).*$")
- '(0 font-lock-keyword-face))
- (list "^%\\s *\\(#.*\\)?$"
- '(0 font-lock-comment-face))
- (list "^%"
- '(0 font-lock-keyword-face))
- (list "^|?\\(.+\\)$" '(1 mallow-driver-text-face))
- (list "\\${[^}]*}"
- '(0 mallow-driver-substitution-face t)))))
+ (list
+ (list (concat "^%\\s *\\(}\\|\\(" keywords "\\)\\>\\).*$")
+ '(0 font-lock-keyword-face))
+ (list "^%\\s *\\(#.*\\)?$"
+ '(0 font-lock-comment-face))
+ (list "^%"
+ '(0 font-lock-keyword-face))
+ (list "^|?\\(.+\\)$" '(1 mallow-driver-text-face))
+ (list "\\${[^}]*}"
+ '(0 mallow-driver-substitution-face t)))))
(setq font-lock-defaults
'(mallow-driver-mode-keywords nil nil nil nil))
(modify-syntax-entry ?\" "_" mallow-driver-mode-syntax-table)
(make-local-variable 'nfast-debug-mode-keywords)
(setq truncate-lines t)
(setq nfast-debug-mode-keywords
- (list
- '("^\\(NFast_\\(Connect\\|Disconnect\\|Submit\\|Wait\\)\\)"
- (0 font-lock-keyword-face))
- (list (concat "^[ \t]+\\(\\("
- "[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]"
- "[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]"
- "[ \t]+\\)*"
- "[0-9a-fA-F]+\\)[ \t]*$")
- '(0 mdw-number-face))
- '("^[ \t]+\.status=[ \t]+\\<\\(OK\\)\\>"
- (1 font-lock-keyword-face))
- '("^[ \t]+\.status=[ \t]+\\<\\([a-zA-Z][0-9a-zA-Z]*\\)\\>"
- (1 font-lock-warning-face))
- '("^[ \t]+\.status[ \t]+\\<\\(zero\\)\\>"
- (1 nil))
- (list (concat "^[ \t]+\\.cmd=[ \t]+"
- "\\<\\([a-zA-Z][0-9a-zA-Z]*\\)\\>")
- '(1 font-lock-keyword-face))
- '("-?\\<\\([0-9]+\\|0x[0-9a-fA-F]+\\)\\>" (0 mdw-number-face))
- '("^\\([ \t]+[a-z0-9.]+\\)" (0 font-lock-variable-name-face))
- '("\\<\\([a-z][a-z0-9.]+\\)\\>=" (1 font-lock-variable-name-face))
- '("\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" (0 mdw-punct-face))))
+ (list
+ '("^\\(NFast_\\(Connect\\|Disconnect\\|Submit\\|Wait\\)\\)"
+ (0 font-lock-keyword-face))
+ (list (concat "^[ \t]+\\(\\("
+ "[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]"
+ "[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]"
+ "[ \t]+\\)*"
+ "[0-9a-fA-F]+\\)[ \t]*$")
+ '(0 mdw-number-face))
+ '("^[ \t]+\.status=[ \t]+\\<\\(OK\\)\\>"
+ (1 font-lock-keyword-face))
+ '("^[ \t]+\.status=[ \t]+\\<\\([a-zA-Z][0-9a-zA-Z]*\\)\\>"
+ (1 font-lock-warning-face))
+ '("^[ \t]+\.status[ \t]+\\<\\(zero\\)\\>"
+ (1 nil))
+ (list (concat "^[ \t]+\\.cmd=[ \t]+"
+ "\\<\\([a-zA-Z][0-9a-zA-Z]*\\)\\>")
+ '(1 font-lock-keyword-face))
+ '("-?\\<\\([0-9]+\\|0x[0-9a-fA-F]+\\)\\>" (0 mdw-number-face))
+ '("^\\([ \t]+[a-z0-9.]+\\)" (0 font-lock-variable-name-face))
+ '("\\<\\([a-z][a-z0-9.]+\\)\\>=" (1 font-lock-variable-name-face))
+ '("\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" (0 mdw-punct-face))))
(setq font-lock-defaults
- '(nfast-debug-mode-keywords nil nil nil nil))
+ '(nfast-debug-mode-keywords nil nil nil nil))
(run-hooks 'nfast-debug-mode-hook))
;;;--------------------------------------------------------------------------
;; Not much fontification needed.
(make-local-variable 'font-lock-keywords)
- (setq font-lock-keywords
- (list (list (concat "\\("
- "\\_<[-+]?"
- "\\(" "[0-9]+/[0-9]+"
- "\\|" "\\(" "[0-9]+" "\\(\\.[0-9]*\\)?" "\\|"
- "\\.[0-9]+" "\\)"
- "\\([dDeEfFlLsS][-+]?[0-9]+\\)?"
- "\\)"
- "\\|"
- "#"
- "\\(" "x" "[-+]?"
- "[0-9A-Fa-f]+" "\\(/[0-9A-Fa-f]+\\)?"
- "\\|" "o" "[-+]?" "[0-7]+" "\\(/[0-7]+\\)?"
- "\\|" "b" "[-+]?" "[01]+" "\\(/[01]+\\)?"
- "\\|" "[0-9]+" "r" "[-+]?"
- "[0-9a-zA-Z]+" "\\(/[0-9a-zA-Z]+\\)?"
- "\\)"
- "\\)\\_>")
- '(0 mdw-number-face))
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face)))))
+ (setq font-lock-keywords
+ (list (list (concat "\\("
+ "\\_<[-+]?"
+ "\\(" "[0-9]+/[0-9]+"
+ "\\|" "\\(" "[0-9]+" "\\(\\.[0-9]*\\)?" "\\|"
+ "\\.[0-9]+" "\\)"
+ "\\([dDeEfFlLsS][-+]?[0-9]+\\)?"
+ "\\)"
+ "\\|"
+ "#"
+ "\\(" "x" "[-+]?"
+ "[0-9A-Fa-f]+" "\\(/[0-9A-Fa-f]+\\)?"
+ "\\|" "o" "[-+]?" "[0-7]+" "\\(/[0-7]+\\)?"
+ "\\|" "b" "[-+]?" "[01]+" "\\(/[01]+\\)?"
+ "\\|" "[0-9]+" "r" "[-+]?"
+ "[0-9a-zA-Z]+" "\\(/[0-9a-zA-Z]+\\)?"
+ "\\)"
+ "\\)\\_>")
+ '(0 mdw-number-face))
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face)))))
;; Special indentation.
(beginning-of-line)
(setq ad-return-value
- (list
- (cond ((not (lisp-extended-loop-p (elt state 1)))
- (+ baseline-indent lisp-simple-loop-indentation))
- ((looking-at "^\\s-*\\(:?\\sw+\\|;\\)")
- (+ baseline-indent lisp-loop-keyword-indentation))
- (t
- (+ baseline-indent lisp-loop-forms-indentation)))
-
- ;; Tell the caller that the next line needs recomputation, even
- ;; though it doesn't start a sexp.
- loop-indentation)))))
+ (list
+ (cond ((not (lisp-extended-loop-p (elt state 1)))
+ (+ baseline-indent lisp-simple-loop-indentation))
+ ((looking-at "^\\s-*\\(:?\\sw+\\|;\\)")
+ (+ baseline-indent lisp-loop-keyword-indentation))
+ (t
+ (+ baseline-indent lisp-loop-forms-indentation)))
+
+ ;; Tell the caller that the next line needs recomputation,
+ ;; even though it doesn't start a sexp.
+ loop-indentation)))))
;; SLIME setup.
(if found
(rplacd found (cdr head))
(setq slime-lisp-implementations
- (cons head slime-lisp-implementations))))))
+ (cons head slime-lisp-implementations))))))
(setq slime-default-lisp 'sbcl)
;; Hooks.
(defun mdw-fontify-smalltalk ()
(make-local-variable 'font-lock-keywords)
(setq font-lock-keywords
- (list
- (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 mdw-number-face))
- (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
- '(0 mdw-punct-face)))))
+ (list
+ (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 mdw-number-face))
+ (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+ '(0 mdw-punct-face)))))
(progn
(add-hook 'smalltalk-mode 'mdw-misc-mode-config t)
ad-do-it))
(setq magit-repolist-columns
- '(("Name" 16 magit-repolist-column-ident nil)
- ("Version" 18 magit-repolist-column-version nil)
- ("St" 2 magit-repolist-column-dirty nil)
- ("L<U" 3 mdw-repolist-column-unpulled-from-upstream nil)
- ("L>U" 3 mdw-repolist-column-unpushed-to-upstream nil)
- ("Path" 32 magit-repolist-column-path nil)))
+ '(("Name" 16 magit-repolist-column-ident nil)
+ ("Version" 18 magit-repolist-column-version nil)
+ ("St" 2 magit-repolist-column-dirty nil)
+ ("L<U" 3 mdw-repolist-column-unpulled-from-upstream nil)
+ ("L>U" 3 mdw-repolist-column-unpushed-to-upstream nil)
+ ("Path" 32 magit-repolist-column-path nil)))
(setq magit-repository-directories '(("~/etc/profile" . 0)
("~/src/" . 1)))
(defun mdw-mpc-hack-tagbrowsers ()
(setq-local mode-line-format
- '("%e"
- mode-line-frame-identification
- mode-line-buffer-identification)))
+ '("%e"
+ mode-line-frame-identification
+ mode-line-buffer-identification)))
(add-hook 'mpc-tagbrowser-mode-hook 'mdw-mpc-hack-tagbrowsers)
(defun mdw-mpc-hack-songs ()