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: Lars Ingebrigtsen
Subject: Re: Smarter M-x that filters on major-mode
Date: Fri, 12 Feb 2021 11:29:19 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> 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...

Er; that'd be (for minor modes)

(defun gnus-pick-start-reading (&optional catch-up)
[...]
  (declare (completion (lambda (s b)
                         (completion-minor-mode-active-p s b 'gnus-pick-mode))))

which is a mouthful...

On the other hand, this could go into the `command' spec, if only we had
a way to distinguish minor modes from major modes, which...  we don't
seem to have?  But we could have: `define-minor-mode' could `put' some
property on the mode symbol to say that, indeed, it's a minor mode.

Which could also conceivably be useful in other situations.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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