* bug#64757: 30.0.50; Declare `defadvice` obsolete
@ 2023-07-20 22:05 Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-21 5:42 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-20 22:05 UTC (permalink / raw)
To: 64757
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.
\f
* 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"]
^ permalink raw reply related [flat|nested] 5+ messages in thread
* bug#64757: 30.0.50; Declare `defadvice` obsolete
2023-07-20 22:05 bug#64757: 30.0.50; Declare `defadvice` obsolete Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-21 5:42 ` Eli Zaretskii
2023-07-21 15:26 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2023-07-21 5:42 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 64757
> Date: Thu, 20 Jul 2023 18:05:40 -0400
> From: Stefan Monnier via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> 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.
No objections from me. However, ...
> 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.
> \f
> * Lisp Changes in Emacs 30.1
>
> +** 'defadvice' is marked as obsolete.
...this is too terse. We need to mention the two alternatives to
defadvice, including pointers to the ELisp manual's nodes. People who
still use defadvice will need those to convert their programs.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#64757: 30.0.50; Declare `defadvice` obsolete
2023-07-21 5:42 ` Eli Zaretskii
@ 2023-07-21 15:26 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-21 15:51 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-21 15:26 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 64757
> ...this is too terse. We need to mention the two alternatives to
> defadvice, including pointers to the ELisp manual's nodes. People who
> still use defadvice will need those to convert their programs.
Something like that?
Stefan
diff --git a/etc/NEWS b/etc/NEWS
index c50f560282a..d22969444db 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -610,6 +610,10 @@ provokes an error if used numerically.
\f
* Lisp Changes in Emacs 30.1
+** 'defadvice' is marked as obsolete.
+See (info "(elisp)Porting Old Advice") for help converting them
+to use `advice-add` or `define-advice instead.
+
+++
** 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"]
^ permalink raw reply related [flat|nested] 5+ messages in thread
* bug#64757: 30.0.50; Declare `defadvice` obsolete
2023-07-21 15:26 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-21 15:51 ` Eli Zaretskii
2023-08-04 3:44 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2023-07-21 15:51 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 64757
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: 64757@debbugs.gnu.org
> Date: Fri, 21 Jul 2023 11:26:04 -0400
>
> > ...this is too terse. We need to mention the two alternatives to
> > defadvice, including pointers to the ELisp manual's nodes. People who
> > still use defadvice will need those to convert their programs.
>
> Something like that?
Yes, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#64757: 30.0.50; Declare `defadvice` obsolete
2023-07-21 15:51 ` Eli Zaretskii
@ 2023-08-04 3:44 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-04 3:44 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 64757-done
>> Something like that?
> Yes, thanks.
Pushed, thanks,
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-08-04 3:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-20 22:05 bug#64757: 30.0.50; Declare `defadvice` obsolete Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-21 5:42 ` Eli Zaretskii
2023-07-21 15:26 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-21 15:51 ` Eli Zaretskii
2023-08-04 3:44 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.