GNU bug report logs - #64757
30.0.50; Declare `defadvice` obsolete

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Thu, 20 Jul 2023 22:07:01 UTC

Severity: normal

Found in version 30.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

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#64757: closed (30.0.50; Declare `defadvice` obsolete)
Date: Fri, 04 Aug 2023 03:45:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 03 Aug 2023 23:44:10 -0400
with message-id <jwvv8dv1ngt.fsf-monnier+emacs <at> gnu.org>
and subject line Re: bug#64757: 30.0.50; Declare `defadvice` obsolete
has caused the debbugs.gnu.org bug report #64757,
regarding 30.0.50; Declare `defadvice` obsolete
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
64757: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64757
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; Declare `defadvice` obsolete
Date: Thu, 20 Jul 2023 18:05:40 -0400
Package: Emacs
Version: 30.0.50


The `nadvice` package introduced in Emacs-24.4 make the `advice.el`
package technically obsolete in the sense that everything that could be
done with `advice.el` could now be done with `nadvice.el` (indeed,
`advice.el` was reimplemented on that occasion to work on top of
`nadvice.el`).

While maintainers have converted their `defadvice` to the new
`advice-add` more slowly than the conversion from `cl` to `cl-lib`
(maybe because I was slower in rolling out a forward compatibility for
it in GNU ELPA, tho probably because the conversion takes a bit more
work), the new advice library has been very popular thanks to its
being simpler.

Emacs-29 is the first release that doesn't use the old advice library in
its own code at all, so I think Emacs-30 is a good time to mark
`defadvice` as obsolete.

I suggest to do it with the following patch, which should not introduce
any incompatibilities.


        Stefan


diff --git a/etc/NEWS b/etc/NEWS
index d1af3b1b866..54fb6ccac5c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -614,6 +614,8 @@ provokes an error if used numerically.
 
 * Lisp Changes in Emacs 30.1
 
+** 'defadvice' is marked as obsolete.
+
 +++
 ** New user option 'safe-local-variable-directories'.
 This user option names directories in which Emacs will treat all
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index 56f0ae2212c..3265809f592 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -3131,6 +3131,7 @@ defadvice
           [DOCSTRING] [INTERACTIVE-FORM]
           BODY...)"
   (declare (doc-string 3) (indent 2)
+           (obsolete "use advice-add or define-advice" "30.1")
            (debug (&define name  ;; thing being advised.
                            (name ;; class is [&or "before" "around" "after"
                                  ;;               "activation" "deactivation"]



[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64757-done <at> debbugs.gnu.org
Subject: Re: bug#64757: 30.0.50; Declare `defadvice` obsolete
Date: Thu, 03 Aug 2023 23:44:10 -0400
>> Something like that?
> Yes, thanks.

Pushed, thanks,


        Stefan



This bug report was last modified 1 year and 291 days ago.

Previous Next


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