emacs-diffs
[Top][All Lists]
Advanced

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

master bda6e9a226 5/7: Use command substitutions instead of literal keys


From: Stefan Kangas
Subject: master bda6e9a226 5/7: Use command substitutions instead of literal keys in some places
Date: Sun, 3 Jul 2022 17:35:13 -0400 (EDT)

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

    Use command substitutions instead of literal keys in some places
    
    * lisp/emulation/viper-macs.el (ex-map, viper-set-register-macro):
    * lisp/minibuffer.el (minibuffer-beginning-of-buffer-movement):
    * lisp/speedbar.el (speedbar-frame-mode):
    * lisp/subr.el (kbd):
    * lisp/textmodes/page-ext.el (pages-directory)
    (pages-directory-for-addresses):
    * lisp/textmodes/reftex-toc.el: Use command substitutions instead of
    literal keys.
---
 lisp/emulation/viper-macs.el |  8 +++++---
 lisp/minibuffer.el           |  3 ++-
 lisp/speedbar.el             |  3 ++-
 lisp/subr.el                 |  2 +-
 lisp/textmodes/page-ext.el   | 15 +++++++++------
 lisp/textmodes/reftex-toc.el |  4 +++-
 6 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el
index c4eb183ce4..06130afa7d 100644
--- a/lisp/emulation/viper-macs.el
+++ b/lisp/emulation/viper-macs.el
@@ -105,7 +105,8 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, 
e.g.,
         #'viper-end-mapping-kbd-macro)
       (define-key viper-emacs-intercept-map "\C-x)"
         #'viper-end-mapping-kbd-macro)
-      (message "Mapping %S in %s state.  Type macro definition followed by 
`C-x )'"
+      (message (substitute-command-keys "Mapping %S in %s state.  \
+Type macro definition followed by \\[kmacro-end-macro]")
               (viper-display-macro macro-name)
               (if ins "Insert" "Vi")))
     ))
@@ -886,8 +887,9 @@ mistakes in macro names to be passed to this function is to 
use
   (if (get-register reg)
       (if (y-or-n-p "Register contains data.  Overwrite? ")
          ()
-       (error
-        "Macro not saved in register.  Can still be invoked via `C-x e'")))
+        (error
+         (substitute-command-keys
+          "Macro not saved in register.  Can still be invoked via 
\\[kmacro-end-and-call-macro]"))))
   (set-register reg last-kbd-macro))
 
 (defun viper-register-macro (count)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 8a7da41a3b..e029dfe414 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -3091,7 +3091,8 @@ such as making the current buffer visit no file in the 
case of
   :type 'boolean)
 
 (defcustom minibuffer-beginning-of-buffer-movement nil
-  "Control how the `M-<' command in the minibuffer behaves.
+  "Control how the \\<minibuffer-local-map>\\[minibuffer-beginning-of-buffer] \
+command in the minibuffer behaves.
 If non-nil, the command will go to the end of the prompt (if
 point is after the end of the prompt).  If nil, it will behave
 like the `beginning-of-buffer' command."
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index b12cf3d9c2..da85d54863 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -934,7 +934,8 @@ supported at a time.
   ;; reset the selection variable
   (setq speedbar-last-selected-file nil)
   (unless (display-graphic-p)
-    (message "Use `M-x speedbar-get-focus' to see the speedbar window")))
+    (message (substitute-command-keys
+              "Use \\[speedbar-get-focus] to see the speedbar window"))))
 
 (defun speedbar-frame-reposition-smartly ()
   "Reposition the speedbar frame to be next to the attached frame."
diff --git a/lisp/subr.el b/lisp/subr.el
index 4e4eac32d9..2f9d37ffd6 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -964,7 +964,7 @@ side-effects, and the argument LIST is not modified."
 (defun kbd (keys)
   "Convert KEYS to the internal Emacs key representation.
 KEYS should be a string in the format returned by commands such
-as `C-h k' (`describe-key').
+as \\[describe-key] (`describe-key').
 
 This is the same format used for saving keyboard macros (see
 `edmacro-mode').
diff --git a/lisp/textmodes/page-ext.el b/lisp/textmodes/page-ext.el
index 24149f9afb..6b71f26e4f 100644
--- a/lisp/textmodes/page-ext.el
+++ b/lisp/textmodes/page-ext.el
@@ -515,13 +515,12 @@ resets the page-delimiter to the original value."
 (defvar pages-buffer-original-position)
 (defvar pages-buffer-original-page)
 
-(defun pages-directory
-  (pages-list-all-headers-p count-lines-p &optional regexp)
+(defun pages-directory (pages-list-all-headers-p count-lines-p &optional 
regexp)
   "Display a directory of the page headers in a temporary buffer.
 A header is the first non-blank line after the `page-delimiter'.
-\\[pages-directory-mode]
+\\<pages-directory-mode-map>
 You may move point to one of the lines in the temporary buffer,
-then use \\<pages-directory-goto> to go to the same line in the pages buffer.
+then use \\[pages-directory-goto] to go to the same line in the pages buffer.
 
 In interactive use:
 
@@ -587,7 +586,9 @@ directory for only the accessible portion of the buffer."
         (pages-directory-mode)
         (setq buffer-read-only nil)
         (insert
-         "==== Pages Directory: use `C-c C-c' to go to page under cursor. 
====" ?\n)
+         (substitute-command-keys
+          "==== Pages Directory: use \\<pages-directory-mode-map>\
+\\[pages-directory-goto] to go to page under cursor. ====") "\n")
         (setq pages-buffer pages-target-buffer)
         (setq pages-pos-list nil))
 
@@ -772,7 +773,9 @@ directory."
           (goto-char (point-min))
           (delete-region (point) (line-end-position))
           (insert
-           "=== Address List Directory: use `C-c C-c' to go to page under 
cursor. ===")
+           (substitute-command-keys
+            "=== Address List Directory: use \\<pages-directory-mode-map>\
+\\[pages-directory-goto] to go to page under cursor. ==="))
           (set-buffer-modified-p nil)
           ))
     (error "No addresses file found!")))
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el
index 9fdb104452..89c734a0d7 100644
--- a/lisp/textmodes/reftex-toc.el
+++ b/lisp/textmodes/reftex-toc.el
@@ -394,7 +394,9 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels 
[f]ollow [x]r [?]Help
                 (frame-parameter  frame 'name))
               "RefTeX TOC Frame")))
     (if (and res error)
-        (error "This frame is view-only.  Use `C-c =' to create TOC window for 
commands"))
+        (error (substitute-command-keys
+                "This frame is view-only.  Use \\[reftex-toc] \
+to create TOC window for commands")))
     res))
 
 (defun reftex-toc-show-help ()



reply via email to

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