all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Macro expansion containing ‘interactive’
@ 2021-08-19 10:30 Marcus Harnisch
  2021-08-19 13:24 ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 10+ messages in thread
From: Marcus Harnisch @ 2021-08-19 10:30 UTC (permalink / raw)
  To: help-gnu-emacs

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:

   (defmacro foo--interactive (&optional arg-descriptor)
     "Compatibility wrapper to support `interactive' with additional
   MODE parameter (Emacs 28+)."
     ;; https://lars.ingebrigtsen.no/2021/02/16/command-discovery-in-emacs/
     (if (and (featurep 'emacs)
              (>= emacs-major-version 28))
         `(interactive ,arg-descriptor foo-mode)
       `(interactive ,arg-descriptor)))

According to ‘(macroexpand '(foo--interactive "bar"))’ the expansion 
itself seems to work. However, I still see all of foo-mode's interactive 
functions being completed with ‘M-x foo TAB’ from buffer ‘*scratch*’ 
(which is not in ‘foo-mode’).

The Emacs process itself is started with:

   emacs -l foo-mode.el -Q

Any ideas how to debug/fix this?

Thanks,
Marcus




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-08-25 12:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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     ` [External] : " Drew Adams
2021-08-20 21:51       ` 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

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.