GNU bug report logs - #14317
24.3.50; nadvice.el: named advices not upgradable

Previous Next

Package: emacs;

Reported by: michael_heerdegen <at> web.de

Date: Mon, 29 Apr 2013 23:43:02 UTC

Severity: normal

Found in version 24.3.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14317 in the body.
You can then email your comments to 14317 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14317; Package emacs. (Mon, 29 Apr 2013 23:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to michael_heerdegen <at> web.de:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 29 Apr 2013 23:43:02 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; nadvice.el: named advices not upgradable
Date: Tue, 30 Apr 2013 01:42:14 +0200
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.








Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14317; Package emacs. (Fri, 03 May 2013 01:22:02 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: 14317 <at> debbugs.gnu.org
Subject: Re: bug#14317: 24.3.50; nadvice.el: named advices not upgradable
Date: Fri, 03 May 2013 03:20:42 +0200
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> but as a user, I would suspect something like
>
> (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)))
>
> i.e., replacing the old code, instead of doing nothing.

We should probably distinguish between named functions and
named advice.  I mean, it's probably stupid to remove and add
back an fboundp symbol - but you get the idea...


Regards,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14317; Package emacs. (Sun, 05 May 2013 05:51:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 14317 <at> debbugs.gnu.org
Subject: Re: bug#14317: 24.3.50; nadvice.el: named advices not upgradable
Date: Sun, 05 May 2013 01:49:31 -0400
> 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).

I think what you ask makes sense, yes.


        Stefan "no time to do it now, tho"




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Mon, 06 May 2013 15:29:02 GMT) Full text and rfc822 format available.

Notification sent to michael_heerdegen <at> web.de:
bug acknowledged by developer. (Mon, 06 May 2013 15:29:02 GMT) Full text and rfc822 format available.

Message #16 received at 14317-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 14317-done <at> debbugs.gnu.org
Subject: Re: bug#14317: 24.3.50; nadvice.el: named advices not upgradable
Date: Mon, 06 May 2013 11:27:37 -0400
> Is the current behavior intended?  If not, can we change it?

Changed, thanks,


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 04 Jun 2013 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 18 days ago.

Previous Next


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