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

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

bug#39274: Warn when using obsolete command interactively


From: Stefan Kangas
Subject: bug#39274: Warn when using obsolete command interactively
Date: Sat, 25 Jan 2020 20:18:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> Please add a warning along these lines:
>> 
>> (message "The `%s' command is obsolete since version %s, use `%s' instead"
>>          obsolete-name version current-name)
>
> Where and when will this warning be displayed?

I was thinking of something along the lines of the below patch.

Best regards,
Stefan Kangas

diff --git a/lisp/simple.el b/lisp/simple.el
index 8be27745b1..12a413ec0e 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1914,6 +1914,12 @@ execute-extended-command
           (while-no-input
             (setq binding (execute-extended-command--shorter
                            (symbol-name function) typed))))
+        (when-let (obsolete (with-temp-buffer
+                              (when (help-fns--obsolete 'foo)
+                                (buffer-string)
+                                (goto-char (point-max))
+                                (delete-indentation 2))))
+          (message obsolete))
         (when binding
           (with-temp-message
               (format-message "You can run the command `%s' with %s"

reply via email to

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