Commit c1cacb09 authored by Paul Eggert's avatar Paul Eggert

Avoid hard-coding "M-x command" in docstrings

* lisp/calendar/todo-mode.el (todo-mode):
* lisp/desktop.el (desktop-save-mode):
* lisp/edmacro.el (edit-kbd-macro):
* lisp/emacs-lisp/package.el (package-menu-execute):
* lisp/emulation/viper-cmd.el (viper-ask-level):
* lisp/emulation/viper-init.el (viper-expert-level):
* lisp/filesets.el (filesets-add-buffer):
* lisp/follow.el (follow-mode):
* lisp/gnus/auth-source.el (auth-sources):
* lisp/international/ogonek.el (ogonek-informacja)
(ogonek-information):
* lisp/net/tramp.el (tramp-process-actions):
* lisp/org/org-gnus.el (org-gnus-no-new-news):
* lisp/org/org.el (org-ellipsis):
* lisp/progmodes/python.el (python-shell-get-process-or-error):
* lisp/progmodes/vhdl-mode.el (vhdl-mode):
* lisp/server.el (server-start):
* lisp/type-break.el (type-break-noninteractive-query):
* lisp/userlock.el (ask-user-about-supersession-help):
* lisp/whitespace.el (whitespace-report-region):
Prefer (substitute-command-keys "`\\[foo-command]'")
to "`M-x foo-command'" in docstrings and the like.
parent 59f79430
......@@ -6598,7 +6598,9 @@ Added to `window-configuration-change-hook' in Todo mode."
\\{todo-mode-map}"
(if (called-interactively-p 'any)
(message "Type ‘M-x todo-show’ to enter Todo mode")
(message "%s"
(substitute-command-keys
"Type ‘\\[todo-show]’ to enter Todo mode"))
(todo-modes-set-1)
(todo-modes-set-2)
(todo-modes-set-3)
......
......@@ -165,8 +165,8 @@ one session to another. In particular, Emacs will save the desktop when
it exits (this may prompt you; see the option `desktop-save'). The next
time Emacs starts, if this mode is active it will restore the desktop.
To manually save the desktop at any time, use the command `M-x desktop-save'.
To load it, use `M-x desktop-read'.
To manually save the desktop at any time, use the command `\\[desktop-save]'.
To load it, use `\\[desktop-read]'.
Once a desktop file exists, Emacs will auto-save it according to the
option `desktop-auto-save-timeout'.
......
......@@ -89,7 +89,7 @@ Default nil means to write characters above \\177 in octal notation."
"Edit a keyboard macro.
At the prompt, type any key sequence which is bound to a keyboard macro.
Or, type `C-x e' or RET to edit the last keyboard macro, `C-h l' to edit
the last 300 keystrokes as a keyboard macro, or `M-x' to edit a macro by
the last 300 keystrokes as a keyboard macro, or `\\[execute-extended-command]' to edit a macro by
its command name.
With a prefix argument, format the macro in a more concise way."
(interactive "kKeyboard macro to edit (C-x e, M-x, C-h l, or keys): \nP")
......
......@@ -3193,7 +3193,8 @@ Optional argument NOQUERY non-nil means do not ask the user to confirm."
(if-let ((removable (package--removable-packages)))
(message "Package menu: Operation finished. %d packages %s"
(length removable)
"are no longer needed, type `M-x package-autoremove' to remove them")
(substitute-command-keys
"are no longer needed, type `\\[package-autoremove]' to remove them"))
(message (replace-regexp-in-string "__" "ed" message-template)
"finished"))))))))
......
......@@ -4782,10 +4782,10 @@ sensitive for VI-style look-and-feel."
(setq repeated t))
(setq dont-change-unless t
level-changed t)
(insert "
(insert (substitute-command-keys "
Please specify your level of familiarity with the venomous VI PERil
\(and the VI Plan for Emacs Rescue).
You can change it at any time by typing `M-x viper-set-expert-level RET'
You can change it at any time by typing `\\[viper-set-expert-level]'
1 -- BEGINNER: Almost all Emacs features are suppressed.
Feels almost like straight Vi. File name completion and
......@@ -4803,7 +4803,7 @@ You can change it at any time by typing `M-x viper-set-expert-level RET'
viper-electric-mode, viper-want-ctl-h-help, viper-want-emacs-keys-in-vi,
and viper-want-emacs-keys-in-insert. Adjust these to your taste.
Please, specify your level now: ")
Please, specify your level now: "))
(setq viper-expert-level (- (viper-read-char-exclusive) ?0))
) ; end while
......
......@@ -279,7 +279,7 @@ The minor mode viper-vi-diehard-minor-mode is in effect when
viper-expert-level is 1 or 2 or when viper-want-emacs-keys-in-vi is t.
The minor mode viper-insert-diehard-minor-mode is in effect when
viper-expert-level is 1 or 2 or if viper-want-emacs-keys-in-insert is t.
Use `M-x viper-set-expert-level' to change this.")
Use `\\[viper-set-expert-level]' to change this.")
;; Max expert level supported by Viper. This is NOT a user option.
;; It is here to make it hard for the user from resetting it.
......
......@@ -1808,7 +1808,8 @@ User will be queried, if no fileset name is provided."
(progn
(add-to-list 'filesets-data (list name '(:files)))
(message
"Fileset %s created. Call `M-x filesets-save-config' to save."
(substitute-command-keys
"Fileset %s created. Call `\\[filesets-save-config]' to save.")
name)
(car filesets-data))))))
(if entry
......
......@@ -405,7 +405,7 @@ mileage may vary).
To split one large window into two side-by-side windows, the commands
`\\[split-window-right]' or \
`M-x follow-delete-other-windows-and-split' can be used.
`\\[follow-delete-other-windows-and-split]' can be used.
Only windows displayed in the same frame follow each other.
......
......@@ -242,7 +242,7 @@ EPA/EPG set up, the file will be encrypted and decrypted
automatically. See Info node `(epa)Encrypting/decrypting gpg files'
for details.
It's best to customize this with `M-x customize-variable' because the choices
It's best to customize this with `\\[customize-variable]' because the choices
can get pretty complex."
:group 'auth-source
:version "24.1" ;; No Gnus
......
......@@ -75,7 +75,7 @@ are given in the following order:
Je/sli czytasz ten tekst, to albo przegl/adasz plik /xr/od/lowy
biblioteki `ogonek.el', albo wywo/la/le/s polecenie `ogonek-jak'.
W drugim przypadku mo/zesz usun/a/c tekst z ekranu, stosuj/ac
polecenie `M-x kill-buffer'.
polecenie `\\[kill-buffer]'.
Niniejsza biblioteka dostarcza funkcji do zmiany kodowania polskich
znak/ow diakrytycznych. Funkcje te mo/zna pogrupowa/c nast/epuj/aco.
......@@ -174,7 +174,7 @@ znak/ow diakrytycznych. Funkcje te mo/zna pogrupowa/c nast/epuj/aco.
If you read this text then you are either looking at the library's
source text or you have called the `ogonek-how' command. In the
latter case you may remove this text using `M-x kill-buffer'.
latter case you may remove this text using `\\[kill-buffer]'.
The library provides functions for changing the encoding of Polish
diacritic characters, the ones with an `ogonek' below or above them.
......
......@@ -3594,9 +3594,10 @@ connection buffer."
(cond
((eq exit 'permission-denied) "Permission denied")
((eq exit 'process-died)
(concat
"Tramp failed to connect. If this happens repeatedly, try\n"
" `M-x tramp-cleanup-this-connection'"))
(substitute-command-keys
(concat
"Tramp failed to connect. If this happens repeatedly, try\n"
" `\\[tramp-cleanup-this-connection]'")))
((eq exit 'timeout)
(format
"Timeout reached, see buffer `%s' for details"
......
......@@ -291,7 +291,7 @@ If `org-store-link' was called with a prefix arg the meaning of
(group (gnus-group-jump-to-group group))))
(defun org-gnus-no-new-news ()
"Like `M-x gnus' but doesn't check for new news."
"Like `\\[gnus]' but doesn't check for new news."
(if (not (gnus-alive-p)) (if org-gnus-no-server (gnus-no-server) (gnus))))
(provide 'org-gnus)
......
......@@ -827,7 +827,7 @@ When nil, just use the standard three dots.
When a string, use that string instead.
When a face, use the standard 3 dots, but with the specified face.
The change affects only Org-mode (which will then use its own display table).
Changing this requires executing `M-x org-mode RET' in a buffer to become
Changing this requires executing `\\[org-mode]' in a buffer to become
effective."
:group 'org-startup
:type '(choice (const :tag "Default" nil)
......
......@@ -2720,7 +2720,8 @@ of `error' with a user-friendly message."
(or (python-shell-get-process)
(if interactivep
(user-error
"Start a Python process first with `M-x run-python' or `%s'."
"Start a Python process first with ‘%s’ or ‘%s’."
(substitute-command-keys "\\[run-python]")
;; Get the binding.
(key-description
(where-is-internal
......
......@@ -4421,7 +4421,7 @@ Usage:
according to option `vhdl-argument-list-indent'.
If option `vhdl-indent-tabs-mode' is nil, spaces are used instead of
tabs. `M-x tabify' and `M-x untabify' allow to convert spaces to tabs
tabs. `\\[tabify]' and `\\[untabify]' allow to convert spaces to tabs
and vice versa.
Syntax-based indentation can be very slow in large files. Option
......@@ -4732,7 +4732,7 @@ Usage:
`vhdl-highlight-translate-off' is non-nil.
For documentation and customization of the used colors see
customization group `vhdl-highlight-faces' (`M-x customize-group'). For
customization group `vhdl-highlight-faces' (`\\[customize-group]'). For
highlighting of matching parenthesis, see customization group
`paren-showing'. Automatic buffer highlighting is turned on/off by
option `global-font-lock-mode' (`font-lock-auto-fontify' in XEmacs).
......@@ -4792,14 +4792,14 @@ Usage:
sessions using the \"Save Options\" menu entry.
Options and their detailed descriptions can also be accessed by using
the \"Customize\" menu entry or the command `M-x customize-option' (`M-x
customize-group' for groups). Some customizations only take effect
the \"Customize\" menu entry or the command `\\[customize-option]'
(`\\[customize-group]' for groups). Some customizations only take effect
after some action (read the NOTE in the option documentation).
Customization can also be done globally (i.e. site-wide, read the
INSTALL file).
Not all options are described in this documentation, so go and see
what other useful user options there are (`M-x vhdl-customize' or menu)!
what other useful user options there are (`\\[vhdl-customize]' or menu)!
FILE EXTENSIONS:
......@@ -4828,7 +4828,7 @@ Usage:
Maintenance:
------------
To submit a bug report, enter `M-x vhdl-submit-bug-report' within VHDL Mode.
To submit a bug report, enter `\\[vhdl-submit-bug-report]' within VHDL Mode.
Add a description of the problem and include a reproducible test case.
Questions and enhancement requests can be sent to <reto@gnu.org>.
......
......@@ -624,8 +624,9 @@ To force-start a server, do \\[server-force-delete] and then
(concat "Unable to start the Emacs server.\n"
(format "There is an existing Emacs server, named %S.\n"
server-name)
"To start the server in this Emacs process, stop the existing
server or call `M-x server-force-delete' to forcibly disconnect it.")
(substitute-command-keys
"To start the server in this Emacs process, stop the existing
server or call `\\[server-force-delete]' to forcibly disconnect it."))
:warning)
(setq leave-dead t))
;; If this Emacs already had a server, clear out associated status.
......
......@@ -803,8 +803,9 @@ this or ask the user to start one right now."
(type-break-mode-line-message-mode)
(t
(beep t)
(message "%sYou should take a typing break now. Do `M-x type-break'."
(type-break-time-stamp))
(message "%sYou should take a typing break now. Do ‘%s’."
(type-break-time-stamp)
(substitute-command-keys "\\[type-break]"))
(sit-for 1)
(beep t)
;; return nil so query caller knows to reset reminder, as if user
......
......@@ -142,7 +142,7 @@ If you say `r' to revert, the contents of the buffer are refreshed
from the file on disk.
If you say `n', the change you started to make will be aborted.
Usually, you should type `n' and then `M-x revert-buffer',
Usually, you should type `n' and then `\\[revert-buffer]',
to get the latest version of the file, then make the change again.")
(with-current-buffer standard-output
(help-mode))))
......
......@@ -1866,9 +1866,11 @@ cleaning up these problems."
(whitespace-insert-value ws-tab-width)
(when has-bogus
(goto-char (point-max))
(insert " Type `M-x whitespace-cleanup'"
(insert (substitute-command-keys
" Type \\[whitespace-cleanup]")
" to cleanup the buffer.\n\n"
" Type `M-x whitespace-cleanup-region'"
(substitute-command-keys
" Type \\[whitespace-cleanup-region]")
" to cleanup a region.\n\n"))
(whitespace-display-window (current-buffer)))))
has-bogus))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment