all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, 17871@debbugs.gnu.org
Subject: bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?
Date: Sun, 04 Aug 2019 14:06:39 +0200	[thread overview]
Message-ID: <8736ihb0ds.fsf@mouse.gnus.org> (raw)
In-Reply-To: <87d2dqdsyj.fsf@web.de> (Michael Heerdegen's message of "Mon, 30 Jun 2014 22:48:36 +0200")

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Dunno if that would be good.  Although we can with nadvice use
> the same syntax for defining pieces of advice as for defining functions,
> advices have a different meaning (semantic).  The interactive
> specs of advices are not exactly interactive specs in the common sense -
> although they look similar, they are related, but different features.

Yes, I think the description of this wrinkle of the interactive spec in
advised functions belongs in this section of the manual and not in the
normal `interactive' doc string.

> I think a short example would be good.  Also, the term "function" is a
> bit unclear here, maybe we should add "a lambda expression or fbound
> symbol" or so, to make clear that we don't mean a sexp that returns a
> function.

I've now added the "a lambda ..." etc to the manual, but while trying to
find an example to use here, I came up short.

But the manual says

To interpret the spec received as argument, use
@code{advice-eval-interactive-spec}.

so I went looking for that function, and what I found was slightly
puzzling:

(defun advice-eval-interactive-spec (spec)
  "Evaluate the interactive spec SPEC."
  (cond
   ((stringp spec)
    ;; There's no direct access to the C code (in call-interactively) that
    ;; processes those specs, but that shouldn't stop us, should it?
    ;; FIXME: Despite appearances, this is not faithful: SPEC and
    ;; (advice-eval-interactive-spec SPEC) will behave subtly differently w.r.t
    ;; command-history (and maybe a few other details).
    (call-interactively `(lambda (&rest args) (interactive ,spec) args)))
   ;; ((functionp spec) (funcall spec))
   (t (eval spec))))

The functionp case is commented out?  This was apparently done in
1668ea9062e (in 2012!) by Stefan while rewriting this stuff.

If nobody has missed this since 2012...  perhaps it should just be
removed?  

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





  reply	other threads:[~2019-08-04 12:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-29 14:13 bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function? Drew Adams
2014-06-29 15:01 ` Michael Heerdegen
2014-06-29 15:52   ` Drew Adams
2014-06-29 22:03     ` Stefan Monnier
2014-06-29 23:49       ` Drew Adams
2014-06-30 20:48     ` Michael Heerdegen
2019-08-04 12:06       ` Lars Ingebrigtsen [this message]
2019-08-04 12:45         ` Michael Heerdegen
2019-08-04 12:56           ` Lars Ingebrigtsen
2019-08-04 15:15             ` Štěpán Němec
2019-08-05  6:26             ` Michael Heerdegen
2019-08-05  8:44               ` Štěpán Němec
2019-08-05  9:21               ` Lars Ingebrigtsen
2019-08-18 12:26                 ` Michael Heerdegen
2019-08-18 13:32                   ` Štěpán Němec
2019-08-18 23:06                     ` Lars Ingebrigtsen
2019-08-18 23:50                       ` Štěpán Němec
2019-08-19  0:35                         ` Drew Adams
2019-08-20 21:49                         ` Juri Linkov
2019-08-20 22:44                           ` Štěpán Němec
2019-08-21  7:01                             ` Stefan Monnier
2019-08-21  8:17                               ` Štěpán Němec
2019-08-25 15:51                                 ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=8736ihb0ds.fsf@mouse.gnus.org \
    --to=larsi@gnus.org \
    --cc=17871@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=monnier@iro.umontreal.ca \
    /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 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.