unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Leo Liu <sdl.web@gmail.com>
Cc: 19066@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#19066: 25.0.50; nadvice and interactive-form
Date: Fri, 28 May 2021 04:11:13 +0200	[thread overview]
Message-ID: <87r1hry5dq.fsf@gnus.org> (raw)
In-Reply-To: <87y4rbtqh6.fsf@gmail.com> (Leo Liu's message of "Sun, 16 Nov 2014 18:00:21 +0800")

Leo Liu <sdl.web@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





  reply	other threads:[~2021-05-28  2:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-16 10:00 bug#19066: 25.0.50; nadvice and interactive-form Leo Liu
2021-05-28  2:11 ` Lars Ingebrigtsen [this message]
2021-05-30 17:26   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-31  5:43     ` Lars Ingebrigtsen
2021-05-31 12:49       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r1hry5dq.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=19066@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=sdl.web@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).