emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#17348: closed (24.3.50; Cannot advice-add the same


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#17348: closed (24.3.50; Cannot advice-add the same function :before and :after)
Date: Sat, 10 May 2014 20:10:02 +0000

Your message dated Sat, 10 May 2014 16:09:21 -0400
with message-id <address@hidden>
and subject line Re: bug#17348: 24.3.50; Cannot advice-add the same function 
:before and :after
has caused the debbugs.gnu.org bug report #17348,
regarding 24.3.50; Cannot advice-add the same function :before and :after
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
17348: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17348
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.3.50; Cannot advice-add the same function :before and :after Date: Sat, 26 Apr 2014 13:16:00 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
Evalling:
(progn
  (defun yfcheck () (message "Check"))
  (defun yftest () (message "Test"))
  (advice-add 'yftest :before #'yfcheck)
  (advice-add 'yftest :after #'yfcheck)
  (yftest)
  nil)

gives (in the *Messages* buffer)
Test
Check

I'd have expected:
Check
Test
Check

-- 
Nico.



--- End Message ---
--- Begin Message --- Subject: Re: bug#17348: 24.3.50; Cannot advice-add the same function :before and :after Date: Sat, 10 May 2014 16:09:21 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)
I installed a patch in `emacs-24' which will let you add the same
function multiple times, as long as you specify different `name'
properties for each one.

>> In the actual situation that lead me to adding the same function twice,
>> it was a tracing function, like (message "time: %s ; value of
>> foovariable: %s" (current-time) foovariable) and I assumed that I would
>> be able to remove them both with one (advice-remove ...) -- I guess that
>> isn't too complicated.
> Removing them both would not be desirable in general.

With the new code, you can remove each one individually by specifying
its `name', or you can remove them all by specifying the function itself.


        Stefan


--- End Message ---

reply via email to

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