emacs-devel
[Top][All Lists]
Advanced

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

Re: with-wrapper-hook


From: Stefan Monnier
Subject: Re: with-wrapper-hook
Date: Sun, 23 Oct 2011 22:38:14 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

>   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 via email to

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