GNU bug report logs -
#13646
Mode-specific and file-regexp-specific settings
Previous Next
Reported by: Didier Verna <didier <at> didierverna.net>
Date: Thu, 7 Feb 2013 12:46:01 UTC
Severity: wishlist
Tags: wontfix
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Stefan Monnier <monnier <at> IRO.UMontreal.CA> wrote:
> Also, we should introduce a way to set variables to a value that is
> mode-dependent. Maybe something like
>
> (setq-modes whitespace-style
> (foo-mode 'face)
> (bar-mode 'trailing)
> (t 'tab-mark))
>
> Which could turn into something akin to
>
> (setq-default whitespace-style 'tab-mark)
> (add-hook 'bar-mode-hook (lambda () (setq-local whitespace-style 'trailing)))
> (add-hook 'foo-mode-hook (lambda () (setq-local whitespace-style 'face)))
Oh, and BTW this is not gonna work. What you're doing here is
instantiating buffer-local values once and for all. If later on the
user changes his mode-specific settings, they won't be propagated to
the already existing buffers.
On the contrary, what I do in whitespace.el (and I think what should
be done in a general solution) is to dynamically retreive the
file/mode-specific value everytime it's needed, so that user changes
are visible everywhere immediately (this is what specifiers do in
XEmacs in fact).
--
ELS 2013, June 3/4, Madrid, Spain: http://els2013.european-lisp-symposium.org
Scientific site: http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com
This bug report was last modified 4 years and 304 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.