diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-08-14 15:50:35 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-08-14 15:55:58 -0700 |
commit | 6af5aad26411ffe21c3fe4bc5438347110910111 (patch) | |
tree | 2fdf4b741c5025f60924c902123bb31536eca511 /lisp/emacs-lisp | |
parent | 244c801689d2f7a80480d83cd7d092d4762ebe08 (diff) | |
download | emacs-6af5aad26411ffe21c3fe4bc5438347110910111.tar.gz |
Prefer ‘format’ to ‘substitute-command-keys’
* src/character.h (uLSQM, uRSQM): Move here ...
* src/doc.c (uLSQM, uRSQM): ... from here.
* src/doc.c (Fsubstitute_command_keys):
* src/syntax.c (Finternal_describe_syntax_value):
* lisp/cedet/mode-local.el (mode-local-print-binding)
(mode-local-describe-bindings-2):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-theme.el (describe-theme-1):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/emacs-lisp/cl-extra.el (cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl--generic-describe):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/package.el (describe-package-1):
* lisp/faces.el (describe-face):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode):
Prefer ‘format’ to ‘substitute-command-keys’ when either will do
to implement quoting style. This generally makes the code simpler.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/cl-extra.el | 20 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl-generic.el | 4 | ||||
-rw-r--r-- | lisp/emacs-lisp/eieio-opt.el | 4 | ||||
-rw-r--r-- | lisp/emacs-lisp/package.el | 7 |
4 files changed, 17 insertions, 18 deletions
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 9742014db0c..132aaa5cfce 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -752,16 +752,16 @@ including `cl-block' and `cl-eval-when'." ;; FIXME: Add a `cl-class-of' or `cl-typeof' or somesuch. (metatype (cl--class-name (symbol-value (aref class 0))))) (insert (symbol-name type) - (substitute-command-keys " is a type (of kind ‘")) + (format " is a type (of kind ‘")) (help-insert-xref-button (symbol-name metatype) 'cl-help-type metatype) - (insert (substitute-command-keys "’)")) + (insert (format "’)")) (when location - (insert (substitute-command-keys " in ‘")) + (insert (format " in ‘")) (help-insert-xref-button (help-fns-short-filename location) 'cl-type-definition type location 'define-type) - (insert (substitute-command-keys "’"))) + (insert (format "’"))) (insert ".\n") ;; Parents. @@ -771,10 +771,10 @@ including `cl-block' and `cl-eval-when'." (insert " Inherits from ") (while (setq cur (pop pl)) (setq cur (cl--class-name cur)) - (insert (substitute-command-keys "‘")) + (insert (format "‘")) (help-insert-xref-button (symbol-name cur) 'cl-help-type cur) - (insert (substitute-command-keys (if pl "’, " "’")))) + (insert (format (if pl "’, " "’")))) (insert ".\n"))) ;; Children, if available. ¡For EIEIO! @@ -785,10 +785,10 @@ including `cl-block' and `cl-eval-when'." (when ch (insert " Children ") (while (setq cur (pop ch)) - (insert (substitute-command-keys "‘")) + (insert (format "‘")) (help-insert-xref-button (symbol-name cur) 'cl-help-type cur) - (insert (substitute-command-keys (if ch "’, " "’")))) + (insert (format (if ch "’, " "’")))) (insert ".\n"))) ;; Type's documentation. @@ -804,10 +804,10 @@ including `cl-block' and `cl-eval-when'." (when generics (insert (propertize "Specialized Methods:\n\n" 'face 'bold)) (dolist (generic generics) - (insert (substitute-command-keys "‘")) + (insert (format "‘")) (help-insert-xref-button (symbol-name generic) 'help-function generic) - (insert (substitute-command-keys "’")) + (insert (format "’")) (pcase-dolist (`(,qualifiers ,args ,doc) (cl--generic-method-documentation generic type)) (insert (format " %s%S\n" qualifiers args) diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index a138697a18b..7ae63b1e6b1 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el @@ -864,11 +864,11 @@ MET-NAME is a cons (SYMBOL . SPECIALIZERS)." (cl--generic-method-specializers method))) (file (find-lisp-object-file-name met-name 'cl-defmethod))) (when file - (insert (substitute-command-keys " in ‘")) + (insert (format " in ‘")) (help-insert-xref-button (help-fns-short-filename file) 'help-function-def met-name file 'cl-defmethod) - (insert (substitute-command-keys "’.\n")))) + (insert (format "’.\n")))) (insert "\n" (or (nth 2 info) "Undocumented") "\n\n"))))))) (defun cl--generic-specializers-apply-to-type-p (specializers type) diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el index 0b003360ed5..c4d6d35a13b 100644 --- a/lisp/emacs-lisp/eieio-opt.el +++ b/lisp/emacs-lisp/eieio-opt.el @@ -141,11 +141,11 @@ are not abstract." (setq location (find-lisp-object-file-name ctr def))) (when location - (insert (substitute-command-keys " in ‘")) + (insert (format " in ‘")) (help-insert-xref-button (help-fns-short-filename location) 'cl-type-definition ctr location 'define-type) - (insert (substitute-command-keys "’"))) + (insert (format "’"))) (insert ".\nCreates an object of class " (symbol-name ctr) ".") (goto-char (point-max)) (if (autoloadp def) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 967720881f6..863a02df252 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2204,7 +2204,7 @@ Otherwise no newline is inserted." "Installed" (capitalize status)) 'font-lock-face 'package-status-builtin-face)) - (insert (substitute-command-keys " in ‘")) + (insert (format " in ‘")) (let ((dir (abbreviate-file-name (file-name-as-directory (if (file-in-directory-p pkg-dir package-user-dir) @@ -2213,11 +2213,10 @@ Otherwise no newline is inserted." (help-insert-xref-button dir 'help-package-def pkg-dir)) (if (and (package-built-in-p name) (not (package-built-in-p name version))) - (insert (substitute-command-keys - "’,\n shadowing a ") + (insert (format "’,\n shadowing a ") (propertize "built-in package" 'font-lock-face 'package-status-builtin-face)) - (insert (substitute-command-keys "’"))) + (insert (format "’"))) (if signed (insert ".") (insert " (unsigned).")) |