GNU bug report logs - #19066
25.0.50; nadvice and interactive-form

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Sun, 16 Nov 2014 10:02:01 UTC

Severity: normal

Tags: confirmed

Found in versions 25.2, 25.0.50

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Leo Liu <sdl.web <at> gmail.com>
Cc: 19066 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#19066: 25.0.50; nadvice and interactive-form
Date: Fri, 28 May 2021 04:11:13 +0200
Leo Liu <sdl.web <at> gmail.com> writes:

> 1. Start emacs and load a file with these lines:
>
>    (advice-add 'just-one-space :before #'change-interactive-form)
>    (defun change-interactive-form (&optional x y)
>      (interactive (list 1 1))
>      (princ (list x y)))
>
> M-x just-one-space prints (1 nil)
>
> 2. Start emacs and load a file with these lines:
>
>    (defun change-interactive-form (&optional x y)
>      (interactive (list 1 1))
>      (princ (list x y)))
>    (advice-add 'just-one-space :before #'change-interactive-form)
>
> M-x just-one-space errs: apply: Wrong number of arguments: (0 . 1), 2

So whether this works depends on whether `change-interactive-form' is
defined or not when `advice-add' is run?  (The only difference here is
the order.)

Perhaps Stefan has some insights here; added to the CCs.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 4 years and 15 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.