all messages for Emacs-related lists mirrored at yhetil.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:22:52 +0100	[thread overview]
Message-ID: <87pnf78ho3.fsf@marxist.se> (raw)
In-Reply-To: <87sgk38hw6.fsf@marxist.se> (Stefan Kangas's message of "Sat, 25 Jan 2020 20:18:01 +0100")

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

Stefan Kangas <stefan@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


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

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"

  reply	other threads:[~2020-01-25 19:22 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
2020-01-25 19:22     ` Stefan Kangas [this message]
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

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

  git send-email \
    --in-reply-to=87pnf78ho3.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 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.