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: Stefan Monnier
Subject: Re: Smarter M-x that filters on major-mode
Date: Thu, 11 Feb 2021 09:38:10 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> What would the syntax for marking these commands be?  Perhaps a
> `declare' form would be the best thing here?

Yes, `declare` sounds like the right tool.
It can expand to the usual `define-symbol-prop`.

>   (command foo-mode "p")
>
> for the normal case, then perhaps it doesn't make sense to clutter up
> that simple syntax with something for this thing.

How 'bout

    (declare (M-x-pred EXP))

which turns into

    (define-symbol-prop '[SYM] (lambda () EXP))

so EXP can be (derived-mode-p 'foo-mode) or it can be nil, or ...


        Stefan




reply via email to

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