2 @c This is part of the GNU Emacs Lisp Reference Manual.
3 @c Copyright (C) 1998, 1999 Free Software Foundation, Inc.
4 @c See the file elisp.texi for copying conditions.
5 @setfilename ../info/advising
6 @node Advising Functions, Debugging, Byte Compilation, Top
7 @chapter Advising Emacs Lisp Functions
8 @cindex advising functions
10 The @dfn{advice} feature lets you add to the existing definition of a
11 function, by @dfn{advising the function}. This is a clean method for a
12 library to customize functions defined by other parts of Emacs---cleaner
13 than redefining the whole function.
15 @cindex piece of advice
16 Each function can have multiple @dfn{pieces of advice}, separately
17 defined. Each defined piece of advice can be @dfn{enabled} or
18 disabled explicitly. All the enabled pieces of advice for any given
19 function actually take effect when you @dfn{activate} advice for that
20 function, or when you define or redefine the function. Note that
21 enabling a piece of advice and activating advice for a function
22 are not the same thing.
24 @strong{Usage Note:} Advice is useful for altering the behavior of
25 existing calls to an existing function. If you want the new behavior
26 for new calls, or for key bindings, it is cleaner to define a new
27 function (or a new command) which uses the existing function.
30 * Simple Advice:: A simple example to explain the basics of advice.
31 * Defining Advice:: Detailed description of @code{defadvice}.
32 * Around-Advice:: Wrapping advice around a function's definition.
33 * Computed Advice:: ...is to @code{defadvice} as @code{fset} is to @code{defun}.
34 * Activation of Advice:: Advice doesn't do anything until you activate it.
35 * Enabling Advice:: You can enable or disable each piece of advice.
36 * Preactivation:: Preactivation is a way of speeding up the
37 loading of compiled advice.
38 * Argument Access in Advice:: How advice can access the function's arguments.
39 * Advising Primitives:: Accessing arguments when advising a primitive.
40 * Combined Definition:: How advice is implemented.
44 @section A Simple Advice Example
46 The command @code{next-line} moves point down vertically one or more
47 lines; it is the standard binding of @kbd{C-n}. When used on the last
48 line of the buffer, this command inserts a newline to create a line to
49 move to if @code{next-line-add-newlines} is non-@code{nil} (its default
52 Suppose you wanted to add a similar feature to @code{previous-line},
53 which would insert a new line at the beginning of the buffer for the
54 command to move to (when @code{next-line-add-newlines} is
55 non-@code{nil}). How could you do this?
57 You could do it by redefining the whole function, but that is not
58 modular. The advice feature provides a cleaner alternative: you can
59 effectively add your code to the existing function definition, without
60 actually changing or even seeing that definition. Here is how to do
64 (defadvice previous-line (before next-line-at-end (arg))
65 "Insert an empty line when moving up from the top line."
66 (if (and next-line-add-newlines (= arg 1)
67 (save-excursion (beginning-of-line) (bobp)))
73 This expression defines a @dfn{piece of advice} for the function
74 @code{previous-line}. This piece of advice is named
75 @code{next-line-at-end}, and the symbol @code{before} says that it is
76 @dfn{before-advice} which should run before the regular definition of
77 @code{previous-line}. @code{(arg)} specifies how the advice code can
78 refer to the function's arguments.
80 When this piece of advice runs, it creates an additional line, in the
81 situation where that is appropriate, but does not move point to that
82 line. This is the correct way to write the advice, because the normal
83 definition will run afterward and will move back to the newly inserted
86 Defining the advice doesn't immediately change the function
87 @code{previous-line}. That happens when you @dfn{activate} the advice,
91 (ad-activate 'previous-line)
95 This is what actually begins to use the advice that has been defined so
96 far for the function @code{previous-line}. Henceforth, whenever that
97 function is run, whether invoked by the user with @kbd{C-p} or
98 @kbd{M-x}, or called from Lisp, it runs the advice first, and its
99 regular definition second.
101 This example illustrates before-advice, which is one @dfn{class} of
102 advice: it runs before the function's base definition. There are two
103 other advice classes: @dfn{after-advice}, which runs after the base
104 definition, and @dfn{around-advice}, which lets you specify an
105 expression to wrap around the invocation of the base definition.
107 @node Defining Advice
108 @section Defining Advice
109 @cindex defining advice
110 @cindex advice, defining
112 To define a piece of advice, use the macro @code{defadvice}. A call
113 to @code{defadvice} has the following syntax, which is based on the
114 syntax of @code{defun} and @code{defmacro}, but adds more:
118 (defadvice @var{function} (@var{class} @var{name}
119 @r{[}@var{position}@r{]} @r{[}@var{arglist}@r{]}
121 @r{[}@var{documentation-string}@r{]}
122 @r{[}@var{interactive-form}@r{]}
127 Here, @var{function} is the name of the function (or macro or special
128 form) to be advised. From now on, we will write just ``function'' when
129 describing the entity being advised, but this always includes macros and
132 @cindex class of advice
133 @cindex before-advice
135 @cindex around-advice
136 @var{class} specifies the @dfn{class} of the advice---one of @code{before},
137 @code{after}, or @code{around}. Before-advice runs before the function
138 itself; after-advice runs after the function itself; around-advice is
139 wrapped around the execution of the function itself. After-advice and
140 around-advice can override the return value by setting
141 @code{ad-return-value}.
143 @defvar ad-return-value
144 While advice is executing, after the function's original definition has
145 been executed, this variable holds its return value, which will
146 ultimately be returned to the caller after finishing all the advice.
147 After-advice and around-advice can arrange to return some other value
148 by storing it in this variable.
151 The argument @var{name} is the name of the advice, a non-@code{nil}
152 symbol. The advice name uniquely identifies one piece of advice, within all
153 the pieces of advice in a particular class for a particular
154 @var{function}. The name allows you to refer to the piece of
155 advice---to redefine it, or to enable or disable it.
157 In place of the argument list in an ordinary definition, an advice
158 definition calls for several different pieces of information.
160 The optional @var{position} specifies where, in the current list of
161 advice of the specified @var{class}, this new advice should be placed.
162 It should be either @code{first}, @code{last} or a number that specifies
163 a zero-based position (@code{first} is equivalent to 0). If no position
164 is specified, the default is @code{first}. Position values outside the
165 range of existing positions in this class are mapped to the beginning or
166 the end of the range, whichever is closer. The @var{position} value is
167 ignored when redefining an existing piece of advice.
169 The optional @var{arglist} can be used to define the argument list for
170 the sake of advice. This becomes the argument list of the combined
171 definition that is generated in order to run the advice (@pxref{Combined
172 Definition}). Therefore, the advice expressions can use the argument
173 variables in this list to access argument values.
175 The argument list used in advice need not be the same as the argument
176 list used in the original function, but must be compatible with it, so
177 that it can handle the ways the function is actually called. If two
178 pieces of advice for a function both specify an argument list, they must
179 specify the same argument list.
181 @xref{Argument Access in Advice}, for more information about argument
182 lists and advice, and a more flexible way for advice to access the
185 The remaining elements, @var{flags}, are symbols that specify further
186 information about how to use this piece of advice. Here are the valid
187 symbols and their meanings:
191 Activate the advice for @var{function} now. Changes in a function's
192 advice always take effect the next time you activate advice for the
193 function; this flag says to do so, for @var{function}, immediately after
194 defining this piece of advice.
196 @cindex forward advice
197 This flag has no immediate effect if @var{function} itself is not defined yet (a
198 situation known as @dfn{forward advice}), because it is impossible to
199 activate an undefined function's advice. However, defining
200 @var{function} will automatically activate its advice.
203 Protect this piece of advice against non-local exits and errors in
204 preceding code and advice. Protecting advice places it as a cleanup in
205 an @code{unwind-protect} form, so that it will execute even if the
206 previous code gets an error or uses @code{throw}. @xref{Cleanups}.
209 Compile the combined definition that is used to run the advice. This
210 flag is ignored unless @code{activate} is also specified.
211 @xref{Combined Definition}.
214 Initially disable this piece of advice, so that it will not be used
215 unless subsequently explicitly enabled. @xref{Enabling Advice}.
218 Activate advice for @var{function} when this @code{defadvice} is
219 compiled or macroexpanded. This generates a compiled advised definition
220 according to the current advice state, which will be used during
221 activation if appropriate. @xref{Preactivation}.
223 This is useful only if this @code{defadvice} is byte-compiled.
226 The optional @var{documentation-string} serves to document this piece of
227 advice. When advice is active for @var{function}, the documentation for
228 @var{function} (as returned by @code{documentation}) combines the
229 documentation strings of all the advice for @var{function} with the
230 documentation string of its original function definition.
232 The optional @var{interactive-form} form can be supplied to change the
233 interactive behavior of the original function. If more than one piece
234 of advice has an @var{interactive-form}, then the first one (the one
235 with the smallest position) found among all the advice takes precedence.
237 The possibly empty list of @var{body-forms} specifies the body of the
238 advice. The body of an advice can access or change the arguments, the
239 return value, the binding environment, and perform any other kind of
242 @strong{Warning:} When you advise a macro, keep in mind that macros are
243 expanded when a program is compiled, not when a compiled program is run.
244 All subroutines used by the advice need to be available when the byte
245 compiler expands the macro.
247 @deffn Command ad-unadvise function
248 This command deletes the advice from @var{function}.
251 @deffn Command ad-unadvise-all
252 This command deletes all pieces of advice from all functions.
256 @section Around-Advice
258 Around-advice lets you ``wrap'' a Lisp expression ``around'' the
259 original function definition. You specify where the original function
260 definition should go by means of the special symbol @code{ad-do-it}.
261 Where this symbol occurs inside the around-advice body, it is replaced
262 with a @code{progn} containing the forms of the surrounded code. Here
266 (defadvice foo (around foo-around)
267 "Ignore case in `foo'."
268 (let ((case-fold-search t))
273 Its effect is to make sure that case is ignored in
274 searches when the original definition of @code{foo} is run.
277 This is not really a variable, rather a place-holder that looks like a
278 variable. You use it in around-advice to specify the place to run the
279 function's original definition and other ``earlier'' around-advice.
282 If the around-advice does not use @code{ad-do-it}, then it does not run
283 the original function definition. This provides a way to override the
284 original definition completely. (It also overrides lower-positioned
285 pieces of around-advice).
287 If the around-advice uses @code{ad-do-it} more than once, the original
288 definition is run at each place. In this way, around-advice can execute
289 the original definition (and lower-positioned pieces of around-advice)
290 several times. Another way to do that is by using @code{ad-do-it}
293 @node Computed Advice
294 @section Computed Advice
296 The macro @code{defadvice} resembles @code{defun} in that the code for
297 the advice, and all other information about it, are explicitly stated in
298 the source code. You can also create advice whose details are computed,
299 using the function @code{ad-add-advice}.
301 @defun ad-add-advice function advice class position
302 Calling @code{ad-add-advice} adds @var{advice} as a piece of advice to
303 @var{function} in class @var{class}. The argument @var{advice} has
307 (@var{name} @var{protected} @var{enabled} @var{definition})
310 Here @var{protected} and @var{enabled} are flags, and @var{definition}
311 is the expression that says what the advice should do. If @var{enabled}
312 is @code{nil}, this piece of advice is initially disabled
313 (@pxref{Enabling Advice}).
315 If @var{function} already has one or more pieces of advice in the
316 specified @var{class}, then @var{position} specifies where in the list
317 to put the new piece of advice. The value of @var{position} can either
318 be @code{first}, @code{last}, or a number (counting from 0 at the
319 beginning of the list). Numbers outside the range are mapped to the
320 beginning or the end of the range, whichever is closer. The
321 @var{position} value is ignored when redefining an existing piece of
324 If @var{function} already has a piece of @var{advice} with the same
325 name, then the position argument is ignored and the old advice is
326 replaced with the new one.
329 @node Activation of Advice
330 @section Activation of Advice
331 @cindex activating advice
332 @cindex advice, activating
334 By default, advice does not take effect when you define it---only when
335 you @dfn{activate} advice for the function that was advised. However
336 the advice will be automatically activated if the function is defined
337 or redefined later. You can request the activation of advice for a
338 function when you define the advice, by specifying the @code{activate}
339 flag in the @code{defadvice}. But normally you activate the advice
340 for a function by calling the function @code{ad-activate} or one of
341 the other activation commands listed below.
343 Separating the activation of advice from the act of defining it permits
344 you to add several pieces of advice to one function efficiently, without
345 redefining the function over and over as each advice is added. More
346 importantly, it permits defining advice for a function before that
347 function is actually defined.
349 When a function's advice is first activated, the function's original
350 definition is saved, and all enabled pieces of advice for that function
351 are combined with the original definition to make a new definition.
352 (Pieces of advice that are currently disabled are not used; see
353 @ref{Enabling Advice}.) This definition is installed, and optionally
354 byte-compiled as well, depending on conditions described below.
356 In all of the commands to activate advice, if @var{compile} is @code{t},
357 the command also compiles the combined definition which implements the
360 @deffn Command ad-activate function &optional compile
361 This command activates all the advice defined for @var{function}.
364 Activating advice does nothing if @var{function}'s advice is already
365 active. But if there is new advice, added since the previous time you
366 activated advice for @var{function}, it activates the new advice.
368 @deffn Command ad-deactivate function
369 This command deactivates the advice for @var{function}.
370 @cindex deactivating advice
371 @cindex advice, deactivating
374 @deffn Command ad-update function &optional compile
375 This command activates the advice for @var{function}
376 if its advice is already activated. This is useful
377 if you change the advice.
380 @deffn Command ad-activate-all &optional compile
381 This command activates the advice for all functions.
384 @deffn Command ad-deactivate-all
385 This command deactivates the advice for all functions.
388 @deffn Command ad-update-all &optional compile
389 This command activates the advice for all functions
390 whose advice is already activated. This is useful
391 if you change the advice of some functions.
394 @deffn Command ad-activate-regexp regexp &optional compile
395 This command activates all pieces of advice whose names match
396 @var{regexp}. More precisely, it activates all advice for any function
397 which has at least one piece of advice that matches @var{regexp}.
400 @deffn Command ad-deactivate-regexp regexp
401 This command deactivates all pieces of advice whose names match
402 @var{regexp}. More precisely, it deactivates all advice for any
403 function which has at least one piece of advice that matches
407 @deffn Command ad-update-regexp regexp &optional compile
408 This command activates pieces of advice whose names match @var{regexp},
409 but only those for functions whose advice is already activated.
410 @cindex reactivating advice
412 Reactivating a function's advice is useful for putting into effect all
413 the changes that have been made in its advice (including enabling and
414 disabling specific pieces of advice; @pxref{Enabling Advice}) since the
415 last time it was activated.
418 @deffn Command ad-start-advice
419 Turn on automatic advice activation when a function is defined or
420 redefined. This is the default mode.
423 @deffn Command ad-stop-advice
424 Turn off automatic advice activation when a function is defined or
428 @defopt ad-default-compilation-action
429 This variable controls whether to compile the combined definition
430 that results from activating advice for a function.
432 A value of @code{always} specifies to compile unconditionally.
433 A value of @code{never} specifies never compile the advice.
435 A value of @code{maybe} specifies to compile if the byte-compiler is
436 already loaded. A value of @code{like-original} specifies to compile
437 the advice if the original definition of the advised function is
438 compiled or a built-in function.
440 This variable takes effect only if the @var{compile} argument of
441 @code{ad-activate} (or any of the above functions) was supplied as
442 @code{nil}. If that argument is non-@code{nil}, that means
443 to compile the advice regardless.
446 If the advised definition was constructed during ``preactivation''
447 (@pxref{Preactivation}), then that definition must already be compiled,
448 because it was constructed during byte-compilation of the file that
449 contained the @code{defadvice} with the @code{preactivate} flag.
451 @node Enabling Advice
452 @section Enabling and Disabling Advice
453 @cindex enabling advice
454 @cindex advice, enabling and disabling
455 @cindex disabling advice
457 Each piece of advice has a flag that says whether it is enabled or
458 not. By enabling or disabling a piece of advice, you can turn it on
459 and off without having to undefine and redefine it. For example, here is
460 how to disable a particular piece of advice named @code{my-advice} for
461 the function @code{foo}:
464 (ad-disable-advice 'foo 'before 'my-advice)
467 This function by itself only changes the enable flag for a piece of
468 advice. To make the change take effect in the advised definition, you
469 must activate the advice for @code{foo} again:
475 @deffn Command ad-disable-advice function class name
476 This command disables the piece of advice named @var{name} in class
477 @var{class} on @var{function}.
480 @deffn Command ad-enable-advice function class name
481 This command enables the piece of advice named @var{name} in class
482 @var{class} on @var{function}.
485 You can also disable many pieces of advice at once, for various
486 functions, using a regular expression. As always, the changes take real
487 effect only when you next reactivate advice for the functions in
490 @deffn Command ad-disable-regexp regexp
491 This command disables all pieces of advice whose names match
492 @var{regexp}, in all classes, on all functions.
495 @deffn Command ad-enable-regexp regexp
496 This command enables all pieces of advice whose names match
497 @var{regexp}, in all classes, on all functions.
501 @section Preactivation
502 @cindex preactivating advice
503 @cindex advice, preactivating
505 Constructing a combined definition to execute advice is moderately
506 expensive. When a library advises many functions, this can make loading
507 the library slow. In that case, you can use @dfn{preactivation} to
508 construct suitable combined definitions in advance.
510 To use preactivation, specify the @code{preactivate} flag when you
511 define the advice with @code{defadvice}. This @code{defadvice} call
512 creates a combined definition which embodies this piece of advice
513 (whether enabled or not) plus any other currently enabled advice for the
514 same function, and the function's own definition. If the
515 @code{defadvice} is compiled, that compiles the combined definition
518 When the function's advice is subsequently activated, if the enabled
519 advice for the function matches what was used to make this combined
520 definition, then the existing combined definition is used, thus avoiding
521 the need to construct one. Thus, preactivation never causes wrong
522 results---but it may fail to do any good, if the enabled advice at the
523 time of activation doesn't match what was used for preactivation.
525 Here are some symptoms that can indicate that a preactivation did not
526 work properly, because of a mismatch.
530 Activation of the advised
531 function takes longer than usual.
533 The byte-compiler gets
534 loaded while an advised function gets activated.
536 @code{byte-compile} is included in the value of @code{features} even
537 though you did not ever explicitly use the byte-compiler.
540 Compiled preactivated advice works properly even if the function itself
541 is not defined until later; however, the function needs to be defined
542 when you @emph{compile} the preactivated advice.
544 There is no elegant way to find out why preactivated advice is not being
545 used. What you can do is to trace the function
546 @code{ad-cache-id-verification-code} (with the function
547 @code{trace-function-background}) before the advised function's advice
548 is activated. After activation, check the value returned by
549 @code{ad-cache-id-verification-code} for that function: @code{verified}
550 means that the preactivated advice was used, while other values give
551 some information about why they were considered inappropriate.
553 @strong{Warning:} There is one known case that can make preactivation
554 fail, in that a preconstructed combined definition is used even though
555 it fails to match the current state of advice. This can happen when two
556 packages define different pieces of advice with the same name, in the
557 same class, for the same function. But you should avoid that anyway.
559 @node Argument Access in Advice
560 @section Argument Access in Advice
562 The simplest way to access the arguments of an advised function in the
563 body of a piece of advice is to use the same names that the function
564 definition uses. To do this, you need to know the names of the argument
565 variables of the original function.
567 While this simple method is sufficient in many cases, it has a
568 disadvantage: it is not robust, because it hard-codes the argument names
569 into the advice. If the definition of the original function changes,
570 the advice might break.
572 Another method is to specify an argument list in the advice itself.
573 This avoids the need to know the original function definition's argument
574 names, but it has a limitation: all the advice on any particular
575 function must use the same argument list, because the argument list
576 actually used for all the advice comes from the first piece of advice
579 A more robust method is to use macros that are translated into the
580 proper access forms at activation time, i.e., when constructing the
581 advised definition. Access macros access actual arguments by position
582 regardless of how these actual arguments get distributed onto the
583 argument variables of a function. This is robust because in Emacs Lisp
584 the meaning of an argument is strictly determined by its position in the
587 @defmac ad-get-arg position
588 This returns the actual argument that was supplied at @var{position}.
591 @defmac ad-get-args position
592 This returns the list of actual arguments supplied starting at
596 @defmac ad-set-arg position value
597 This sets the value of the actual argument at @var{position} to
601 @defmac ad-set-args position value-list
602 This sets the list of actual arguments starting at @var{position} to
606 Now an example. Suppose the function @code{foo} is defined as
609 (defun foo (x y &optional z &rest r) ...)
613 and is then called with
620 which means that @var{x} is 0, @var{y} is 1, @var{z} is 2 and @var{r} is
621 @code{(3 4 5 6)} within the body of @code{foo}. Here is what
622 @code{ad-get-arg} and @code{ad-get-args} return in this case:
625 (ad-get-arg 0) @result{} 0
626 (ad-get-arg 1) @result{} 1
627 (ad-get-arg 2) @result{} 2
628 (ad-get-arg 3) @result{} 3
629 (ad-get-args 2) @result{} (2 3 4 5 6)
630 (ad-get-args 4) @result{} (4 5 6)
633 Setting arguments also makes sense in this example:
636 (ad-set-arg 5 "five")
640 has the effect of changing the sixth argument to @code{"five"}. If this
641 happens in advice executed before the body of @code{foo} is run, then
642 @var{r} will be @code{(3 4 "five" 6)} within that body.
644 Here is an example of setting a tail of the argument list:
647 (ad-set-args 0 '(5 4 3 2 1 0))
651 If this happens in advice executed before the body of @code{foo} is run,
652 then within that body, @var{x} will be 5, @var{y} will be 4, @var{z}
653 will be 3, and @var{r} will be @code{(2 1 0)} inside the body of
656 These argument constructs are not really implemented as Lisp macros.
657 Instead they are implemented specially by the advice mechanism.
659 @node Advising Primitives
660 @section Advising Primitives
662 Advising a primitive function (also called a ``subr'') is risky.
663 Some primitive functions are used by the advice mechanism; advising
664 them could cause an infinite recursion. Also, many primitive
665 functions are called directly from C code. Calls to the primitive
666 from Lisp code will take note of the advice, but calls from C code
667 will ignore the advice.
669 When the advice facility constructs the combined definition, it needs
670 to know the argument list of the original function. This is not
671 always possible for primitive functions. When advice cannot determine
672 the argument list, it uses @code{(&rest ad-subr-args)}, which always
673 works but is inefficient because it constructs a list of the argument
674 values. You can use @code{ad-define-subr-args} to declare the proper
675 argument names for a primitive function:
677 @defun ad-define-subr-args function arglist
678 This function specifies that @var{arglist} should be used as the
679 argument list for function @var{function}.
685 (ad-define-subr-args 'fset '(sym newdef))
689 specifies the argument list for the function @code{fset}.
691 @node Combined Definition
692 @section The Combined Definition
694 Suppose that a function has @var{n} pieces of before-advice
695 (numbered from 0 through @var{n}@minus{}1), @var{m} pieces of
696 around-advice and @var{k} pieces of after-advice. Assuming no piece
697 of advice is protected, the combined definition produced to implement
698 the advice for a function looks like this:
701 (lambda @var{arglist}
702 @r{[} @r{[}@var{advised-docstring}@r{]} @r{[}(interactive ...)@r{]} @r{]}
703 (let (ad-return-value)
704 @r{before-0-body-form}...
706 @r{before-@var{n}@minus{}1-body-form}...
707 @r{around-0-body-form}...
708 @r{around-1-body-form}...
710 @r{around-@var{m}@minus{}1-body-form}...
711 (setq ad-return-value
712 @r{apply original definition to @var{arglist}})
713 @r{end-of-around-@var{m}@minus{}1-body-form}...
715 @r{end-of-around-1-body-form}...
716 @r{end-of-around-0-body-form}...
717 @r{after-0-body-form}...
719 @r{after-@var{k}@minus{}1-body-form}...
723 Macros are redefined as macros, which means adding @code{macro} to
724 the beginning of the combined definition.
726 The interactive form is present if the original function or some piece
727 of advice specifies one. When an interactive primitive function is
728 advised, advice uses a special method: it calls the primitive with
729 @code{call-interactively} so that it will read its own arguments.
730 In this case, the advice cannot access the arguments.
732 The body forms of the various advice in each class are assembled
733 according to their specified order. The forms of around-advice @var{l}
734 are included in one of the forms of around-advice @var{l} @minus{} 1.
736 The innermost part of the around advice onion is
739 apply original definition to @var{arglist}
743 whose form depends on the type of the original function. The variable
744 @code{ad-return-value} is set to whatever this returns. The variable is
745 visible to all pieces of advice, which can access and modify it before
746 it is actually returned from the advised function.
748 The semantic structure of advised functions that contain protected
749 pieces of advice is the same. The only difference is that
750 @code{unwind-protect} forms ensure that the protected advice gets
751 executed even if some previous piece of advice had an error or a
752 non-local exit. If any around-advice is protected, then the whole
753 around-advice onion is protected as a result.
756 arch-tag: 80c135c2-f1c3-4f8d-aa85-f8d8770d307f