[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scratch/command 064f146 1/2: Change command to interactive ... modes
From: |
Stefan Kangas |
Subject: |
Re: scratch/command 064f146 1/2: Change command to interactive ... modes |
Date: |
Sun, 14 Feb 2021 11:23:42 -0600 |
"Basil L. Contovounesios" <contovob@tcd.ie> writes:
> Stefan Kangas <stefankangas@gmail.com> writes:
>
>> This seems to work as expected on both master and Emacs 27:
>>
>> (defmacro future-interactive (arg-descriptor &rest modes)
>> (if (< emacs-major-version 28)
>> `(interactive ,arg-descriptor)
>> `(interactive ,arg-descriptor ,@(mapcar #'eval modes))))
>
> Why is the eval necessary?
Because the correct interactive form is:
(interactive ... foo-mode)
Rather than:
(interactive ... 'foo-mode)
>> (defun foo (arg)
>> (future-interactive "P" 'fundamental-mode)
>> (message "P was %s" arg))
>
> I thought (declare (modes ...)) was the intended way of achieving this
> in packages that need to support older Emacsen too.
Hmm, I suppose that could work. I have no strong opinion, but it might
be a bit messier than the macro. OTOH, you don't need the macro for
that. Maybe we could support both?
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, (continued)
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Lars Ingebrigtsen, 2021/02/16
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Eli Zaretskii, 2021/02/16
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Lars Ingebrigtsen, 2021/02/16
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Eli Zaretskii, 2021/02/16
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Stefan Kangas, 2021/02/16
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Eli Zaretskii, 2021/02/16
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Lars Ingebrigtsen, 2021/02/16
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Jose A. Ortega Ruiz, 2021/02/14
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Stefan Monnier, 2021/02/14
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Basil L. Contovounesios, 2021/02/14
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes,
Stefan Kangas <=
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Basil L. Contovounesios, 2021/02/14
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Stefan Kangas, 2021/02/14
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Alan Mackenzie, 2021/02/14
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Stefan Kangas, 2021/02/14
Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Óscar Fuentes, 2021/02/14