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: Basil L. Contovounesios
Subject: Re: scratch/command 064f146 1/2: Change command to interactive ... modes
Date: Sun, 14 Feb 2021 16:49:19 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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?

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

Thanks,

-- 
Basil



reply via email to

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