From: Drew Adams <drew.adams@oracle.com>
To: Lars Ingebrigtsen <larsi@gnus.org>,
Stefan Monnier via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: RE: [External] : Re: Macro expansion containing ‘interactive’
Date: Thu, 19 Aug 2021 15:42:22 +0000 [thread overview]
Message-ID: <SJ0PR10MB5488365088CDF2FA086EC772F3C09@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87k0kh7dyj.fsf@gnus.org>
> >> 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)
> ...)
Are you sure that that modes `declare' form is
backward-compatible with, say, Emacs 20? This
is the only definition of `declare' in Emacs 20,
and it's in `cl-macs.el' - i.e., a (primitive)
emulation of Common Lisp's `declare':
(defmacro declare (&rest specs)
(if (cl-compiling-file)
(while specs
(if (listp cl-declare-stack)
(cl-push (car specs)
cl-declare-stack))
(cl-do-proclaim (cl-pop specs) nil)))
nil)
next prev parent reply other threads:[~2021-08-19 15:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-19 10:30 Macro expansion containing ‘interactive’ Marcus Harnisch
2021-08-19 13:24 ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-08-19 13:37 ` Lars Ingebrigtsen
2021-08-19 15:42 ` Drew Adams [this message]
2021-08-20 21:51 ` [External] : " Stefan Monnier
2021-08-24 8:52 ` Marcus Harnisch
2021-08-25 11:06 ` Lars Ingebrigtsen
2021-08-25 12:53 ` Marcus Harnisch
2021-08-19 14:51 ` Michael Heerdegen
2021-08-19 15:14 ` Stefan Monnier via Users list for the GNU Emacs text editor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SJ0PR10MB5488365088CDF2FA086EC772F3C09@SJ0PR10MB5488.namprd10.prod.outlook.com \
--to=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
--cc=larsi@gnus.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.