[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Smarter M-x that filters on major-mode
From: |
Lars Ingebrigtsen |
Subject: |
Re: Smarter M-x that filters on major-mode |
Date: |
Fri, 12 Feb 2021 10:59:20 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 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 ...
I started implementing this bit, but I'm not sure whether an EXP that
gets turned into a lambda with no parameters is the best design here...
That is, the common predicates I've encountered while doing markup in
the gnus*.el files are:
-- based on major mode (needs the symbol name and the current buffer,
but can probably assume we're in a specific buffer)
-- buttons (needs the symbol name, and in addition to the major mode
needs to look at properties at point)
-- minor modes (needs to check whether the mode is on or off)
So I'm wondering whether this should be
(declare (completion (lambda (buffer symbol) ...)))
but we'll have a number of standard predicates, so that'd normally be
(declare (completion completion-in-major-mode-p))
(declare (completion completion-on-button-p))
(declare (completion completion-minor-mode-enabled-p))
or something along those lines...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- Re: Smarter M-x that filters on major-mode, (continued)
- Re: Smarter M-x that filters on major-mode, Lars Ingebrigtsen, 2021/02/11
- Re: Smarter M-x that filters on major-mode, Lars Ingebrigtsen, 2021/02/11
- Re: Smarter M-x that filters on major-mode, Stefan Monnier, 2021/02/11
- Re: Smarter M-x that filters on major-mode, Lars Ingebrigtsen, 2021/02/12
- Re: Smarter M-x that filters on major-mode, Stefan Monnier, 2021/02/12
- Re: Smarter M-x that filters on major-mode, Lars Ingebrigtsen, 2021/02/13
- Re: Smarter M-x that filters on major-mode,
Lars Ingebrigtsen <=
- Re: Smarter M-x that filters on major-mode, Lars Ingebrigtsen, 2021/02/12
- Re: Smarter M-x that filters on major-mode, Robert Pluim, 2021/02/12
- Re: Smarter M-x that filters on major-mode, Lars Ingebrigtsen, 2021/02/12
- Re: Smarter M-x that filters on major-mode, Robert Pluim, 2021/02/12
- Re: Smarter M-x that filters on major-mode, Lars Ingebrigtsen, 2021/02/13
- Re: Smarter M-x that filters on major-mode, tomas, 2021/02/11
- RE: [External] : Re: Smarter M-x that filters on major-mode, Drew Adams, 2021/02/11
- Re: Smarter M-x that filters on major-mode, Óscar Fuentes, 2021/02/11
- Re: Smarter M-x that filters on major-mode, Eli Zaretskii, 2021/02/11
- Re: Smarter M-x that filters on major-mode, tomas, 2021/02/11