unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Chong Yidong <cyd@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: with-wrapper-hook
Date: Sun, 23 Oct 2011 22:38:14 -0400	[thread overview]
Message-ID: <jwvfwij2k50.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87sjmlmh2o.fsf@gnu.org> (Chong Yidong's message of "Sat, 22 Oct 2011 18:55:11 +0800")

>   VAR is a special hook: its functions are called with a first argument
>   which is the "original" code (the BODY), so the hook function can wrap
>   the original function, or call it any number of times (including not
>   calling it at all).  This is similar to an `around' advice.
>   ...

> The 1st argument passed to each function is said to be `the "original"
> code (the BODY)'.  The word "code" is ambiguous---it's really a function
> to be passed to `funcall', right?

Yes, it's the function that would be run if the current hook hadn't been
on the hook var.

> The docstring is unclear about what happens in the case where there's
> more than one function in the hook.  IIUC, stating that the argument is
> `the BODY' is incorrect in that case; actually, the argument passed to
> the Nth hook function is a recursively defined function, which if
> funcalled would behave just as the with-wrapper-hook would if only the
> (N+1) and subsequent hook functions were there.  Correct?

Right.  I think a wording along the lines of what I just wrote above
would be simpler, tho.


        Stefan



      reply	other threads:[~2011-10-24  2:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-22 10:55 with-wrapper-hook Chong Yidong
2011-10-24  2:38 ` Stefan Monnier [this message]

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=jwvfwij2k50.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=cyd@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).