(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)
(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)
(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
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.
(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 ()