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: Marshall, Simon
Subject: RE: How about a non-nil and non-t value of show-trailing-whitespa ce?
Date: Mon, 30 Jul 2001 17:36:27 +0100

> > 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?

Then you can set show-trailing-whitespace to t.
Team members might prefer to set it to 'not-read-only.

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

We know how to do this, but surely novice users are more likely just to
never use the feature.

I admit that my suggestion is also arbitrary (why not restrict it to
writable file-visiting buffers, rather than writable buffers?) but it's
worth thinking about.



reply via email to

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