GNU bug report logs -
#55149
29.0.50; Commit f30625943e broke magit/with-editor
Previous Next
Reported by: Tassilo Horn <thorn <at> fastmail.fm>
Date: Wed, 27 Apr 2022 12:59:01 UTC
Severity: normal
Tags: patch
Merged with 55160,
55161
Found in version 29.0.50
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> dick <dick.r.chiang <at> gmail.com> writes:
>
>> - (:after (apply cdr r) (apply car r))
>> + (:after (prog1 (apply cdr r) (apply car r)))
>
> I guess this is the same as bug#55149, so I've merged the reports.
>
> Apparently, returning the value of the :after function is what's
> documented to happen (and is what the trunk does now), but it didn't
> use to do that, so it's breaking advice that relies on the old
> behaviour, if I understand 55149 correctly.
This behavior is a bit surprising, since Common Lisp specifies that the
return values of :after methods are ignored (“All the after methods are
called in most-specific-last order. Their values are ignored.”
http://www.lispworks.com/documentation/HyperSpec/Body/07_ffb.htm). To
override the return value of a method, :around methods are used.
I don't want to argue that CL method combinations and elisp advice are
the same thing, or that Emacs Lisp has to necessarily follow CL
semantics, but it would be good to have the possibility of inserting a
bit of code that should "just run" after a function, without overriding
its return value.
This bug report was last modified 3 years and 24 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.