On Fri, Nov 28 2008, Stephen J. Turnbull wrote:
Reiner Steib writes:
> The justification for turn-on-... (and turn-off-...) is/was that is
> simplifies adding it to a hook:
>
> (add-hook 'text-mode-hook 'turn-on-auto-fill)
Of course; this use is isomorphic to the one in file variables, which
is just a form of local hook, after all.
Yes, but using turn-on-... in hooks seem much more common to me, YMMV.
So with a galaxy of minor modes we add `turn-on-foo' and even
more
rarely `turn-off-foo' commands only when users complain about a
particular one, is that it?
Richard's recommendation was:
,----[
http://thread.gmane.org/gmane.emacs.devel/54509/focus=54616 ]
| So my idea is, let's add such functions for the modes people often
| want to enable in these hooks.
`----
This is an ugly hack. I can think of many generic ways to deal with
it. For example, add-hook (or run-hooks!) could do [...]
If that's too much magic for one's taste, then we could update
define-minor-mode to always generate the "turn-on/off-" forms.
I like Stefan's idea (dunno if it has been implemented in the
meantime):
,----[
http://thread.gmane.org/gmane.emacs.devel/54509/focus=54588 ]
| Stefan had a (what I thought was) clever suggestion to deal with this:
| Make "...-mode" functions toggle only when used interactively (just as
| they only print a message when used interactively), and otherwise have
| them just enable the state unconditionally.
`----
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available |
http://rsteib.home.pages.de/
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta