[Top][All Lists]

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

RE: [Emacs-diffs] /srv/bzr/emacs/trunk r111086: gmm-utils.el(gmm-flet, g

From: Drew Adams
Subject: RE: [Emacs-diffs] /srv/bzr/emacs/trunk r111086: gmm-utils.el(gmm-flet, gmm-labels): New macros.
Date: Wed, 5 Dec 2012 11:35:41 -0800

>     The problem with defadvice is that it overrides 
>     functions.  The letf cases we're talking about also
>     override functions, so they're just as nasty as uses
>     of defadvice.  Worse, they don't even announce themselves
>     in the docstring and they often remove themselves before you get
>     a chance to see that some overriding is going on.
> The reason it is bad for the Emacs sources to override functions in
> the Emacs sources is that it makes for confusion in debugging.

That is exactly the main reason I don't like to use defadvice too much in my own
code.  Our debugger (I generally use `debug', not `edebug') digests it poorly
(not sure how it could do things much better, however).

There might be more important reasons to use or not to use defadvice, but
debugging confusion is a major reason I avoid it.

> Thus my decision many years ago that the Emacs sources should not
> contain any advice for functions.  I considered every use of
> defadvice in the Emacs source code as a problem to be fixed.
> I did not fix them all, only for lack of time.
> I think the same argument applies to letf.  So the Emacs sources
> should not contain advice or letf.
> Users can use these features -- the only people they might confuse
> are themselves, and we can leave it up to them to decide whether to
> take that risk.  However, in our code, we should handle these
> situations in other ways.

Makes sense to me.

reply via email to

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