[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#55149: 29.0.50; Commit f30625943e broke magit/with-editor
From: |
Tassilo Horn |
Subject: |
bug#55149: 29.0.50; Commit f30625943e broke magit/with-editor |
Date: |
Thu, 28 Apr 2022 09:12:27 +0200 |
User-agent: |
mu4e 1.7.13; emacs 29.0.50 |
Juri Linkov <juri@linkov.net> writes:
> I have the same problem, and distilled it to the shortest test case:
>
> ```
> (defun testa ()
> 1)
>
> (advice-add 'testa :after
> (lambda (&rest _) 2))
>
> (defun testb ()
> (interactive)
> (message "! %S" (testa)))
> ```
>
> In 28 it returns 1.
> In 29 it returns 2.
>
> The regression is that the return value of :after now overrides
> the return value of the original function.
Oh, indeed. But isn't that exactly as documented for add-function?
:after (lambda (&rest r) (apply OLDFUN r) (apply FUNCTION r))
Of course, we'd rather want
:after (lambda (&rest r) (prog1 (apply OLDFUN r) (apply FUNCTION r)))
Bye,
Tassilo
- bug#55149: 29.0.50; Commit f30625943e broke magit/with-editor, Tassilo Horn, 2022/04/27
- bug#55149: 29.0.50; Commit f30625943e broke magit/with-editor, Stefan Monnier, 2022/04/28
- bug#55149: 29.0.50; Commit f30625943e broke magit/with-editor, Tassilo Horn, 2022/04/28
- bug#55149: 29.0.50; Commit f30625943e broke magit/with-editor, Stefan Monnier, 2022/04/28
- bug#55149: 29.0.50; Commit f30625943e broke magit/with-editor, Tassilo Horn, 2022/04/28
bug#55149: (No Subject), M. Ian Graham, 2022/04/28
bug#55149: 29.0.50; Commit f30625943e broke magit/with-editor, M. Ian Graham, 2022/04/28