From: Stefan Kangas Date: Tue, 5 Oct 2021 17:52:23 +0000 (+0200) Subject: Use substitute-command-keys in a few more places X-Git-Tag: emacs-29.0.90~1893^2~67 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=67a15ce1564ce35ece24a19f00e03a36e0575746;p=emacs.git Use substitute-command-keys in a few more places * lisp/indent.el (edit-tab-stops): * lisp/printing.el (pr-help-message, pr-show-setup): * lisp/progmodes/cperl-mode.el (cperl-narrow-to-here-doc): Use substitute-command-keys. --- diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index f11d9741ec7..127f6340a1e 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -1447,7 +1447,8 @@ Redefine the corresponding command." (let ((calc-kbd-push-level 0)) (execute-kbd-macro (substring body 0 -2)))) (let ((calc-kbd-push-level (1+ calc-kbd-push-level))) - (message "%s" "Saving modes; type Z' to restore") + ;; Avoid substituting the "'" character: + (message "%s" "Saving modes; type Z' to restore") (recursive-edit)))))) (defun calc-kbd-pop () diff --git a/lisp/indent.el b/lisp/indent.el index f52b729051d..b0c1a021da7 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -734,7 +734,9 @@ You can add or remove colons and then do \\\\[edit-tab-stops (while (> count 0) (insert "0123456789") (setq count (1- count)))) - (insert "\nTo install changes, type C-c C-c") + (insert (substitute-command-keys + (concat "\nTo install changes, type \\" + "\\[edit-tab-stops-note-changes]"))) (goto-char (point-min))) (defun edit-tab-stops-note-changes () diff --git a/lisp/printing.el b/lisp/printing.el index 534b45c772b..d10de24e03c 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -3040,7 +3040,7 @@ A. Interface: I. PostScript printing: - 1. You can generate a PostScript file (if you type C-u before activating + 1. You can generate a PostScript file (if you type \\[universal-argument] before activating menu) or PostScript temporary file for a directory, a buffer, a region or a major mode, choosing 1-up, 2-up, 4-up or any other n-up printing; after file generation, ghostview is activated using the file generated @@ -3080,7 +3080,7 @@ I. PostScript printing: `pr-ps-utility-alist'. 2. Operate the same way as option 1, but it sends directly the PostScript - code (or put in a file, if you've typed C-u) or it uses ghostscript to + code (or put in a file, if you've typed \\[universal-argument]) or it uses ghostscript to print the PostScript file generated. It depends on option 18, if it's turned on, it uses ghostscript; otherwise, it sends directly to printer. If spooling is on (option 16), the PostScript code is saved @@ -3089,7 +3089,7 @@ I. PostScript printing: Instead of printing each buffer, region or major mode at once, you can save temporarily the PostScript code generated in a buffer and print it later. The option `Despool...' despools the PostScript spooling buffer - directly on a printer. If you type C-u before choosing this option, + directly on a printer. If you type \\[universal-argument] before choosing this option, the PostScript code generated is saved in a file instead of sending it to the printer. To spool the PostScript code generated you need to turn on option 16. This option is enabled if spooling is on (option 16). @@ -4183,7 +4183,8 @@ bottom." (defun pr-help (&rest _ignore) "Help for the printing package." (interactive) - (pr-show-setup pr-help-message "*Printing Help*")) + (pr-show-setup (substitute-command-keys pr-help-message) + "*Printing Help*")) ;;;###autoload @@ -5036,7 +5037,8 @@ If menu binding was not done, calls `pr-menu-bind'." (defun pr-show-setup (settings buffer-name) (with-output-to-temp-buffer buffer-name - (princ settings) + (with-current-buffer buffer-name + (insert settings)) (help-print-return-message))) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index ba0adcc913f..a3995e2969d 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -8535,8 +8535,8 @@ POS defaults to the point." (let ((p (cperl-get-here-doc-region pos))) (or p (error "Not inside a HERE document")) (narrow-to-region (car p) (cdr p)) - (message - "When you are finished with narrow editing, type C-x n w"))) + (message (substitute-command-keys + "When you are finished with narrow editing, type \\[widen]")))) (defun cperl-select-this-pod-or-here-doc (&optional pos) "Select the HERE-DOC (or POD section) at POS.