From: Glenn Morris Date: Mon, 6 Feb 2012 00:58:38 +0000 (-0800) Subject: * doc/lispref/modes.texi (Running Hooks): Mention run-hook-wrapped. X-Git-Tag: emacs-pretest-24.0.94~294 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e7bc51d012a620268da85763e8bc233a1132ff3b;p=emacs.git * doc/lispref/modes.texi (Running Hooks): Mention run-hook-wrapped. * etc/NEWS: Related edit. --- diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 933fe82f1e8..e184f263737 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,5 +1,7 @@ 2012-02-06 Glenn Morris + * modes.texi (Running Hooks): Mention run-hook-wrapped. + * control.texi (Handling Errors): Mention condition-case-no-debug and with-demoted-errors. diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 638ab89e37f..b4aa39dfbb9 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -163,6 +163,14 @@ A wrapper-hook also allows for a hook function to completely replace the default definition (by not calling @var{fun}). @end defmac +@defun run-hook-wrapped hook wrap-function &rest args +This function is similar to @code{run-hook-with-args-until-success}. +Like that function, it runs the functions on the abnormal hook +@code{hook}, stopping at the first one that returns non-@code{nil}. +Instead of calling the hook functions directly, though, it actually +calls @code{wrap-function} with arguments @code{fun} and @code{args}. +@end defun + @node Setting Hooks @subsection Setting Hooks diff --git a/etc/NEWS b/etc/NEWS index 136ff60fec3..86b4f60dddf 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1236,8 +1236,12 @@ Instead, the offending function is removed. ** New hook types ++++ *** New function `run-hook-wrapped' for running an abnormal hook by passing the hook functions as arguments to a "wrapping" function. +Like `run-hook-with-args-until-success', it stops at the first +non-nil retun value. + +++ *** New macro `with-wrapper-hook' for running an abnormal hook as a set of "wrapping" filters, similar to around advice.