[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: |
Sat, 13 Feb 2021 12:28:20 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> There seems to be an assumption here that the defining info to hiding
> a command (or not) is the current major mode.
>
> While it's an important case, I think it'd be a mistake to design
> a feature that can only use such tests. There are many other useful
> conditions that one might like to test, such as the activation of the
> region, the existence of some other buffer, etc...
Commands bound to modes cover 97% of the cases, my stats dept. informs
me, so I think it's important to have a short, easy form to allow
annotating functions according to modes -- hence the
`interactive'/`command' bit: If there's any hope in having people
actually do markup in this way, it should be easy to do, and the
resulting code shouldn't be a chore to look at.
But for the remaining 3% of the cases, a more general mechanism is
needed, and that's why I added the (declare (completion PREDICATE))
thing, too.
That is
(interactive "p" foo-mode)
is identical to
(declare (completion completion-major-mode-p))
(interactive "p")
in effect. But the former is nicer to type and read, I think.
--
(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, Stefan Monnier, 2021/02/12
- Re: Smarter M-x that filters on major-mode, jao, 2021/02/12
- Re: Smarter M-x that filters on major-mode, Dmitry Gutov, 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, Óscar Fuentes, 2021/02/12
- RE: [External] : Re: Smarter M-x that filters on major-mode, Drew Adams, 2021/02/12
- Re: [External] : Re: Smarter M-x that filters on major-mode, Óscar Fuentes, 2021/02/12
- RE: [External] : Re: Smarter M-x that filters on major-mode, Drew Adams, 2021/02/12
- Re: [External] : 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/13
- RE: [External] : Re: Smarter M-x that filters on major-mode, Drew Adams, 2021/02/13
- Re: [External] : Re: Smarter M-x that filters on major-mode, Stefan Monnier, 2021/02/13
- RE: [External] : Re: Smarter M-x that filters on major-mode, Drew Adams, 2021/02/14
- Re: [External] : Re: Smarter M-x that filters on major-mode, Stefan Monnier, 2021/02/14
- Re: Smarter M-x that filters on major-mode, Lars Ingebrigtsen, 2021/02/14
- Re: Smarter M-x that filters on major-mode, Basil L. Contovounesios, 2021/02/14
- Re: Smarter M-x that filters on major-mode, Lars Ingebrigtsen, 2021/02/14
- Re: Smarter M-x that filters on major-mode, Basil L. Contovounesios, 2021/02/14
- Re: Smarter M-x that filters on major-mode, Lars Ingebrigtsen, 2021/02/14