emacs-devel
[Top][All Lists]
Advanced

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

Re: turn-on-bug-reference-mode, turn-on-bug-reference-prog-mode type fun


From: Stefan Monnier
Subject: Re: turn-on-bug-reference-mode, turn-on-bug-reference-prog-mode type functions
Date: Sat, 03 Apr 2010 15:23:37 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> Another way to achieve this result is cleaner but a bigger change.  It
> would be to change the meaning of the expression (MINOR-MODE-FUNCTION)
> so it turns the mode on, instead of toggling.  This way, it would not
> behave specially when called from a hook.  And I think that this behavior
> will seem more natural to people writing Lisp programs.

It's on my secret plan for Emacs-24, yes.

> However, we must not change the meaning of M-x MINOR-MODE-FUNCTION RET.
> That must continue to toggle, as users expect.
> We might want to invent another argument to make the Lisp function
> toggle the minor mode.  After all, the interactive call has to convey
> that intention to the function via arguments.

The invention is already in Emacs-23 (maybe it even was there in
Emacs-22 already): minor modes defined with define-minor-mode already
use `toggle' (rather than nil) as argument value when
called interactively.
So the change you suggest is a one-liner for all minor modes defined
with define-minor-mode.  The harder part is to convert all the remaining
minor modes to use define-minor-mode.


        Stefan




reply via email to

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