GNU bug report logs -
#39274
Warn when using obsolete command interactively
Previous Next
Reported by: Stefan Kangas <stefan <at> marxist.se>
Date: Fri, 24 Jan 2020 23:27:02 UTC
Severity: wishlist
Tags: notabug, wontfix
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 39274 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Stefan Kangas <stefan <at> marxist.se> 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.
Sorry, that had a typo. See attached instead.
Best regards,
Stefan Kangas
[obsolete2.diff (text/x-diff, inline)]
diff --git a/lisp/simple.el b/lisp/simple.el
index 8be27745b1..f1f0da1fed 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 function)
+ (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"
This bug report was last modified 5 years and 78 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.