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

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

Re: Macro expansion containing ‘interactive’


From: Marcus Harnisch
Subject: Re: Macro expansion containing ‘interactive’
Date: Tue, 24 Aug 2021 10:52:07 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

Hi Lars

On 19/08/2021 15.37, Lars Ingebrigtsen wrote:
Yup.  When doing code that needs to be backwards-compatible here, it's
better to use a declare form instead:

Indeed, the code has to be backwards-compatible to some not-too-distant past.

(defun foo ()
   (declare (modes dired-mode))
   (interactive)
   ...)

This, literally? Doesn't seem to work here. Steps to reproduce:

1. Start ‘emacs -Q’

2. In ‘*scratch*’ buffer eval

   (defun foo ()
     (declare (modes dired-mode))
     (interactive)
     (message "foo"))

3. Type ‘M-x fo TAB’ and notice that ‘foo’ gets listed among all other completion candidates.

4. The ‘eww’ example from you blog doesn't seem to work for me either. Before loading ‘eww.el’, only autoloaded functions are listed, and after loading the command ‘M-x eww TAB’ lists all sorts of different commands while in ‘*scratch*’.

Did I miss anything? Any special completion config needed?

Cheers,
Marcus




reply via email to

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