Subject: Re: bug#16959: bug#16981: 24.3.50; electric-pair-delete-adjacent-pairs broken in c-mode, python-mode, maybe-others

From: Stefan Monnier <[email-masked]>
Date: Tue, 25 Mar 2014 20:34:36 -0400

> The result is that the advice SEEMS to work (the user put it in her
> .emacs and presses C-x C-e), but on restarting emacs it depends on the
> order advice defintions.

That's why the doc says:

   [..]
   should stay as the outermost advice.  When two advices specify the
   same depth, the most recently added advice will be outermost.
   [..]

> Of course, from a user's point of view, macros usually are already expanded.
> How would a user go about advising, say, byte-compile-log in her .emacs?

She can't do it and hope for it to affect already compiled code, indeed.

But we use advice-add in cl.el on the `declare', `dolist', and `dotimes'
macros and it works very well.  Obviously code that uses those needs to
have a (require 'cl) somewhere to make sure the advice is installed
before macro-expansion.

        Stefan