help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Macro expansion containing ‘interactive’


From: Marcus Harnisch
Subject: Macro expansion containing ‘interactive’
Date: Thu, 19 Aug 2021 12:30:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

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




reply via email to

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