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: Richard Stallman
Subject: Re: turn-on-bug-reference-mode, turn-on-bug-reference-prog-mode type functions
Date: Sat, 03 Apr 2010 14:00:38 -0400

    Do we still want to add turn-on-MINOR_MODE type functions ?

The reason for these is to put them on a major mode hook, so that a
certain major mode would always enable the minor mode.

    Minor modes can be turned on reliably from local variables (or
    .dir_locals.el) or hooks.

Maybe so, but none of those replaces the usage on a major mode hook.

Here's an idea.  In running a normal hook, if the hook function is a
minor mode, it could call the function with t as argument.
That way, putting the minor mode function itself on the hook
will do what people naively expected it to do, and there will
be no need for the turn-on-MINOR_MODE functions.

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.

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.





reply via email to

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