help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to make M-x TAB not work on (interactive) declaration?


From: Jean Louis
Subject: Re: How to make M-x TAB not work on (interactive) declaration?
Date: Mon, 9 Jan 2023 00:35:46 +0300
User-agent: Mutt/2.2.9+54 (af2080d) (2022-11-21)

* Tassilo Horn <tsdh@gnu.org> [2023-01-08 11:46]:
> Jean Louis <bugs@gnu.support> writes:
> 
> Hi Jean,
> 
> > Reference:
> > (describe-function 'interactive)
> >
> > If MODES is present, it should be a list of mode names (symbols) that
> > this command is applicable for.  The main effect of this is that ‘M-x
> > TAB’ (by default) won’t list this command if the current buffer’s mode
> > doesn’t match the list.  That is, if either the major mode isn’t
> > derived from them, or (when it’s a minor mode) the mode isn’t in
> > effect.
> 
> MODES is a &rest argument and the mode symbols shouldn't be quoted, so
> you use it like so:
> 
> (defun my-function ()
>   (interactive nil text-mode some-other-mode)
>   (message "Hello"))

Then is not good to say "it should be a list of mode names". Of course
after &rest the argument becomes list, but is not same thing.

Thanks, this way I find that function does not appear in other modes.

--
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

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