summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
415a23d)
We (still) don't want to highlight trailing spaces because
`show-trailing-whitespace' does the job better. But this is a useful
thing to be able to do interactively, so turn it into a command.
Maybe I should think about turning it into a derived minor mode.
(defvar mdw-auto-indent t
"Whether to indent automatically after a newline.")
(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)
(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)
(auto-fill-mode 1)
(setq fill-column 77)
(setq show-trailing-whitespace t)
- (let ((whitespace-style (remove 'trailing whitespace-style)))
- (trap (whitespace-mode t)))
+ (mdw-whitespace-mode 1)
(and (fboundp 'gtags-mode)
(gtags-mode))
(outline-minor-mode t)
(and (fboundp 'gtags-mode)
(gtags-mode))
(outline-minor-mode t)
(trap (turn-on-font-lock)))
(defun mdw-post-config-mode-hack ()
(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
(eval-after-load 'gtags
'(progn