Use substitute-command-keys in some messages

* lisp/dired.el (dired-get-file-for-visit):
* lisp/doc-view.el (doc-view-buffer-message):
* lisp/help.el (help-window-setup):
* lisp/ibuf-ext.el (ibuffer-do-kill-lines):
* lisp/vc/ediff.el (ediff-documentation): Use 'substitute-command-keys'.
This commit is contained in:
Stefan Kangas 2021-03-08 10:56:51 +01:00
parent 9ae741750c
commit 0fbe543bc1
5 changed files with 21 additions and 14 deletions

View file

@ -2449,7 +2449,9 @@ directory in another window."
file-name
(if (file-symlink-p file-name)
(error "File is a symlink to a nonexistent target")
(error "File no longer exists; type `g' to update Dired buffer")))))
(error (substitute-command-keys
(concat "File no longer exists; type \\<dired-mode-map>"
"\\[revert-buffer] to update Dired buffer")))))))
;; Force C-m keybinding rather than `f' or `e' in the mode doc:
(define-obsolete-function-alias 'dired-advertised-find-file

View file

@ -1530,16 +1530,16 @@ have the page we want to view."
(overlay-put (doc-view-current-overlay) 'display
(concat (propertize "Welcome to DocView!" 'face 'bold)
"\n"
"
(substitute-command-keys "
If you see this buffer it means that the document you want to view is being
converted to PNG and the conversion of the first page hasn't finished yet or
`doc-view-conversion-refresh-interval' is set to nil.
For now these keys are useful:
`q' : Bury this buffer. Conversion will go on in background.
`k' : Kill the conversion process and this buffer.
`K' : Kill the conversion process.\n"))))
\\<doc-view-mode-map>
\\[quit-window] : Bury this buffer. Conversion will go on in background.
\\[image-kill-buffer] : Kill the conversion process and this buffer.
\\[doc-view-kill-proc] : Kill the conversion process.\n")))))
(declare-function tooltip-show "tooltip" (text &optional use-echo-area))

View file

@ -1833,13 +1833,13 @@ Return VALUE."
(cond
((eq help-setup 'window)
;; ... and is new, ...
"Type \"q\" to delete help window")
"Type \\<help-map>\\[help-quit] to delete help window")
((eq help-setup 'frame)
;; ... on a new frame, ...
"Type \"q\" to quit the help frame")
"Type \\<help-map>\\[help-quit] to quit the help frame")
((eq help-setup 'other)
;; ... or displayed some other buffer before.
"Type \"q\" to restore previous buffer"))
"Type \\<help-map>\\[help-quit] to restore previous buffer"))
window t))
((and (eq (window-frame window) help-window-old-frame)
(= (length (window-list nil 'no-mini)) 2))
@ -1850,7 +1850,7 @@ Return VALUE."
((eq help-setup 'window)
"Type \\[delete-other-windows] to delete the help window")
((eq help-setup 'other)
"Type \"q\" in help window to restore its previous buffer"))
"Type \\<help-map>\\[help-quit] in help window to restore its previous buffer"))
window 'other))
(t
;; The help window is not selected ...
@ -1858,10 +1858,10 @@ Return VALUE."
(cond
((eq help-setup 'window)
;; ... and is new, ...
"Type \"q\" in help window to delete it")
"Type \\<help-map>\\[help-quit] in help window to delete it")
((eq help-setup 'other)
;; ... or displayed some other buffer before.
"Type \"q\" in help window to restore previous buffer"))
"Type \\<help-map>\\[help-quit] in help window to restore previous buffer"))
window))))
;; Return VALUE.
value))

View file

@ -1597,7 +1597,10 @@ to move by. The default is `ibuffer-marked-char'."
"Hide all of the currently marked lines."
(interactive)
(if (= (ibuffer-count-marked-lines) 0)
(message "No buffers marked; use `m' to mark a buffer")
(message (substitute-command-keys
(concat
"No buffers marked; use \\<ibuffer-mode-map>"
"\\[ibuffer-mark-forward] to mark a buffer")))
(let ((count
(ibuffer-map-marked-lines
(lambda (_buf _mark)

View file

@ -1558,7 +1558,9 @@ With optional NODE, goes to that node."
(info "ediff")
(if node
(Info-goto-node node)
(message "Type `i' to search for a specific topic"))
(message (substitute-command-keys
(concat "Type \\<Info-mode-map>\\[Info-index] to"
" search for a specific topic"))))
(raise-frame))
(error (beep 1)
(with-output-to-temp-buffer ediff-msg-buffer