Display new keybinding in obsolete command warning
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning): * lisp/simple.el (command-execute): When warning about an obsolete command, display the keybinding for the new command.
This commit is contained in:
parent
021ae515f9
commit
935e4da0e1
2 changed files with 10 additions and 5 deletions
|
@ -187,13 +187,15 @@ It should normally be a symbol with position and it defaults to FORM."
|
|||
msg))
|
||||
form)))
|
||||
|
||||
(defun macroexp--obsolete-warning (fun obsolescence-data type)
|
||||
(defun macroexp--obsolete-warning (fun obsolescence-data type &optional key)
|
||||
(let ((instead (car obsolescence-data))
|
||||
(asof (nth 2 obsolescence-data)))
|
||||
(format-message
|
||||
"`%s' is an obsolete %s%s%s" fun type
|
||||
(if asof (concat " (as of " asof ")") "")
|
||||
(cond ((stringp instead) (concat "; " (substitute-command-keys instead)))
|
||||
((and instead key)
|
||||
(format-message "; use `%s' (%s) instead." instead key))
|
||||
(instead (format-message "; use `%s' instead." instead))
|
||||
(t ".")))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue