1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-26 19:18:50 +00:00

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.
This commit is contained in:
Stefan Kangas 2021-09-24 20:59:32 +02:00
parent 35d0675467
commit 0da8118dcb
20 changed files with 47 additions and 30 deletions

View File

@ -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*")

View File

@ -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)))

View File

@ -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! \\<calc-mode-map>"
"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)

View File

@ -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)

View File

@ -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'

View File

@ -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"))))))

View File

@ -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."
))

View File

@ -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 \\<help-mode-map>\\[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

View File

@ -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,

View File

@ -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" ())

View File

@ -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.)

View File

@ -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"))

View File

@ -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 ()

View File

@ -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)))

View File

@ -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)

View File

@ -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'

View File

@ -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

View File

@ -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" ())

View File

@ -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)

View File

@ -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