X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/ed7b46b929b31bc38b472caeeededbd676371afc..0e58a7c2869daf65ca2c854c82dacef040b46a5f:/el/dot-emacs.el diff --git a/el/dot-emacs.el b/el/dot-emacs.el index 4d82b1a..797c7dc 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -665,6 +665,14 @@ case." (defvar mdw-auto-indent t "Whether to indent automatically after a newline.") +(defun mdw-whitespace-mode (&optional arg) + "Turn on/off whitespace mode, but don't highlight trailing space." + (interactive "P") + (when (and (boundp 'whitespace-style) + (fboundp 'whitespace-mode)) + (let ((whitespace-style (remove 'trailing whitespace-style))) + (whitespace-mode arg)))) + (defun mdw-misc-mode-config () (and mdw-auto-indent (cond ((eq major-mode 'lisp-mode) @@ -681,6 +689,7 @@ case." (auto-fill-mode 1) (setq fill-column 77) (setq show-trailing-whitespace t) + (mdw-whitespace-mode 1) (and (fboundp 'gtags-mode) (gtags-mode)) (outline-minor-mode t) @@ -689,8 +698,7 @@ case." (trap (turn-on-font-lock))) (defun mdw-post-config-mode-hack () - (let ((whitespace-style (remove 'trailing whitespace-style))) - (trap (whitespace-mode t)))) + (mdw-whitespace-mode 1)) (eval-after-load 'gtags '(progn @@ -737,10 +745,20 @@ doesn't match any of the regular expressions in 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. @@ -2054,6 +2072,35 @@ strip numbers instead." (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. (defun messages-mode-guts ()