Subject: bug#14317: closed (Re: bug#14317: 24.3.50; nadvice.el: named advices not upgradable)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 06 May 2013 15:29:02 +0000

Your bug report

#14317: 24.3.50; nadvice.el: named advices not upgradable

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
14317: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14317
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#14317: 24.3.50; nadvice.el: named advices not upgradable
From: Stefan Monnier <[email-masked]>
To: Michael Heerdegen <[email-masked]>
Cc: [email-masked]
Date: Mon, 06 May 2013 11:27:37 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

> Is the current behavior intended?  If not, can we change it?

Changed, thanks,

        Stefan

Subject: 24.3.50; nadvice.el: named advices not upgradable
From: Michael Heerdegen <[email-masked]>
To: [email-masked]
Date: Tue, 30 Apr 2013 01:42:14 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Stefan,

if you have some code adding advices that can be identified (i.e.,
adding named advices or fbound symbols, not anonymous functions),
and you change this code defining the advice and re-evaluate, the change
doesn't take effect (in contrast to the behavior of advice.el).

We currently use this:

--8<---------------cut here---------------start------------->8---
(defun advice--add-function (where ref function props)
  (unless (advice--member-p function (cdr (assq 'name props))
                            (gv-deref ref))
    (setf (gv-deref ref)
          (advice--make where function (gv-deref ref) props))))
--8<---------------cut here---------------end--------------->8---

but as a user, I would suspect something like

--8<---------------cut here---------------start------------->8---
(defun advice--add-function (where ref function props)
  (when (advice--member-p function (cdr (assq 'name props))
                          (gv-deref ref))
    (advice--remove-function .........))
  (setf (gv-deref ref)
        (advice--make where function (gv-deref ref) props)))
--8<---------------cut here---------------end--------------->8---

i.e., replacing the old code, instead of doing nothing.

Is the current behavior intended?  If not, can we change it?

Regards,

Michael.