1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-25 07:28:20 +00:00

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.
This commit is contained in:
Stefan Kangas 2022-07-03 21:00:16 +02:00
parent 5cb8303f6b
commit bda6e9a226
6 changed files with 22 additions and 13 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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