GNU bug report logs - #52003
Unexpected advising behavior due to recursive implementation

Previous Next

Package: emacs;

Reported by: Daniel Sausner <daniel.sausner <at> posteo.de>

Date: Sat, 20 Nov 2021 17:05:03 UTC

Severity: normal

Done: Mattias EngdegÄrd <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 52003 <at> debbugs.gnu.org (full text, mbox):

From: Mattias EngdegÄrd <mattiase <at> acm.org>
To: Daniel Sausner <daniel.sausner <at> posteo.de>
Cc: 52003 <at> debbugs.gnu.org
Subject: bug#52003: Unexpected advising behavior due to recursive
 implementation
Date: Sat, 20 Nov 2021 20:16:43 +0100
Thanks for the report, and yes, it's true that the way interactive use is managed makes advice hacks more interesting. Do remember that you are always on your own when using advice; Emacs cannot reasonably promise any compatibility on that level.

That said, it would be straightforward to straighten out the control flow by extracting the bulk of the code to a new (internal) function which is called with or without `condition-case`. It would be slightly slower since it entails an extra function call in the non-interactive case, and forward-sexp and its ilk are workhorses in many language modes. It may not matter much, of course.

> I'm far from a lisp expert but my feeling is that the condition-case 
> should only wrap the calls where things can actually go wrong.

Oh, but in this case they can. Noninteractive calls expect the scan-errors; interactive use does not. It is also possible for a a forward-sexp-function to raise scan-error.





This bug report was last modified 3 years and 179 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.