emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 0da8118: Use command substitution instead of raw keys in more pla


From: Stefan Kangas
Subject: master 0da8118: Use command substitution instead of raw keys in more places
Date: Fri, 24 Sep 2021 15:28:03 -0400 (EDT)

branch: master
commit 0da8118dcbf3c54dd6ecc9c0e3314a56ca82ec51
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    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.
---
 admin/authors.el             | 3 ++-
 lisp/abbrev.el               | 4 ++--
 lisp/calc/calc.el            | 6 ++++--
 lisp/completion.el           | 3 ++-
 lisp/dired-x.el              | 2 +-
 lisp/emacs-lisp/package.el   | 4 +++-
 lisp/emulation/viper.el      | 2 +-
 lisp/facemenu.el             | 7 ++++---
 lisp/mail/emacsbug.el        | 2 +-
 lisp/mail/sendmail.el        | 3 ++-
 lisp/menu-bar.el             | 4 +++-
 lisp/org/org.el              | 4 ++--
 lisp/progmodes/antlr-mode.el | 5 +++--
 lisp/progmodes/gdb-mi.el     | 4 +++-
 lisp/progmodes/xscheme.el    | 4 ++--
 lisp/ps-print.el             | 2 +-
 lisp/recentf.el              | 8 +++++---
 lisp/vc/ediff-util.el        | 4 ++--
 lisp/vc/pcvs.el              | 3 ++-
 lisp/vc/vc-bzr.el            | 3 ++-
 20 files changed, 47 insertions(+), 30 deletions(-)

diff --git a/admin/authors.el b/admin/authors.el
index 3dec23c..fd46dab 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 f370bd3..b0e8a4f 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 45a4d56..b9bdc0f 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!  
\\<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)
diff --git a/lisp/completion.el b/lisp/completion.el
index e36c722..643f2da 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 cf257c8..7c6f49f 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 a204966..a0bfcbb 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 6ba265f..e9c0fb5 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 7229d61..7417bb1 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 \\<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
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index 3da1e8b..7c3f6ba 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 312805f..d0aff09 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 ede8186..b2577c0 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 d03676e..4a74eda 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 a74ca1e..0b79454 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 3e5b8e2..fa54f51 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 7076331..1874f26 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 38671b5..1f4ed4e 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 9ae059a..57cbaf0 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 5646fd3..9016d1d 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 726fe4e..bbc81ef 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 bfe3293..48fedec 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]