emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How about a non-nil and non-t value of show-trailing-whitespa ce?


From: Eli Zaretskii
Subject: RE: How about a non-nil and non-t value of show-trailing-whitespa ce?
Date: Mon, 30 Jul 2001 19:18:29 +0300 (IDT)

On Mon, 30 Jul 2001, Marshall, Simon wrote:

> What is the point of showing trailing whitespace in someone else's file?

What if I'm a programmers' team leader and want to walkthrough their code?

> Or in a buffer generated by Emacs?  What does the user gain by seeing it
> highlighted?
> 
> Maybe a more general solution is better, also since novice users are not
> going to be adding their own show-trailing-whitespace toggling functions
> to 3 different hooks (find-file-hooks, vc-checkin-hook and
> vc-checkout-hook).  (Instead, they will just disable the feature---a
> pity.)

Here's my solution to this issue (from my .emacs):

;;; Turn on trailing whitespace highlighting in modes where
;;; it makes sense.
(let* ((twh-modes '("texinfo-mode" "makefile-mode" "c-mode-common"
                    "emacs-lisp-mode" "outline-mode" "sh-mode"
                    "shell-script-mode"))
       (elt (car twh-modes)))
  (while elt
    (add-hook (intern (concat elt "-hook"))
              (function (lambda ()
                          (setq show-trailing-whitespace t))))
    (setq twh-modes (cdr twh-modes)
          elt (car twh-modes))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]