[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Macro expansion containing ‘interactive’
From: |
Lars Ingebrigtsen |
Subject: |
Re: Macro expansion containing ‘interactive’ |
Date: |
Thu, 19 Aug 2021 15:37:24 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Stefan Monnier via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:
>> In an attempt to create a compatibility wrapper for the new optional mode
>> list parameter of ‘interactive’ I am facing difficulties. The definition
>> looks like this:
>
> `interactive` is not a special form. Just like docstrings, it's a part
> of the syntax of `lambda`, so you need to define a `foo-lambda` if you
> want it to work reliably.
Yup. When doing code that needs to be backwards-compatible here, it's
better to use a declare form instead:
(defun foo ()
(declare (modes dired-mode))
(interactive)
...)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Re: Macro expansion containing ‘interactive’, Michael Heerdegen, 2021/08/19