From 535c927f19260a0fcbb40445367d505eca0ab06b Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 10 Jul 2020 20:44:32 +0100 Subject: [PATCH] dot/emacs, el/dot-emacs.el: Reindent using the new rules. Some occasional reflowing is necessary, but honestly much less than I expected. --- dot/emacs | 419 +++++++-------- el/dot-emacs.el | 1527 ++++++++++++++++++++++++++++--------------------------- 2 files changed, 975 insertions(+), 971 deletions(-) diff --git a/dot/emacs b/dot/emacs index ff4843f..5cb3ef4 100644 --- a/dot/emacs +++ b/dot/emacs @@ -93,9 +93,9 @@ (setq semanticdb-default-save-directory "~/.emacs.d/semanticdb/") (eval-after-load "senator" '(setq isearch-mode-hook - (remq 'senator-isearch-mode-hook isearch-mode-hook) + (remq 'senator-isearch-mode-hook isearch-mode-hook) isearch-mode-end-hook - (remq 'senator-isearch-mode-hook isearch-mode-end-hook))) + (remq 'senator-isearch-mode-hook isearch-mode-end-hook))) ;; Skeleton stuff. @@ -163,14 +163,14 @@ (setq backup-by-copying-when-mismatch t) (setq mdw-backup-disable-regexps - '("/\\.git/COMMIT_EDITMSG$" - "/\\.stgit\\(-edit\\.txt\\|msg\\.txt\\|\\.msg\\)$" - "^/tmp/" "^/var/tmp/")) + '("/\\.git/COMMIT_EDITMSG$" + "/\\.stgit\\(-edit\\.txt\\|msg\\.txt\\|\\.msg\\)$" + "^/tmp/" "^/var/tmp/")) ;; Safe variables. (setq safe-local-variable-values - '((make-backup-files . nil))) + '((make-backup-files . nil))) ;; Calculator fiddling. @@ -188,7 +188,8 @@ mail-signature t mail-yank-prefix "> " mail-archive-file-name nil - message-default-mail-headers "X-Auto-Response-Suppress: DR, RN, NRN, OOF\n" + message-default-mail-headers + "X-Auto-Response-Suppress: DR, RN, NRN, OOF\n" message-default-news-headers "" compose-mail-user-agent-warnings nil) @@ -235,62 +236,62 @@ bbdb-extract-address-components-func 'bbdb-extract-address-components bbdb-allow-duplicates t bbdb/news-auto-create-p - (lambda () - (let ((group gnus-newsgroup-name)) - (and (string-match "^nn\\(imap\\|folder\\)\\+" group) - (not (string-match (concat ":" "\\(" "\\(" "crap" - "\\|" "spam" - "\\|" "lists" - "\\|" "corpus" - "\\)" "\\." - "\\|" "Junk Email$" - "\\)") - group))))) + (lambda () + (let ((group gnus-newsgroup-name)) + (and (string-match "^nn\\(imap\\|folder\\)\\+" group) + (not (string-match (concat ":" "\\(" "\\(" "crap" + "\\|" "spam" + "\\|" "lists" + "\\|" "corpus" + "\\)" "\\." + "\\|" "Junk Email$" + "\\)") + group))))) 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" - "\\|" "mwooding@\\(good\\|blackberry\\)\\.com" - "\\|" "mark\\.wooding@trustonic\\.com" - "\\)$") + (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" + "\\|" "mwooding@\\(good\\|blackberry\\)\\.com" + "\\|" "mark\\.wooding@trustonic\\.com" + "\\)$") bbdb-canonicalize-net-hook - (lambda (addr) - (cond ((null addr) - nil) - ((or (string-match "^mailer-daemon@" addr) - (string-match "\.invalid$" addr) - (string-match (concat "^reply-[0-9a-f]+-[0-9a-f]+_" - "HTML-[0-9]+-[0-9]+-[0-9]+" - "@\\(nationwide-communications\\." - "co\\.uk\\)$") - addr) - (string-match (concat "^[0-9]+@bugs\\." - "\\(" "debian\\.org" - "\\|" "distorted\\.org\\.uk" - "\\)$") - addr) - (string-match (concat "^MicrosoftExchange[0-9a-f]*" - "@newincco\\.onmicrosoft\\.com") - addr) - (member (md5 addr) - '("8815c5583970856799c85a3ee0eb6a9f" ;work wiki spam - "0b94ab4d25dacaa5ac07243a09c9e22e" ;work bug spam - "35fb1633379a1e4d4be3b139cae20111" ;work crucible spam - )) - (and (string-match "^news\\([0-9]+\\)@\\(.*\\)$" addr) - (string= (md5 (match-string 2 addr)) - "879b795aed959b1a000e9f95c132b16c"))) - nil) - ((string-match "^\\([^@+]+\\)\\+[^@]*\\(@.*\\)$" addr) - (concat (match-string 1 addr) (match-string 2 addr))) - (t addr)))) + (lambda (addr) + (cond ((null addr) + nil) + ((or (string-match "^mailer-daemon@" addr) + (string-match "\.invalid$" addr) + (string-match (concat "^reply-[0-9a-f]+-[0-9a-f]+_" + "HTML-[0-9]+-[0-9]+-[0-9]+" + "@\\(nationwide-communications\\." + "co\\.uk\\)$") + addr) + (string-match (concat "^[0-9]+@bugs\\." + "\\(" "debian\\.org" + "\\|" "distorted\\.org\\.uk" + "\\)$") + addr) + (string-match (concat "^MicrosoftExchange[0-9a-f]*" + "@newincco\\.onmicrosoft\\.com") + addr) + (member (md5 addr) + '("8815c5583970856799c85a3ee0eb6a9f" ;work wiki spam + "0b94ab4d25dacaa5ac07243a09c9e22e" ;work bug spam + "35fb1633379a1e4d4be3b139cae20111" ;work crucible spam + )) + (and (string-match "^news\\([0-9]+\\)@\\(.*\\)$" addr) + (string= (md5 (match-string 2 addr)) + "879b795aed959b1a000e9f95c132b16c"))) + nil) + ((string-match "^\\([^@+]+\\)\\+[^@]*\\(@.*\\)$" addr) + (concat (match-string 1 addr) (match-string 2 addr))) + (t addr)))) ;; Customization. @@ -362,7 +363,7 @@ (setq pcomplete-cycle-completions nil ;Who thought that was a good idea? eshell-cmpl-cycle-completions nil) (setq dired-deletion-confirmer ;Make deletion easier in dired - (symbol-function 'y-or-n-p) + (symbol-function 'y-or-n-p) delete-by-moving-to-trash (mdw-emacs-version-p 24) dired-listing-switches "-alF" ;Do `ls -F' things in dired windows wdired-allow-to-change-permissions 'advanced) @@ -446,20 +447,20 @@ (setq ediff-split-window-function 'split-window-horizontally) (setq rfcview-rfc-location-pattern - "/ftp@mirror.distorted.org.uk:/pub/mirrors/rfc/rfc%s.txt" + "/ftp@mirror.distorted.org.uk:/pub/mirrors/rfc/rfc%s.txt" rfcview-std-location-pattern - "/ftp@mirror.distorted.org.uk:/pub/mirrors/rfc/std/std%s.txt" + "/ftp@mirror.distorted.org.uk:/pub/mirrors/rfc/std/std%s.txt" rfcview-index-location - "/ftp@mirror.distorted.org.uk:/pub/mirrors/rfc/rfc-index.txt") + "/ftp@mirror.distorted.org.uk:/pub/mirrors/rfc/rfc-index.txt") ;;;-------------------------------------------------------------------------- ;;; W3 and URL fetching stuff. (let ((proxy (mdw-config 'http-proxy))) (setq url-proxy-services - `(("http" . ,proxy) - ("ftp" . ,proxy) - ("gopher" . ,proxy)))) + `(("http" . ,proxy) + ("ftp" . ,proxy) + ("gopher" . ,proxy)))) (setq url-cookie-untrusted-urls '(".")) (setq browse-url-browser-function (mdw-good-url-browser) @@ -474,8 +475,8 @@ ("application/x-pdf" "\\.pdf\\'" ("xdg-open" file) nil)))) (dolist (e entries) (setq w3m-content-type-alist - (cons e (remove* (car e) w3m-content-type-alist - :key #'car :test #'string=)))))) + (cons e (remove* (car e) w3m-content-type-alist + :key #'car :test #'string=)))))) (setq w3-do-incremental-display t w3-use-menus '(file edit view go bookmark options @@ -512,17 +513,17 @@ (setq european-calendar-style t calendar-date-style 'european calendar-time-display-form - '(24-hours ":" minutes - (if time-zone " (") time-zone (if time-zone ")"))) + '(24-hours ":" minutes + (if time-zone " (") time-zone (if time-zone ")"))) (setq diary-date-forms - '((day "[-/]" month "[^-/0-9]") - (day " *" monthname "[ \t]*\\(\^M\\|\n\\)") - (backup day " *" monthname "\\W+\\<\\([^*0-9]\\|[0-9]+[:aApP]\\)") - (day "[-/]" month "[-/]" year "[^0-9]") - (day " *" monthname " *" year "[^0-9]") - (year "[-/]" month "[-/]" day "[^0-9]") - (dayname "\\W"))) + '((day "[-/]" month "[^-/0-9]") + (day " *" monthname "[ \t]*\\(\^M\\|\n\\)") + (backup day " *" monthname "\\W+\\<\\([^*0-9]\\|[0-9]+[:aApP]\\)") + (day "[-/]" month "[-/]" year "[^0-9]") + (day " *" monthname " *" year "[^0-9]") + (year "[-/]" month "[-/]" day "[^0-9]") + (dayname "\\W"))) ;; Fancy diary handling. @@ -575,8 +576,8 @@ ;; Define more mode hooks for MailCrypt. (setq mdw-mc-modes - '((mdwmail-mode (encrypt . mdwmail-mc-encrypt) - (sign . mdwmail-mc-sign)))) + '((mdwmail-mode (encrypt . mdwmail-mc-encrypt) + (sign . mdwmail-mc-sign)))) ;; Load the MailCrypt support. @@ -609,31 +610,31 @@ (setq frame-background-mode (if mdw-black-background 'dark 'light) frame-inhibit-implied-resize t default-frame-alist - `((width . ,(+ mdw-column-width mdw-frame-width-fudge)) - (height . 33) - (vertical-scroll-bars . right) - (cursor-type . bar) - (cursor-blink . t) - (left-fringe . 5) - (right-fringe . 5) - (scroll-bar-width . 15) - (tool-bar-lines . 0) - (menu-bar-lines . 1) - (cursor-color . "red") - (background-mode . ,frame-background-mode)) + `((width . ,(+ mdw-column-width mdw-frame-width-fudge)) + (height . 33) + (vertical-scroll-bars . right) + (cursor-type . bar) + (cursor-blink . t) + (left-fringe . 5) + (right-fringe . 5) + (scroll-bar-width . 15) + (tool-bar-lines . 0) + (menu-bar-lines . 1) + (cursor-color . "red") + (background-mode . ,frame-background-mode)) initial-frame-alist - `((width . ,(+ mdw-column-width - (if (>= emacs-major-version 21) 0 1))) - (menu-bar-lines . ,(if window-system 1 0))) + `((width . ,(+ mdw-column-width + (if (>= emacs-major-version 21) 0 1))) + (menu-bar-lines . ,(if window-system 1 0))) window-system-default-frame-alist - '((pm (font . "-os2-System VIO-medium-r-normal--*-40-*-*-m-*-cp850") - (menu-font . "8.Helv") - (background-color . "lightgrey")) - (w32 (font . "fixed613 10") - (background-color . "black") - (foreground-color . "white")) - (nil (menu-bar-lines . 0) - (background-color . nil)))) + '((pm (font . "-os2-System VIO-medium-r-normal--*-40-*-*-m-*-cp850") + (menu-font . "8.Helv") + (background-color . "lightgrey")) + (w32 (font . "fixed613 10") + (background-color . "black") + (foreground-color . "white")) + (nil (menu-bar-lines . 0) + (background-color . nil)))) (let ((backg (frame-parameter nil 'background-color))) (if (and backg window-system) (push (cons 'background-color backg) default-frame-alist))) @@ -669,15 +670,15 @@ "\\'")))) (if (boundp 'ido-ubiquitous-command-overrides) (setq ido-ubiquitous-command-overrides - (append ido-ubiquitous-command-overrides - (mapcar (lambda (exclude) - (if (symbolp exclude) - `(enable-old exact - ,(symbol-name exclude)) - `(enable-old regexp ,exclude))) - excludes))) + (append ido-ubiquitous-command-overrides + (mapcar (lambda (exclude) + (if (symbolp exclude) + `(enable-old exact + ,(symbol-name exclude)) + `(enable-old regexp ,exclude))) + excludes))) (setq ido-cr+-function-blacklist - (append ido-cr+-function-blacklist excludes)))) + (append ido-cr+-function-blacklist excludes)))) (setq magit-completing-read-function 'magit-ido-completing-read) (require 'smex) (smex-initialize) (global-set-key [?\M-x] 'smex)) @@ -759,10 +760,10 @@ (eval-after-load "hippie-exp" '(setq hippie-expand-try-functions-list - (remove-if (lambda (name) - (memq name '(try-expand-list - try-expand-list-all-buffers))) - hippie-expand-try-functions-list))) + (remove-if (lambda (name) + (memq name '(try-expand-list + try-expand-list-all-buffers))) + hippie-expand-try-functions-list))) (autoload 'dired-jump "dired-x") (autoload 'dired-jump-other-window "dired-x") @@ -776,7 +777,7 @@ (and (fboundp 'dired-do-relsymlink) (define-key dired-mode-map [?\C-c ?\C-s] 'dired-do-relsymlink)))) (setq dired-guess-shell-alist-user - '(("\\.pdf\\'" "mupdf"))) + '(("\\.pdf\\'" "mupdf"))) (add-hook 'org-mode-hook #'(lambda () (mdw-clobber-evil-keymap org-mode-map))) @@ -790,78 +791,78 @@ ;; Minor mode listing (setq minor-mode-alist - (mdw-uniquify-alist '((reveal-mode (hs-minor-mode - " hs/r" - (global-reveal-mode - "" " Reveal"))) - (hs-minor-mode (reveal-mode "" " hs")) - (abbrev-mode "") - (gtags-mode "")) - minor-mode-alist)) + (mdw-uniquify-alist '((reveal-mode (hs-minor-mode + " hs/r" + (global-reveal-mode + "" " Reveal"))) + (hs-minor-mode (reveal-mode "" " hs")) + (abbrev-mode "") + (gtags-mode "")) + minor-mode-alist)) ;; Recognising types of files. (setq auto-mode-alist - (append `(("\\.p[lm]$" . cperl-mode) - ("\\.sage$" . python-mode) - ("\\.m$" . objc-mode) - ("\\.mxd$" . c-mode) - ("\\.cs$" . csharp-mode) - ("\\.go$" . go-mode) - ("\\.org$" . org-mode) - ("\\.make$" . makefile-mode) - ("\\.mk?d$" . markdown-mode) - ;; ("/[ch]/" . c-mode) - (,(concat "/\\(" - "\\.stgit\\.msg" "\\|" - "\\.topmsg" "\\|" - "\\.git/COMMIT_EDITMSG" "\\|" - "svn-commit\\.tmp" "\\|" - "svk-commit[^/.]*\\.tmp" - "\\)$") - . text-mode) - (,(concat "^" tmpdir "/\\(" - "svk-commit[^/.]*\\.tmp" "\\|" - "gitci\\.[^/.]*" "\\|" - "cvs[^/.]\\{6\\}" "\\|" - "quilt_header\.[^/.]\\{6\\}" - "\\)$") - . text-mode) - ("\\.calc?$" . apcalc-mode) - ("/\\(s\\|sh\\)/" . arm-assembler-mode) - ("\\.\\(cmd\\|exec\\|rexx\\)$" . rexx-mode) - ("\\.st$" . smalltalk-mode) - ("\\.msgs$" . messages-mode) - ("/all-cmds\\.in$" . cpp-messages-mode) - ("\\.\\(tex\\|dtx\\)$" . latex-mode) - ("\\.gc$" . haskell.-mode) - (,(concat "^" (getenv "HOME") "/News/") . mdwmail-mode) - (,(concat "^" tmpdir "/\\(SLRN\\|snd\\|pico\\|mutt\\)") - . mdwmail-mode)) - auto-mode-alist)) + (append `(("\\.p[lm]$" . cperl-mode) + ("\\.sage$" . python-mode) + ("\\.m$" . objc-mode) + ("\\.mxd$" . c-mode) + ("\\.cs$" . csharp-mode) + ("\\.go$" . go-mode) + ("\\.org$" . org-mode) + ("\\.make$" . makefile-mode) + ("\\.mk?d$" . markdown-mode) + ;; ("/[ch]/" . c-mode) + (,(concat "/\\(" + "\\.stgit\\.msg" "\\|" + "\\.topmsg" "\\|" + "\\.git/COMMIT_EDITMSG" "\\|" + "svn-commit\\.tmp" "\\|" + "svk-commit[^/.]*\\.tmp" + "\\)$") + . text-mode) + (,(concat "^" tmpdir "/\\(" + "svk-commit[^/.]*\\.tmp" "\\|" + "gitci\\.[^/.]*" "\\|" + "cvs[^/.]\\{6\\}" "\\|" + "quilt_header\.[^/.]\\{6\\}" + "\\)$") + . text-mode) + ("\\.calc?$" . apcalc-mode) + ("/\\(s\\|sh\\)/" . arm-assembler-mode) + ("\\.\\(cmd\\|exec\\|rexx\\)$" . rexx-mode) + ("\\.st$" . smalltalk-mode) + ("\\.msgs$" . messages-mode) + ("/all-cmds\\.in$" . cpp-messages-mode) + ("\\.\\(tex\\|dtx\\)$" . latex-mode) + ("\\.gc$" . haskell.-mode) + (,(concat "^" (getenv "HOME") "/News/") . mdwmail-mode) + (,(concat "^" tmpdir "/\\(SLRN\\|snd\\|pico\\|mutt\\)") + . mdwmail-mode)) + auto-mode-alist)) (setq interpreter-mode-alist - (append `(("runlisp" . lisp-mode) - ("@BASH@" . sh-mode) - ("@PYTHON@" . python-mode) - ("sage" . python-mode) - ("@PERL@" . cperl-mode) - ("perl" . cperl-mode) - ("@TCLSH@" . tcl-mode) - ("@WISH@" . tcl-mode) - ("tclsh" . tcl-mode) - ("wish" . tcl-mode)) - interpreter-mode-alist)) + (append `(("runlisp" . lisp-mode) + ("@BASH@" . sh-mode) + ("@PYTHON@" . python-mode) + ("sage" . python-mode) + ("@PERL@" . cperl-mode) + ("perl" . cperl-mode) + ("@TCLSH@" . tcl-mode) + ("@WISH@" . tcl-mode) + ("tclsh" . tcl-mode) + ("wish" . tcl-mode)) + interpreter-mode-alist)) (setq completion-ignored-extensions - (append `(".hc" ".hi") completion-ignored-extensions)) + (append `(".hc" ".hi") completion-ignored-extensions)) (dolist (dir (remove-if-not (lambda (ext) (= (aref ext (- (length ext) 1)) ?/)) completion-ignored-extensions)) (if (/= (aref dir 0) ?/) (setq completion-ignored-extensions - (cons (concat "/" dir) - (remove dir completion-ignored-extensions))))) + (cons (concat "/" dir) + (remove dir completion-ignored-extensions))))) ;; Some common local definitions. @@ -876,27 +877,27 @@ '(let ((fix-args (if (mdw-version-< tramp-version "2.1") #'append #'list))) (setq tramp-methods - (mdw-uniquify-alist - `(("become" - (tramp-connection-function tramp-open-connection-su) - (tramp-remote-sh "/bin/sh") - (tramp-login-program "become") - (tramp-copy-program nil) - (tramp-copy-args nil) - (tramp-copy-keep-date-arg nil) - (tramp-login-args ,(funcall fix-args `("TERM=dumb" "%u")))) - ("really" - (tramp-connection-function tramp-open-connection-su) - (tramp-login-program "really") - (tramp-login-args ,(funcall fix-args - `("-u" "%u") - `("--") - `("env" "TERM=dumb" "/bin/sh"))) - (tramp-copy-program nil) - (tramp-copy-args nil) - (tramp-copy-keep-date-arg nil) - (tramp-remote-sh "/bin/sh")) - ,@tramp-methods))) + (mdw-uniquify-alist + `(("become" + (tramp-connection-function tramp-open-connection-su) + (tramp-remote-sh "/bin/sh") + (tramp-login-program "become") + (tramp-copy-program nil) + (tramp-copy-args nil) + (tramp-copy-keep-date-arg nil) + (tramp-login-args ,(funcall fix-args `("TERM=dumb" "%u")))) + ("really" + (tramp-connection-function tramp-open-connection-su) + (tramp-login-program "really") + (tramp-login-args ,(funcall fix-args + `("-u" "%u") + `("--") + `("env" "TERM=dumb" "/bin/sh"))) + (tramp-copy-program nil) + (tramp-copy-args nil) + (tramp-copy-keep-date-arg nil) + (tramp-remote-sh "/bin/sh")) + ,@tramp-methods))) (setq tramp-default-method "ssh") (let ((rootlyness (cond ((executable-find "really") "really") ((executable-find "become") "become") @@ -907,12 +908,12 @@ (this-user (concat "\\`\\(" (user-login-name) "\\|" (user-real-login-name) "\\)?\\'"))) (setq tramp-default-method-alist - `((,this-host nil ,rootlyness) - (nil ,this-user "ssh") - (nil "." ,rootlyness))) + `((,this-host nil ,rootlyness) + (nil ,this-user "ssh") + (nil "." ,rootlyness))) (setq tramp-default-proxies-alist - `((,this-host nil nil) - (nil "." "/ssh:%h:")))))) + `((,this-host nil nil) + (nil "." "/ssh:%h:")))))) ;;;-------------------------------------------------------------------------- ;;; General fontification. @@ -931,16 +932,16 @@ ;; Late, for `mdw-black-background'. (setq-default py-python-command-args - `("-i" "-colors" ,(if mdw-black-background "Linux" "LightBG"))) + `("-i" "-colors" ,(if mdw-black-background "Linux" "LightBG"))) ;;;-------------------------------------------------------------------------- ;;; Blogging. (setq weblogger-config-alist - '(("vox" - ("user" . "mdw") - ("server-url" . "http://vox.distorted.org.uk/admin/mt-xmlrpc.cgi") - ("weblog" . "1")))) + '(("vox" + ("user" . "mdw") + ("server-url" . "http://vox.distorted.org.uk/admin/mt-xmlrpc.cgi") + ("weblog" . "1")))) ;;;-------------------------------------------------------------------------- ;;; Shell mode. @@ -949,8 +950,8 @@ (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._]+\\)?\\):") + (concat "\\(\\([Ee]nter \\|[Oo]ld \\|[Nn]ew \\|[a-zA-Z0-9_]*'s \\|^\\)" + "[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) diff --git a/el/dot-emacs.el b/el/dot-emacs.el index 56cfe06..3692353 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -94,21 +94,21 @@ This may be at the expense of cool features.") "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. @@ -463,7 +463,7 @@ as output rather than a string." (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. @@ -516,7 +516,7 @@ Evil key bindings are defined in `mdw-evil-keymap-keys'." (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) @@ -540,7 +540,7 @@ Evil key bindings are defined in `mdw-evil-keymap-keys'." (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. @@ -568,9 +568,9 @@ This is used by advice on `switch-to-buffer-other-frame' to inhibit finding 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." @@ -616,8 +616,10 @@ Don't do this if `mdw-inhibit-rename-buffer' is non-nil." (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. @@ -625,11 +627,11 @@ Don't do this if `mdw-inhibit-rename-buffer' is non-nil." ;; 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) ": " @@ -710,22 +712,22 @@ to force interactive compilation." #'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. @@ -745,8 +747,8 @@ Not much right now. Just support for doing MailCrypt stuff." (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)))) @@ -855,15 +857,16 @@ Use this to arrange for per-server settings.") (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 @@ -906,7 +909,7 @@ Use this to arrange for per-server settings.") ;; Preferred programs. (setq mailcap-user-mime-data - '(((type . "application/pdf") (viewer . "mupdf %s")))) + '(((type . "application/pdf") (viewer . "mupdf %s")))) ;;;-------------------------------------------------------------------------- ;;; Utility functions. @@ -1059,7 +1062,7 @@ tramp, which seems to get itself into a twist." (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. @@ -1348,11 +1351,11 @@ This is just a short-cut for setting the thing by hand, and by 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. @@ -1969,14 +1972,14 @@ doesn't match any of the regular expressions in :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)) @@ -1999,7 +2002,7 @@ doesn't match any of the regular expressions in (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) @@ -2071,11 +2074,11 @@ set." (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) @@ -2125,14 +2128,14 @@ name, as a symbol." (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) @@ -2289,42 +2292,42 @@ name, as a symbol." "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.") @@ -2360,24 +2363,24 @@ name, as a symbol." "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) @@ -2435,29 +2438,29 @@ name, as a symbol." (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) @@ -2494,29 +2497,29 @@ name, as a symbol." "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) @@ -2544,52 +2547,52 @@ name, as a symbol." (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) @@ -2639,29 +2642,29 @@ name, as a symbol." (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.") @@ -2724,68 +2727,68 @@ name, as a symbol." (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) @@ -2815,44 +2818,44 @@ name, as a symbol." "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)) @@ -2904,33 +2907,33 @@ name, as a symbol." "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) @@ -2976,25 +2979,25 @@ name, as a symbol." "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) @@ -3046,21 +3049,21 @@ name, as a symbol." "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, @@ -3098,21 +3101,21 @@ strip numbers instead." ;; 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. @@ -3136,10 +3139,10 @@ strip numbers instead." (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) @@ -3164,30 +3167,30 @@ strip numbers instead." "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) @@ -3222,31 +3225,31 @@ strip numbers instead." (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) @@ -3290,13 +3293,13 @@ strip numbers instead." (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) @@ -3344,29 +3347,29 @@ strip numbers instead." "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) @@ -3395,24 +3398,24 @@ strip numbers instead." (i 1 (1+ i))) ((>= i (length word)) regexp))))) (setq font-lock-keywords - (list (list (concat "\\" - "\\(" not-comment "\\)\\{0,5\\}" - "\\(\\'\\|\\\\)") - '(0 font-lock-comment-face)) - (list (concat "\\" - "\\([^C]+\\|C[^O]\\)\\{0,5\\}" - "\\($\\|\\\\)") - '(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 "\\" + "\\(" not-comment "\\)\\{0,5\\}" + "\\(\\'\\|\\\\)") + '(0 font-lock-comment-face)) + (list (concat "\\" + "\\([^C]+\\|C[^O]\\)\\{0,5\\}" + "\\($\\|\\\\)") + '(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) @@ -3476,20 +3479,20 @@ strip numbers instead." "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) @@ -3531,24 +3534,24 @@ strip numbers instead." "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) @@ -3603,36 +3606,36 @@ strip numbers instead." "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) @@ -3659,17 +3662,17 @@ strip numbers instead." "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) @@ -3686,28 +3689,28 @@ strip numbers instead." ;; 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) @@ -3740,53 +3743,53 @@ strip numbers instead." ;; 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) @@ -3810,36 +3813,36 @@ strip numbers instead." (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 "\"") @@ -3848,19 +3851,19 @@ strip numbers instead." 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 @@ -3901,14 +3904,14 @@ strip numbers instead." (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" "" "PIO" "" - "XML-ECOM" "-->" "XML-PIC" "?>" "XML-SCOM" "" "XML-PIC" "?>" "XML-SCOM" "