From: Paul Eggert Date: Fri, 21 Aug 2015 21:08:47 +0000 (-0700) Subject: Avoid hard-coding "M-x command" in docstrings X-Git-Tag: emacs-25.0.90~1311 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c1cacb09948928287bfc32745f2a92604d3291c4;p=emacs.git 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. --- diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index e780e4ee11e..925d00866d1 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el @@ -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) diff --git a/lisp/desktop.el b/lisp/desktop.el index c168f9c9d9a..9d023e3dc89 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -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'. diff --git a/lisp/edmacro.el b/lisp/edmacro.el index 84dfd4f1ebf..acbd1e2f6b9 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el @@ -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") diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 863a02df252..4ff6e07f851 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -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")))))))) diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 5e1620df57c..40a37c7d8b6 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -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 diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el index e575eee6c93..d03d703c1ed 100644 --- a/lisp/emulation/viper-init.el +++ b/lisp/emulation/viper-init.el @@ -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. diff --git a/lisp/filesets.el b/lisp/filesets.el index f990333006b..a30c187676b 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -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 diff --git a/lisp/follow.el b/lisp/follow.el index abb874e7563..d62d5577dab 100644 --- a/lisp/follow.el +++ b/lisp/follow.el @@ -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. diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index d502a3b3904..0c0e63b100a 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el @@ -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 diff --git a/lisp/international/ogonek.el b/lisp/international/ogonek.el index 27ac17ca80e..9e5a4501357 100644 --- a/lisp/international/ogonek.el +++ b/lisp/international/ogonek.el @@ -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. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index e534b5841b6..193d70b230a 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -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" diff --git a/lisp/org/org-gnus.el b/lisp/org/org-gnus.el index 8b616f0a0ff..06f00a4950c 100644 --- a/lisp/org/org-gnus.el +++ b/lisp/org/org-gnus.el @@ -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) diff --git a/lisp/org/org.el b/lisp/org/org.el index 0cc185c0d75..326fb96fa13 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -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) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 0b7b9b7f501..189cd3759f5 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -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 diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 2edacf4e69a..451acd2cb9c 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -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 . diff --git a/lisp/server.el b/lisp/server.el index b6b0e97aa36..bcadcc4317a 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -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. diff --git a/lisp/type-break.el b/lisp/type-break.el index 5a12f02f876..c7043b5c0e4 100644 --- a/lisp/type-break.el +++ b/lisp/type-break.el @@ -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 diff --git a/lisp/userlock.el b/lisp/userlock.el index c47bc4c9bd1..781023c7449 100644 --- a/lisp/userlock.el +++ b/lisp/userlock.el @@ -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)))) diff --git a/lisp/whitespace.el b/lisp/whitespace.el index a1a6c3ce04a..ddc37f10180 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -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))))