diff --git a/lisp/simple.el b/lisp/simple.el index 8be27745b1..f04bae2e90 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1914,16 +1914,23 @@ execute-extended-command (while-no-input (setq binding (execute-extended-command--shorter (symbol-name function) typed)))) - (when binding - (with-temp-message - (format-message "You can run the command `%s' with %s" - function - (if (stringp binding) - (concat "M-x " binding " RET") - (key-description binding))) - (sit-for (if (numberp suggest-key-bindings) - suggest-key-bindings - 2)))))))) + (require 'help-fns) + (if-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" + function + (if (stringp binding) + (concat "M-x " binding " RET") + (key-description binding))) + (sit-for (if (numberp suggest-key-bindings) + suggest-key-bindings + 2))))))))) (defun command-execute (cmd &optional record-flag keys special) ;; BEWARE: Called directly from the C code.