help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to apply a minor mode to all buffers


From: Eli Zaretskii
Subject: Re: How to apply a minor mode to all buffers
Date: Tue, 23 Jan 2007 23:56:50 +0200

> From: "Robert Thorpe" <rthorpe@realworldtech.com>
> Date: 23 Jan 2007 09:48:47 -0800
> >
> >     ;;; 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))))
> >
> > If I ever need to do that in an additional mode, all I have to do is
> > add another mode name to the list at the beginning of this snippet:
> > hardly a tedious job.
> 
> Sure, I once did something similar in .emacs. It's not exactly friendly
> to beginners who might want to do this though.

I doubt that beginners would think about such advanced customizations
as the one that started this thread.




reply via email to

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