emacs-devel
[Top][All Lists]
Advanced

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

Re: Smarter M-x that filters on major-mode


From: Robert Pluim
Subject: Re: Smarter M-x that filters on major-mode
Date: Fri, 12 Feb 2021 14:40:44 +0100

>>>>> On Fri, 12 Feb 2021 12:19:46 +0100, Lars Ingebrigtsen <larsi@gnus.org> 
>>>>> said:

    Lars> Robert Pluim <rpluim@gmail.com> writes:
    >> 'minor-mode-list'?

    Lars> Oh, I thought that was an XEmacs compat thing, since it's added by 
this
    Lars> function:

    Lars> ---
    Lars> (defun add-minor-mode (toggle name &optional keymap after toggle-fun)
    Lars>   "Register a new minor mode.

    Lars> This is an XEmacs-compatibility function.  Use `define-minor-mode' 
instead.
    Lars> ---

    Lars> Does this doc string mean that one shouldn't use `add-minor-mode'
    Lars> directly, but only through `define-minor-mode'?  But that everything
    Lars> that `add-minor-mode' does isn't XEmacs compat stuff?

I think that docstring is misleading: define-minor-mode calls
add-minor-mode, and thus ends up updating minor-mode-list. It would be
nice if we could rely on that.

    Lars> Which could also conceivably be useful in other situations.
    >> 
    >> If you make changes here, could you arrange for some (buffer-local?)
    >> symbol somewhere to be updated when a minor mode is activated?
    >> Figuring out which minor modes are in effect is currently non-trivial.

    Lars> That does sound like a useful thing...  Since the major mode is
    Lars> determined by the `major-mode' variable, what about a new
    Lars> permanently-local variable `minor-modes'?  `define-minor-mode' would 
be
    Lars> responsible for adding/removing itself to the variable.

You mean the enable/disable function for the minor mode created by
define-minor-mode?

Robert



reply via email to

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