unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 39274@debbugs.gnu.org
Subject: bug#39274: Warn when using obsolete command interactively
Date: Sat, 25 Jan 2020 20:18:01 +0100	[thread overview]
Message-ID: <87sgk38hw6.fsf@marxist.se> (raw)
In-Reply-To: <837e1gq8pt.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 25 Jan 2020 09:46:38 +0200")

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: obsolete.diff --]
[-- Type: text/x-diff, Size: 750 bytes --]

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	other threads:[~2020-01-25 19:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 23:25 bug#39274: Warn when using obsolete command interactively Stefan Kangas
2020-01-25  7:46 ` Eli Zaretskii
2020-01-25 19:18   ` Stefan Kangas [this message]
2020-01-25 19:22     ` Stefan Kangas
2020-01-25 20:14       ` Eli Zaretskii
2020-01-25 20:30         ` Stefan Kangas
2020-03-01  1:01           ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sgk38hw6.fsf@marxist.se \
    --to=stefan@marxist.se \
    --cc=39274@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).