From: Stefan Kangas Date: Fri, 24 Sep 2021 18:59:32 +0000 (+0200) Subject: Use command substitution instead of raw keys in more places X-Git-Tag: emacs-28.0.90~681 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0da8118dcbf3c54dd6ecc9c0e3314a56ca82ec51;p=emacs.git Use command substitution instead of raw keys in more places * admin/authors.el (authors): * lisp/abbrev.el (abbrev-suggest-show-report): * lisp/calc/calc.el (calc-display-trail, calc): * lisp/completion.el (completion-locate-db-error): * lisp/dired-x.el (dired-extra-startup): * lisp/emacs-lisp/package.el (package-install-selected-packages): * lisp/emulation/viper.el (viper-mode): * lisp/facemenu.el (list-colors-display): * lisp/mail/emacsbug.el (report-emacs-bug-hook): * lisp/mail/sendmail.el (mail): * lisp/menu-bar.el (menu-bar-mode): * lisp/org/org.el (org-revert-all-org-buffers): * lisp/progmodes/antlr-mode.el (antlr-help-rules-intro) (antlr-insert-makefile-rules): * lisp/progmodes/gdb-mi.el (gdb--check-interpreter): * lisp/progmodes/xscheme.el (xscheme-process-sentinel): * lisp/ps-print.el (ps-font-info-database): * lisp/recentf.el (recentf-edit-list, recentf-open-files): * lisp/vc/ediff-util.el (ediff-suspend): * lisp/vc/pcvs.el (cvs-mode): * lisp/vc/vc-bzr.el (vc-bzr-dir-extra-headers): Use command substitution. --- diff --git a/admin/authors.el b/admin/authors.el index 3dec23c1916..fd46dabaa3a 100644 --- a/admin/authors.el +++ b/admin/authors.el @@ -1610,7 +1610,8 @@ and a buffer *Authors Errors* containing references to unknown files." ;; the versioned ChangeLog.N rather than the unversioned ChangeLog. (zerop (call-process "make" nil nil nil "-C" root "change-history-nocommit")) - (error "Problem updating ChangeLog, try \"C-u M-x authors RET\"")) + (error (substitute-command-keys + "Problem updating ChangeLog, try \"\\[universal-argument] \\[authors]\""))) (let ((logs (process-lines find-program root "-name" "ChangeLog*")) (table (make-hash-table :test 'equal)) (buffer-name "*Authors*") diff --git a/lisp/abbrev.el b/lisp/abbrev.el index f370bd3ea6a..b0e8a4fa99c 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -973,11 +973,11 @@ full text instead of the abbrevs that expand into that text." (buf (get-buffer-create "*abbrev-suggest*"))) (set-buffer buf) (erase-buffer) - (insert "** Abbrev expansion usage ** + (insert (substitute-command-keys "** Abbrev expansion usage ** Below is a list of expansions for which abbrevs are defined, and the number of times the expansion was typed manually. To display -and edit all abbrevs, type `M-x edit-abbrevs RET'\n\n") +and edit all abbrevs, type \\[edit-abbrevs].\n\n")) (dolist (expansion totals) (insert (format " %s: %d\n" (car expansion) (cdr expansion)))) (display-buffer buf))) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 45a4d56a371..b9bdc0fd8dc 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -731,7 +731,7 @@ If nil, symbolic math routines make no assumptions about variables.") "Initial height of Calculator window.") (defcalcmodevar calc-display-trail t - "If non-nil, M-x calc creates a window to display Calculator trail.") + "If non-nil, \\[calc] creates a window to display Calculator trail.") (defcalcmodevar calc-show-selections t "If non-nil, selected sub-formulas are shown by obscuring rest of formula. @@ -1468,7 +1468,9 @@ See `window-dedicated-p' for what that means." (with-current-buffer (calc-trail-buffer) (and calc-display-trail (calc-trail-display 1 t))) - (message "Welcome to the GNU Emacs Calculator! Press `?' or `h' for help, `q' to quit") + (message (substitute-command-keys + (concat "Welcome to the GNU Emacs Calculator! \\" + "Press \\[calc-help] or \\[calc-help-prefix] for help, \\[calc-quit] to quit"))) (run-hooks 'calc-start-hook) (and (windowp full-display) (window-point full-display) diff --git a/lisp/completion.el b/lisp/completion.el index e36c7228416..643f2da0d21 100644 --- a/lisp/completion.el +++ b/lisp/completion.el @@ -1088,7 +1088,8 @@ Must be called after `find-exact-completion'." #'completion-locate-db-error "27.1") (defun completion-locate-db-error () ;; recursive error: really scrod - (error "Completion database corrupted. Try M-x clear-all-completions. Send bug report")) + (error (substitute-command-keys + "Completion database corrupted. Try \\[clear-all-completions]. Send bug report"))) ;; WRITES (defun add-completion-to-tail-if-new (string) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index cf257c8169d..7c6f49f2ae4 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -293,7 +293,7 @@ files"] \\[dired-omit-mode]\t-- toggle omitting of files \\[dired-mark-sexp]\t-- mark by Lisp expression -To see the options you can set, use M-x customize-group RET dired-x RET. +To see the options you can set, use \\[customize-group] RET dired-x RET. See also the functions: `dired-flag-extension' `dired-virtual' diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index a204966644e..a0bfcbb24fa 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2268,7 +2268,9 @@ confirmation to install packages." (mapconcat #'symbol-name available " ")))) (mapc (lambda (p) (package-install p 'dont-select)) available))) ((> difference 0) - (message "Packages that are not available: %d (the rest is already installed), maybe you need to `M-x package-refresh-contents'" + (message (substitute-command-keys + "Packages that are not available: %d (the rest is already \ +installed), maybe you need to \\[package-refresh-contents]") difference)) (t (message "All your packages are already installed")))))) diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 6ba265f8abf..e9c0fb5e24b 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -577,7 +577,7 @@ For more information on Viper: To submit a bug report or to contact the author, type :submitReport in Vi command mode. To shoo Viper away and return to pure Emacs (horror!), type: - M-x viper-go-away + \\[viper-go-away] This startup message appears whenever you load Viper, unless you type `y' now." )) diff --git a/lisp/facemenu.el b/lisp/facemenu.el index 7229d6163df..7417bb12030 100644 --- a/lisp/facemenu.el +++ b/lisp/facemenu.el @@ -541,10 +541,11 @@ If the optional argument LIST is non-nil, it should be a list of colors to display. Otherwise, this command computes a list of colors that the current display can handle. Customize `list-colors-sort' to change the order in which colors are shown. -Type `g' or \\[revert-buffer] after customizing `list-colors-sort' -to redisplay colors in the new order. +Type \\\\[revert-buffer] after customizing \ +`list-colors-sort' to redisplay colors in +the new order. -If the optional argument BUFFER-NAME is nil, it defaults to *Colors*. +If the optional argument BUFFER-NAME is nil, it defaults to \"*Colors*\". If the optional argument CALLBACK is non-nil, it should be a function to call each time the user types RET or clicks on a diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 3da1e8b25e9..7c3f6ba5e6d 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -426,7 +426,7 @@ usually do not have translators for other languages.\n\n"))) (with-output-to-temp-buffer "*Bug Help*" (princ (substitute-command-keys (format "\ -You invoked the command M-x report-emacs-bug, +You invoked the command \\[report-emacs-bug], but you decided not to mail the bug report to the Emacs maintainers. If you want to mail it to someone else instead, diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 312805f6d8f..d0aff093dfe 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -1950,7 +1950,8 @@ The seventh argument ACTIONS is a list of actions to take (setq initialized t))) (if (and buffer-auto-save-file-name (file-exists-p buffer-auto-save-file-name)) - (message "Auto save file for draft message exists; consider M-x mail-recover")) + (message (substitute-command-keys + "Auto save file for draft message exists; consider \\[mail-recover]"))) initialized)) (declare-function dired-view-file "dired" ()) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index ede81867825..b2577c085fc 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -2490,7 +2490,9 @@ created in the future." ;; after this function returns, overwriting any message we do here. (when (and (called-interactively-p 'interactive) (not menu-bar-mode)) (run-with-idle-timer 0 nil 'message - "Menu Bar mode disabled. Use M-x menu-bar-mode to make the menu bar appear."))) + (substitute-command-keys + "Menu Bar mode disabled. \ +Use \\[menu-bar-mode] to make the menu bar appear.")))) ;;;###autoload ;; (This does not work right unless it comes after the above definition.) diff --git a/lisp/org/org.el b/lisp/org/org.el index d03676e3fb9..4a74eda8427 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -15215,9 +15215,9 @@ This function is useful in a setup where one tracks Org files with a version control system, to revert on one machine after pulling changes from another. I believe the procedure must be like this: -1. M-x org-save-all-org-buffers +1. \\[org-save-all-org-buffers] 2. Pull changes from the other machine, resolve conflicts -3. M-x org-revert-all-org-buffers" +3. \\[org-revert-all-org-buffers]" (interactive) (unless (yes-or-no-p "Revert all Org buffers from their files? ") (user-error "Abort")) diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index a74ca1ed239..0b7945430d3 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el @@ -570,7 +570,7 @@ See \\[antlr-show-makefile-rules] and `antlr-unknown-file-formats'.") "The following Makefile rules define the dependencies for all (non- expanded) grammars in directory \"%s\".\n They are stored in the kill-ring, i.e., you can insert them with C-y -into your Makefile. You can also invoke M-x antlr-show-makefile-rules +into your Makefile. You can also invoke \\[antlr-show-makefile-rules] from within a Makefile to insert them directly.\n\n\n" "Introduction to use with \\[antlr-show-makefile-rules]. It is a format string and used with substitution DIRECTORY/%s where @@ -2167,7 +2167,8 @@ command `antlr-show-makefile-rules' for detail." (unless in-makefile (copy-region-as-kill (point-min) (point-max)) (goto-char (point-min)) - (insert (format antlr-help-rules-intro dirname))))) + (insert (format (substitute-command-keys antlr-help-rules-intro) + dirname))))) ;;;###autoload (defun antlr-show-makefile-rules () diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 3e5b8e2f32b..fa54f511608 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -766,7 +766,9 @@ NOARG must be t when this macro is used outside `gud-def'." ;; Apparently we're not running with -i=mi (or we're, for ;; instance, debugging something inside a Docker instance with ;; Emacs on the outside). - (let ((msg "Error: Either -i=mi wasn't specified on the GDB command line, or the extra socket couldn't be established. Consider using `M-x gud-gdb' instead.")) + (let ((msg (substitute-command-keys + "Error: Either -i=mi wasn't specified on the GDB command line,\ + or the extra socket couldn't be established. Consider using \\[gud-gdb] instead."))) (message msg) (setq string (concat (propertize msg 'font-lock-face 'error) "\n" string))) diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el index 70763319840..1874f2698ae 100644 --- a/lisp/progmodes/xscheme.el +++ b/lisp/progmodes/xscheme.el @@ -908,8 +908,8 @@ the remaining input.") xscheme-signal-death-message) (progn (beep) - (message -"The Scheme process has died! Do M-x reset-scheme to restart it")))))) + (message (substitute-command-keys +"The Scheme process has died! Type \\[reset-scheme] to restart it"))))))) (defun xscheme-process-filter-initialize (running-p) (setq xscheme-process-filter-state 'idle) diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 38671b58e2b..1f4ed4e44d7 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -2788,7 +2788,7 @@ Each element comprises: font family (the key), name, bold, italic, bold-italic, reference size, line height, space width, average character width. To get the info for another specific font (say Helvetica), do the following: - create a new buffer -- generate the PostScript image to a file (C-u M-x ps-print-buffer) +- generate the PostScript image to a file (\\[universal-argument] \\[ps-print-buffer]) - open this file and delete the leading `%' (which is the PostScript comment character) from the line `% 3 cm 20 cm moveto 10/Courier ReportFontInfo showpage' diff --git a/lisp/recentf.el b/lisp/recentf.el index 9ae059a70dd..57cbaf0debb 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -1122,8 +1122,9 @@ IGNORE arguments." (setq-local recentf-edit-list nil) (widget-insert (format-message - "Click on OK to delete selected files from the recent list. -Click on Cancel or type `q' to cancel.\n")) + (substitute-command-keys + "Click on OK to delete selected files from the recent list. +Click on Cancel or type \\[recentf-cancel-dialog] to cancel.\n"))) ;; Insert the list of files as checkboxes (dolist (item recentf-list) (widget-create 'checkbox @@ -1221,7 +1222,8 @@ use for the dialog. It defaults to \"*`recentf-menu-title'*\"." ", or type the corresponding digit key," "") " to open it.\n" - (format-message "Click on Cancel or type `q' to cancel.\n")) + (substitute-command-keys + "Click on Cancel or type \\[recentf-cancel-dialog] to cancel.\n")) ;; Use a L&F that looks like the recentf menu. (tree-widget-set-theme "folder") (apply #'widget-create diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index 5646fd3d42a..9016d1df5c4 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -2777,8 +2777,8 @@ up an appropriate window config." (interactive) (ediff-barf-if-not-control-buffer) (run-hooks 'ediff-suspend-hook) - (message - "To resume, type M-x eregistry and select the desired Ediff session")) + (message (substitute-command-keys + "To resume, type \\[eregistry] and select the desired Ediff session"))) ;; ediff-barf-if-not-control-buffer ensures only called from ediff. (declare-function ediff-version "ediff" ()) diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el index 726fe4e2837..bbc81ef195d 100644 --- a/lisp/vc/pcvs.el +++ b/lisp/vc/pcvs.el @@ -1144,7 +1144,8 @@ Full documentation is in the Texinfo file." ("->" cvs-secondary-branch-prefix)))) " " cvs-mode-line-process)) (if buffer-file-name - (error "Use M-x cvs-quickdir to get a *cvs* buffer")) + (error (substitute-command-keys + "Use \\[cvs-quickdir] to get a *cvs* buffer"))) (buffer-disable-undo) ;;(setq-local goal-column cvs-cursor-column) (setq-local revert-buffer-function 'cvs-mode-revert-buffer) diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index bfe3293e45a..48fedeca5a8 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -1054,7 +1054,8 @@ stream. Standard error output is discarded." (vc-bzr-command "info" t 0 dir) (buffer-string))) (shelve (vc-bzr-shelve-list)) - (shelve-help-echo "Use M-x vc-bzr-shelve to create shelves") + (shelve-help-echo (substitute-command-keys + "Use \\[vc-bzr-shelve] to create shelves")) (root-dir (vc-bzr-root dir)) (pending-merge ;; FIXME: looking for .bzr/checkout/merge-hashes is not a