[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: |
Wed, 17 Feb 2021 19:57:01 -0800 |
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Stefan Kangas <stefankangas@gmail.com> writes:
>
>> Please find attached a patch.
>
> Hm... trying this out now, I don't think the compat macro solution
> actually works. That is, it works fine when byte-compiled, but not in
> non-compiled code. The reason for this is that `interactive-form' just
> does a `Fassq' on the Lisp form and looks for the Qinteractive symbol.
> Which is won't find if the symbol in `future-interactive'.
It is working for me in Emacs 27, and it was working for me at the time
when I wrote it (both byte-compiled and interpreted).
I test by evaluating this in "emacs -Q":
(defmacro future-interactive (arg-descriptor &rest modes)
"Use the correct `interactive' form for any Emacs version.
This is a forward compatibility macro that allows code providing
the third argument to `interactive' (added in Emacs 28) to
continue working on old versions of Emacs.
To use it, replace `interactive' with `future-interactive'."
(if (< emacs-major-version 28)
`(interactive ,arg-descriptor)
`(interactive ,arg-descriptor ,@modes)))
(defun foo (arg)
(future-interactive "P" fundamental-mode)
(message "P was %s" arg))
And then I say `M-x foo RET'. If `footnote-mode' is activated, the
macro did not work as expected, otherwise it did.
Bisecting points to c1ef7adeb649aa as the first commit that broke it.
Are you seeing the same thing?
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, (continued)
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Juri Linkov, 2021/02/17
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Stefan Kangas, 2021/02/17
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Lars Ingebrigtsen, 2021/02/17
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Juri Linkov, 2021/02/17
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Eli Zaretskii, 2021/02/17
- 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, Lars Ingebrigtsen, 2021/02/17
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Stefan Monnier, 2021/02/17
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Lars Ingebrigtsen, 2021/02/17
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Stefan Monnier, 2021/02/17
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes,
Stefan Kangas <=
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Stefan Monnier, 2021/02/17
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Stefan Kangas, 2021/02/18
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Lars Ingebrigtsen, 2021/02/18
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Lars Ingebrigtsen, 2021/02/18
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Lars Ingebrigtsen, 2021/02/18
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Stefan Monnier, 2021/02/18
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Stefan Monnier, 2021/02/18
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Basil L. Contovounesios, 2021/02/18
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Lars Ingebrigtsen, 2021/02/19
- Re: scratch/command 064f146 1/2: Change command to interactive ... modes, Stefan Monnier, 2021/02/19