emacs-devel
[Top][All Lists]
Advanced

[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?



reply via email to

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