Subject: Re: bug#21798: 25.0.50; [PATCH] Add support for retrieving paths to JSON elements

From: Dmitry Gutov <[email-masked]>
Date: Sat, 7 Nov 2015 15:43:12 +0200

On 11/07/2015 03:23 PM, Richard Stallman wrote:

> The reason that Emacs sources should not use advice is that advice is
> bad for debugging.  If you look at function foo's source code, it
> won't tell you that advice is causing the function to do something not
> in that source.

Yes still, if we support advice in the user code, we should be able to 
debug the result. One doesn't usually just reads the source code when 
debugging Emacs; edebug is very helpful in that, and it seems to support 
advice.

> This problem occurs no matter how long the advice is on function foo.

I don't think it's black-and-white: if an advice is only active during 
execution of just one or two commands, we don't have to worry about it 
most of the time. Neither when debugging, nor when running the code.

> The right thing to do, instead of using advice on foo, is to change
> foo to call a hook, and put things in that hook.

I agree it will be a simpler solution, if we can choose a meaningful 
place and name for the hook, and if there's no performance hit.