[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#13646: mode-specific and file-regexp-specific settings
From: |
Didier Verna |
Subject: |
bug#13646: mode-specific and file-regexp-specific settings |
Date: |
Thu, 07 Feb 2013 18:25:37 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (darwin) |
Stefan Monnier <monnier@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
- bug#13646: Whitespace support for file/mode-specific styles and actions, Didier Verna, 2013/02/07
- bug#13646: Whitespace support for file/mode-specific styles and actions, Stefan Monnier, 2013/02/07
- bug#13646: Whitespace support for file/mode-specific styles and actions, Didier Verna, 2013/02/07
- bug#13646: Whitespace support for file/mode-specific styles and actions, Glenn Morris, 2013/02/07
- bug#13646: Whitespace support for file/mode-specific styles and actions, Glenn Morris, 2013/02/07
- bug#13646: Whitespace support for file/mode-specific styles and actions, Didier Verna, 2013/02/07
- bug#13646: Whitespace support for file/mode-specific styles and actions, Didier Verna, 2013/02/12
- bug#13646: Whitespace support for file/mode-specific styles and actions, Stefan Monnier, 2013/02/12
- bug#13646: Whitespace support for file/mode-specific styles and actions, Didier Verna, 2013/02/12
- bug#13646: Whitespace support for file/mode-specific styles and actions, Christopher Schmidt, 2013/02/12