From: Mark Wooding Date: Sun, 20 Dec 2009 22:58:29 +0000 (+0000) Subject: Merge remote branches 'ponder' and 'crybaby' X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/4983780af98c0465162b06554cd55ffcd213cfcd?ds=inline;hp=-c Merge remote branches 'ponder' and 'crybaby' * ponder: el/dot-emacs.el: Aliases for `eshell'. el/dot-emacs.el: Remove menu bar from dumb terminals. el/dot-emacs.el: Remove stray debugging code. el/dot-emacs.el: Emacs 22 doesn't have `whitespace-mode'. dot/bash_profile: Use Perforce configuration files. * crybaby: emacs: Yet another spelling of `git' in `vc-handled-backends'. el/dot-emacs.el: Clobber `comint-highlight-input' properly. --- 4983780af98c0465162b06554cd55ffcd213cfcd diff --combined dot/emacs index fe58c97,054f9da..2a7796a --- a/dot/emacs +++ b/dot/emacs @@@ -45,7 -45,7 +45,7 @@@ (add-to-list 'auto-mode-alist `(,(concat "/debian/" "\\(" - "[" "[:lower:][:digit:]]" + "[" "[:lower:][:digit:]]" "[[:lower:][:digit:].+-" "]+" "\\." "\\)?" @@@ -55,6 -55,7 +55,7 @@@ (and (library-exists-p "vc-git") (not (memq 'GIT vc-handled-backends)) (not (memq 'Git vc-handled-backends)) + (not (memq 'git vc-handled-backends)) (setq vc-handled-backends (cons 'GIT vc-handled-backends))) (trap (or mdw-fast-startup (require 'p4))) @@@ -202,11 -203,7 +203,11 @@@ (setq-default fill-column 77) ;I use rather narrow windows (setq-default comment-column 40) ;Set a standard comment column (setq-default truncate-partial-width-windows nil) -(setq woman-use-own-frame nil) ;Keep man pages somewhere sensible +(setq default-indicate-empty-lines t) +(setq whitespace-style + '(trailing space-before-tab space-after-tab empty indentation)) +(setq woman-use-own-frame nil ;Keep man pages somewhere sensible + woman-fill-column 72) ;Right margin position. (setq diff-switches "-u" ;I like reading unified diffs cvs-diff-flags (list diff-switches)) (setq echo-keystrokes 10) ;Long delay before keystrokes echo diff --combined el/dot-emacs.el index 5a152f0,1d2ddec..4969f29 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@@ -349,6 -349,7 +349,6 @@@ probably become garbage. (car alists) (cdr alists))))) - (defun mdw-do-uniquify (done end l rest) "A helper function for mdw-uniquify-alist. The DONE argument is a list whose first element is `nil'. It @@@ -681,8 -682,6 +681,8 @@@ case. (auto-fill-mode 1) (setq fill-column 77) (setq show-trailing-whitespace t) + (let ((whitespace-style (remove 'trailing whitespace-style))) + (trap (whitespace-mode t))) (and (fboundp 'gtags-mode) (gtags-mode)) (outline-minor-mode t) @@@ -690,10 -689,6 +690,10 @@@ (reveal-mode t) (trap (turn-on-font-lock))) +(defun mdw-post-config-mode-hack () + (let ((whitespace-style (remove 'trailing whitespace-style))) + (trap (whitespace-mode t)))) + (eval-after-load 'gtags '(progn (dolist (key '([mouse-2] [mouse-3])) @@@ -739,20 -734,10 +739,20 @@@ doesn't match any of the regular expres frame-display) (progn "frame %s still uses us" nil))) (frame-list)))) - (message "turn out the lights") (run-with-idle-timer 0 nil #'x-close-connection frame-display)))) (add-hook 'delete-frame-functions 'mdw-last-one-out-turn-off-the-lights) +(defvar mdw-frame-parameters-alist + '((nil (menu-bar-lines . 0)))) +(defun mdw-set-frame-parameters (frame) + (let ((params (assq (if (fboundp 'window-system) + (window-system frame) + window-system) + mdw-frame-parameters-alist))) + (when params + (modify-frame-parameters frame (cdr params))))) +(add-hook 'after-make-frame-functions 'mdw-set-frame-parameters) + ;;;-------------------------------------------------------------------------- ;;; General fontification. @@@ -815,7 -800,8 +815,8 @@@ (mdw-define-face comint-highlight-prompt (t :weight bold)) - (mdw-define-face comint-highlight-input) + (mdw-define-face comint-highlight-input + (t nil)) (mdw-define-face trailing-whitespace (((class color)) :background "red") @@@ -889,7 -875,8 +890,8 @@@ (t :foreground "green")) (mdw-define-face diff-removed (t :foreground "red")) - (mdw-define-face diff-context) + (mdw-define-face diff-context + (t nil)) (mdw-define-face erc-input-face (t :foreground "red")) @@@ -1143,9 -1130,7 +1145,9 @@@ ;; And anything else is punctuation. (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face)))))) + '(0 mdw-punct-face)))) + + (mdw-post-config-mode-hack))) ;;;-------------------------------------------------------------------------- ;;; AP calc mode. @@@ -1197,9 -1182,7 +1199,9 @@@ ;; And anything else is punctuation. (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face)))))) + '(0 mdw-punct-face))))) + + (mdw-post-config-mode-hack)) ;;;-------------------------------------------------------------------------- ;;; Java programming configuration. @@@ -1261,9 -1244,7 +1263,9 @@@ ;; And anything else is punctuation. (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face)))))) + '(0 mdw-punct-face))))) + + (mdw-post-config-mode-hack)) ;;;-------------------------------------------------------------------------- ;;; C# programming configuration. @@@ -1330,9 -1311,7 +1332,9 @@@ ;; And anything else is punctuation. (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face)))))) + '(0 mdw-punct-face))))) + + (mdw-post-config-mode-hack)) (define-derived-mode csharp-mode java-mode "C#" "Major mode for editing C# code.") @@@ -1368,9 -1347,7 +1370,9 @@@ ;; And anything else is punctuation. (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face)))))) + '(0 mdw-punct-face))))) + + (mdw-post-config-mode-hack)) ;;;-------------------------------------------------------------------------- ;;; Awk programming configuration. @@@ -1428,9 -1405,7 +1430,9 @@@ ;; And anything else is punctuation. (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face)))))) + '(0 mdw-punct-face))))) + + (mdw-post-config-mode-hack)) ;;;-------------------------------------------------------------------------- ;;; Perl programming style. @@@ -1477,9 -1452,7 +1479,9 @@@ ;; And anything else is punctuation. (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face)))))) + '(0 mdw-punct-face))))) + + (mdw-post-config-mode-hack)) (defun perl-number-tests (&optional arg) "Assign consecutive numbers to lines containing `#t'. With ARG, @@@ -1521,9 -1494,7 +1523,9 @@@ strip numbers instead. ;; And anything else is punctuation. (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face))))) + '(0 mdw-punct-face)))) + + (mdw-post-config-mode-hack)) ;; Define Python fontification styles. @@@ -1597,9 -1568,7 +1599,9 @@@ ;; And anything else is punctuation. (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face)))))) + '(0 mdw-punct-face))))) + + (mdw-post-config-mode-hack)) ;;;-------------------------------------------------------------------------- ;;; ARM assembler programming configuration. @@@ -1680,9 -1649,8 +1682,9 @@@ ;; And anything else is punctuation. (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face)))) + '(0 mdw-punct-face))) + (mdw-post-config-mode-hack)) (run-hooks 'arm-assembler-mode-hook)) ;;;-------------------------------------------------------------------------- @@@ -1708,8 -1676,7 +1710,8 @@@ "\\([eE]\\([-+]\\|\\)[0-9_]+\\|\\)") '(0 mdw-number-face)) (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face))))) + '(0 mdw-punct-face)))) + (mdw-post-config-mode-hack)) ;;;-------------------------------------------------------------------------- ;;; REXX configuration. @@@ -1782,9 -1749,7 +1784,9 @@@ ;; And everything else is punctuation. (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face)))))) + '(0 mdw-punct-face))))) + + (mdw-post-config-mode-hack)) ;;;-------------------------------------------------------------------------- ;;; Standard ML programming style. @@@ -1834,9 -1799,7 +1836,9 @@@ ;; And anything else is punctuation. (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face)))))) + '(0 mdw-punct-face))))) + + (mdw-post-config-mode-hack)) ;;;-------------------------------------------------------------------------- ;;; Haskell configuration. @@@ -1873,9 -1836,7 +1875,9 @@@ "\\([eE]\\([-+]\\|\\)[0-9]+\\|\\)") '(0 mdw-number-face)) (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face)))))) + '(0 mdw-punct-face))))) + + (mdw-post-config-mode-hack)) ;;;-------------------------------------------------------------------------- ;;; Erlang configuration. @@@ -1909,9 -1870,7 +1911,9 @@@ (list "\\<[0-9]+\\(\\|#[0-9a-zA-Z]+\\|[eE][+-]?[0-9]+\\)\\>" '(0 mdw-number-face)) (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face)))))) + '(0 mdw-punct-face))))) + + (mdw-post-config-mode-hack)) ;;;-------------------------------------------------------------------------- ;;; Texinfo configuration. @@@ -1945,9 -1904,7 +1947,9 @@@ ;; Fontify TeX special characters as punctuation. (list "[{}]+" - '(0 mdw-punct-face))))) + '(0 mdw-punct-face)))) + + (mdw-post-config-mode-hack)) ;;;-------------------------------------------------------------------------- ;;; TeX and LaTeX configuration. @@@ -2013,9 -1970,7 +2015,9 @@@ ;; Fontify TeX special characters as punctuation. (list "[$^_{}#&]" - '(0 mdw-punct-face))))) + '(0 mdw-punct-face)))) + + (mdw-post-config-mode-hack)) ;;;-------------------------------------------------------------------------- ;;; SGML hacking. @@@ -2065,35 -2020,6 +2067,35 @@@ (setq sh-indentation 2) (setq sh-basic-offset 2)) +;;;-------------------------------------------------------------------------- +;;; Emacs shell mode. + +(defun mdw-eshell-prompt () + (let ((left "[") (right "]")) + (when (= (user-uid) 0) + (setq left "«" right "»")) + (concat left + (save-match-data + (replace-regexp-in-string "\\..*$" "" (system-name))) + " " + (eshell/pwd) + right))) +(setq eshell-prompt-function 'mdw-eshell-prompt) +(setq eshell-prompt-regexp "^\\[[^]]+\\]") + +(defalias 'eshell/e 'find-file) +(defalias 'eshell/w3m 'w3m-goto-url) + +(mdw-define-face eshell-prompt (t :weight bold)) +(mdw-define-face eshell-ls-archive (t :weight bold :foreground "red")) +(mdw-define-face eshell-ls-backup (t :foreground "lightgrey" :slant italic)) +(mdw-define-face eshell-ls-product (t :foreground "lightgrey" :slant italic)) +(mdw-define-face eshell-ls-clutter (t :foreground "lightgrey" :slant italic)) +(mdw-define-face eshell-ls-executable (t :weight bold)) +(mdw-define-face eshell-ls-directory (t :foreground "cyan" :weight bold)) +(mdw-define-face eshell-ls-readonly (t nil)) +(mdw-define-face eshell-ls-symlink (t :foreground "cyan")) + ;;;-------------------------------------------------------------------------- ;;; Messages-file mode. @@@ -2296,8 -2222,7 +2298,8 @@@ "\\([eE]\\([-+]\\|\\)[0-9_]+\\|\\)") '(0 mdw-number-face)) (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face))))) + '(0 mdw-punct-face)))) + (mdw-post-config-mode-hack)) ;; Lispy languages. @@@ -2337,9 -2262,7 +2339,9 @@@ (setq font-lock-keywords (list (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" - '(0 mdw-punct-face))))) + '(0 mdw-punct-face)))) + + (mdw-post-config-mode-hack)) (defun comint-send-and-indent () (interactive)