summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-06-19 00:35:43 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-06-19 00:38:45 -0700
commitc4151ebe15479de4c2e511b068cdf9af6a4576cf (patch)
tree14933519830d5da23b6962cdaff705081eb85313 /lisp
parentaad7ea32c57c7b9673a8d429524e050dac2d210c (diff)
downloademacs-c4151ebe15479de4c2e511b068cdf9af6a4576cf.tar.gz
Improve the optional translation of quotes
Fix several problems with the recently-added custom variable help-quote-translation where the code would quote inconsistently in help buffers. Add support for quoting 'like this', which is common in other GNU programs in ASCII environments. Change help-quote-translation to use more mnemonic values: values are now the initial quoting char, e.g., (setq help-quote-translation ?`) gets the traditional Emacs help-buffer quoting style `like this'. Change the default behavior of substitute-command-keys to match what's done in set-locale-environment, i.e., quote ‘like this’ if displayable, 'like this' otherwise. * doc/lispref/help.texi (Keys in Documentation): Document new behavior of substitute-command-keys, and document help-quote-translation. * doc/lispref/tips.texi (Documentation Tips): Mention the effect of help-quote-translation. * etc/NEWS: Mention new behavior of substitute-command-keys, and merge help-quote-translation news into it. When talking about doc strings, mention new ways to type quotes. * lisp/cedet/mode-local.el (overload-docstring-extension): Revert my recent change to this function, which shouldn't be needed as the result is a doc string. * 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-generic.el (cl--generic-describe): * lisp/emacs-lisp/eieio-opt.el (eieio-help-class) (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): Use substitute-command-keys to ensure a more-consistent quoting style in help buffers. * lisp/cus-start.el (standard): Document new help-quote-translation behavior. * lisp/emacs-lisp/lisp-mode.el (lisp-fdefs): * lisp/help-mode.el (help-xref-symbol-regexp, help-xref-info-regexp) (help-xref-url-regexp): * lisp/international/mule-cmds.el (help-xref-mule-regexp-template): * lisp/wid-edit.el (widget-documentation-link-regexp): Also match 'foo', in case we're in a help buffer generated when help-quote-translation is ?'. * src/doc.c: Include disptab.h, for DISP_CHAR_VECTOR. (LEFT_SINGLE_QUOTATION_MARK, uLSQM0, uLSQM1, uLSQM2, uRSQM0) (uRSQM1, uRSQM2, LSQM, RSQM): New constants. (Fsubstitute_command_keys): Document and implement new behavior. (Vhelp_quote_translation): Document new behavior.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/cedet/mode-local.el18
-rw-r--r--lisp/cedet/srecode/srt-mode.el4
-rw-r--r--lisp/cus-start.el7
-rw-r--r--lisp/cus-theme.el4
-rw-r--r--lisp/descr-text.el12
-rw-r--r--lisp/emacs-lisp/cl-generic.el4
-rw-r--r--lisp/emacs-lisp/eieio-opt.el20
-rw-r--r--lisp/emacs-lisp/lisp-mode.el8
-rw-r--r--lisp/emacs-lisp/package.el7
-rw-r--r--lisp/faces.el13
-rw-r--r--lisp/help-fns.el71
-rw-r--r--lisp/help-mode.el6
-rw-r--r--lisp/help.el8
-rw-r--r--lisp/international/mule-cmds.el2
-rw-r--r--lisp/wid-edit.el2
15 files changed, 108 insertions, 78 deletions
diff --git a/lisp/cedet/mode-local.el b/lisp/cedet/mode-local.el
index 35363337aee..3bdc3ea6155 100644
--- a/lisp/cedet/mode-local.el
+++ b/lisp/cedet/mode-local.el
@@ -598,16 +598,15 @@ PROMPT, INITIAL, HIST, and DEFAULT are the same as for `completing-read'."
(defun overload-docstring-extension (overload)
"Return the doc string that augments the description of OVERLOAD."
(let ((doc "\n\This function can be overloaded\
- with ‘define-mode-local-override’.")
+ with `define-mode-local-override'.")
(sym (overload-obsoleted-by overload)))
(when sym
- (setq doc (format "%s\nIt has made the overload ‘%s’ obsolete since %s."
+ (setq doc (format "%s\nIt has made the overload `%s' obsolete since %s."
doc sym (get sym 'overload-obsoleted-since))))
(setq sym (overload-that-obsolete overload))
(when sym
- (setq doc (format
- "%s\nThis overload is obsolete since %s;\nuse ‘%s’ instead."
- doc (get overload 'overload-obsoleted-since) sym)))
+ (setq doc (format "%s\nThis overload is obsolete since %s;\nUse `%s' instead."
+ doc (get overload 'overload-obsoleted-since) sym)))
doc))
(defun mode-local-augment-function-help (symbol)
@@ -630,9 +629,10 @@ SYMBOL is a function that can be overridden."
(defun mode-local-print-binding (symbol)
"Print the SYMBOL binding."
(let ((value (symbol-value symbol)))
- (princ (format "\n ‘%s’ value is\n " symbol))
+ (princ (format (substitute-command-keys "\n ‘%s’ value is\n ")
+ symbol))
(if (and value (symbolp value))
- (princ (format "‘%s’" value))
+ (princ (format (substitute-command-keys "‘%s’") value))
(let ((pt (point)))
(pp value)
(save-excursion
@@ -690,7 +690,7 @@ SYMBOL is a function that can be overridden."
)
((symbolp buffer-or-mode)
(setq mode buffer-or-mode)
- (princ (format "‘%s’\n" buffer-or-mode))
+ (princ (format (substitute-command-keys "‘%s’\n") buffer-or-mode))
)
((signal 'wrong-type-argument
(list 'buffer-or-mode buffer-or-mode))))
@@ -700,7 +700,7 @@ SYMBOL is a function that can be overridden."
(while mode
(setq table (get mode 'mode-local-symbol-table))
(when table
- (princ (format "\n- From ‘%s’\n" mode))
+ (princ (format (substitute-command-keys "\n- From ‘%s’\n") mode))
(mode-local-print-bindings table))
(setq mode (get-mode-local-parent mode)))))
diff --git a/lisp/cedet/srecode/srt-mode.el b/lisp/cedet/srecode/srt-mode.el
index fbc56357b1c..48f055561ea 100644
--- a/lisp/cedet/srecode/srt-mode.el
+++ b/lisp/cedet/srecode/srt-mode.el
@@ -258,9 +258,9 @@ we can tell font lock about them.")
(when (class-abstract-p C)
(throw 'skip nil))
- (princ "‘")
+ (princ (substitute-command-keys "‘"))
(princ name)
- (princ "’")
+ (princ (substitute-command-keys "’"))
(when (slot-exists-p C 'key)
(when key
(princ " - Character Key: ")
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 12def4c4148..7cf5ce736bd 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -223,9 +223,10 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
;; doc.c
(help-quote-translation help
(choice
- (const :tag "No translation" nil)
- (const :tag "Translate curly single quotes to ASCII" traditional)
- (const :tag "Translate ASCII single quotes to curly" prefer-unicode))
+ (character :tag "Quote ‘like this’" :value ?‘)
+ (character :tag "Quote 'like this'" :value ?\')
+ (character :tag "Quote `like this'" :value ?\`)
+ (const :tag "Quote ‘like this’ if displyable, 'like this' otherwise" nil))
"25.1")
;; dosfns.c
(dos-display-scancodes display boolean)
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el
index 1321fbc4b7e..bc221e17c4b 100644
--- a/lisp/cus-theme.el
+++ b/lisp/cus-theme.el
@@ -492,10 +492,10 @@ It includes all faces in list FACES."
'("" "c")))
doc)
(when fn
- (princ " in ‘")
+ (princ (substitute-command-keys " in ‘"))
(help-insert-xref-button (file-name-nondirectory fn)
'help-theme-def fn)
- (princ "’"))
+ (princ (substitute-command-keys "’")))
(princ ".\n")
(if (custom-theme-p theme)
(progn
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index c8641aed8bb..a0b9ddfe2c9 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -161,8 +161,11 @@ otherwise."
;; Buttons
(when (and button (not (widgetp wid-button)))
(newline)
- (insert "Here is a ‘" (format "%S" button-type)
- "’ button labeled ‘" button-label "’.\n\n"))
+ (insert (substitute-command-keys "Here is a ‘")
+ (format "%S" button-type)
+ (substitute-command-keys "’ button labeled ‘")
+ button-label
+ (substitute-command-keys "’.\n\n")))
;; Overlays
(when overlays
(newline)
@@ -738,8 +741,9 @@ relevant to POS."
(when face
(insert (propertize " " 'display '(space :align-to 5))
"face: ")
- (insert (concat "‘" (symbol-name face) "’"))
- (insert "\n")))))
+ (insert (substitute-command-keys "‘")
+ (symbol-name face)
+ (substitute-command-keys "’\n"))))))
(insert "these terminal codes:\n")
(dotimes (i (length disp-vector))
(insert (car (aref disp-vector i))
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index 96b86aa21cc..5923e4db996 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -876,11 +876,11 @@ Can only be used from within the lexical body of a primary or around method."
(cl--generic-method-specializers method)))
(file (find-lisp-object-file-name met-name 'cl-defmethod)))
(when file
- (insert " in ‘")
+ (insert (substitute-command-keys " in ‘"))
(help-insert-xref-button (help-fns-short-filename file)
'help-function-def met-name file
'cl-defmethod)
- (insert "’.\n")))
+ (insert (substitute-command-keys "’.\n"))))
(insert "\n" (or (nth 2 info) "Undocumented") "\n\n")))))))
;;; Support for (head <val>) specializers.
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el
index 11d99849a97..6cd6813956a 100644
--- a/lisp/emacs-lisp/eieio-opt.el
+++ b/lisp/emacs-lisp/eieio-opt.el
@@ -90,11 +90,11 @@ If CLASS is actually an object, then also display current values of that object.
" class")
(let ((location (find-lisp-object-file-name class 'eieio-defclass)))
(when location
- (insert " in ‘")
+ (insert (substitute-command-keys " in ‘"))
(help-insert-xref-button
(help-fns-short-filename location)
'eieio-class-def class location 'eieio-defclass)
- (insert "’")))
+ (insert (substitute-command-keys "’"))))
(insert ".\n")
;; Parents
(let ((pl (eieio-class-parents class))
@@ -103,10 +103,10 @@ If CLASS is actually an object, then also display current values of that object.
(insert " Inherits from ")
(while (setq cur (pop pl))
(setq cur (eieio--class-name cur))
- (insert "‘")
+ (insert (substitute-command-keys "‘"))
(help-insert-xref-button (symbol-name cur)
'help-function cur)
- (insert (if pl "’, " "’")))
+ (insert (substitute-command-keys (if pl "’, " "’"))))
(insert ".\n")))
;; Children
(let ((ch (eieio-class-children class))
@@ -114,10 +114,10 @@ If CLASS is actually an object, then also display current values of that object.
(when ch
(insert " Children ")
(while (setq cur (pop ch))
- (insert "‘")
+ (insert (substitute-command-keys "‘"))
(help-insert-xref-button (symbol-name cur)
'help-function cur)
- (insert (if ch "’, " "’")))
+ (insert (substitute-command-keys (if ch "’, " "’"))))
(insert ".\n")))
;; System documentation
(let ((doc (documentation-property class 'variable-documentation)))
@@ -130,9 +130,9 @@ If CLASS is actually an object, then also display current values of that object.
(when generics
(insert (propertize "Specialized Methods:\n\n" 'face 'bold))
(dolist (generic generics)
- (insert "‘")
+ (insert (substitute-command-keys "‘"))
(help-insert-xref-button (symbol-name generic) 'help-function generic)
- (insert "’")
+ (insert (substitute-command-keys "’"))
(pcase-dolist (`(,qualifiers ,args ,doc)
(eieio-method-documentation generic class))
(insert (format " %s%S\n" qualifiers args)
@@ -245,11 +245,11 @@ are not abstract."
(setq location
(find-lisp-object-file-name ctr def)))
(when location
- (insert " in ‘")
+ (insert (substitute-command-keys " in ‘"))
(help-insert-xref-button
(help-fns-short-filename location)
'eieio-class-def ctr location 'eieio-defclass)
- (insert "’"))
+ (insert (substitute-command-keys "’")))
(insert ".\nCreates an object of class " (symbol-name ctr) ".")
(goto-char (point-max))
(if (autoloadp def)
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index ab01a109b7a..72a23cfdfc6 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -403,8 +403,8 @@
;; Words inside \\[] tend to be for `substitute-command-keys'.
("\\\\\\\\\\[\\(\\(?:\\sw\\|\\s_\\)+\\)\\]"
(1 font-lock-constant-face prepend))
- ;; Words inside ‘’ and `' tend to be symbol names.
- ("[`‘]\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)['’]"
+ ;; Words inside ‘’ and '' and `' tend to be symbol names.
+ ("['`‘]\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)['’]"
(1 font-lock-constant-face prepend))
;; Constant values.
("\\_<:\\(?:\\sw\\|\\s_\\)+\\_>" 0 font-lock-builtin-face)
@@ -452,8 +452,8 @@
;; Erroneous structures.
(,(concat "(" cl-errs-re "\\_>")
(1 font-lock-warning-face))
- ;; Words inside ‘’ and `' tend to be symbol names.
- ("[`‘]\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)['’]"
+ ;; Words inside ‘’ and '' and `' tend to be symbol names.
+ ("['`‘]\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)['’]"
(1 font-lock-constant-face prepend))
;; Constant values.
("\\_<:\\(?:\\sw\\|\\s_\\)+\\_>" 0 font-lock-builtin-face)
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 074d3e8dda3..62900e08360 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2173,17 +2173,18 @@ will be deleted."
"Installed"
(capitalize status)) ;FIXME: Why comment-face?
'font-lock-face 'font-lock-comment-face))
- (insert " in ‘")
+ (insert (substitute-command-keys " in ‘"))
;; Todo: Add button for uninstalling.
(help-insert-xref-button (abbreviate-file-name
(file-name-as-directory pkg-dir))
'help-package-def pkg-dir)
(if (and (package-built-in-p name)
(not (package-built-in-p name version)))
- (insert "’,\n shadowing a "
+ (insert (substitute-command-keys
+ "’,\n shadowing a ")
(propertize "built-in package"
'font-lock-face 'font-lock-builtin-face))
- (insert "’"))
+ (insert (substitute-command-keys "’")))
(if signed
(insert ".")
(insert " (unsigned)."))
diff --git a/lisp/faces.el b/lisp/faces.el
index 4366c0b9f23..ac6486ee46c 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1428,10 +1428,12 @@ If FRAME is omitted or nil, use the selected frame."
(when alias
(setq face alias)
(insert
- (format "\n %s is an alias for the face ‘%s’.\n%s"
+ (format (substitute-command-keys
+ "\n %s is an alias for the face ‘%s’.\n%s")
f alias
(if (setq obsolete (get f 'obsolete-face))
- (format " This face is obsolete%s; use ‘%s’ instead.\n"
+ (format (substitute-command-keys
+ " This face is obsolete%s; use ‘%s’ instead.\n")
(if (stringp obsolete)
(format " since %s" obsolete)
"")
@@ -1449,12 +1451,13 @@ If FRAME is omitted or nil, use the selected frame."
(help-xref-button 1 'help-customize-face f)))
(setq file-name (find-lisp-object-file-name f 'defface))
(when file-name
- (princ "Defined in ‘")
+ (princ (substitute-command-keys "Defined in ‘"))
(princ (file-name-nondirectory file-name))
- (princ "’")
+ (princ (substitute-command-keys "’"))
;; Make a hyperlink to the library.
(save-excursion
- (re-search-backward "‘\\([^‘’]+\\)’" nil t)
+ (re-search-backward
+ (substitute-command-keys "‘\\([^‘’]+\\)’") nil t)
(help-xref-button 1 'help-face-def f file-name))
(princ ".")
(terpri)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 80f30e88fa4..9541d4797b4 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -306,7 +306,9 @@ suitable file is found, return nil."
(when remapped
(princ "Its keys are remapped to ")
(princ (if (symbolp remapped)
- (concat "‘" (symbol-name remapped) "’")
+ (concat (substitute-command-keys "‘")
+ (symbol-name remapped)
+ (substitute-command-keys "’"))
"an anonymous command"))
(princ ".\n"))
@@ -340,16 +342,18 @@ suitable file is found, return nil."
(insert "\nThis function has a compiler macro")
(if (symbolp handler)
(progn
- (insert (format " ‘%s’" handler))
+ (insert (format (substitute-command-keys " ‘%s’") handler))
(save-excursion
- (re-search-backward "‘\\([^‘’]+\\)’" nil t)
+ (re-search-backward (substitute-command-keys "‘\\([^‘’]+\\)’")
+ nil t)
(help-xref-button 1 'help-function handler)))
;; FIXME: Obsolete since 24.4.
(let ((lib (get function 'compiler-macro-file)))
(when (stringp lib)
- (insert (format " in ‘%s’" lib))
+ (insert (format (substitute-command-keys " in ‘%s’") lib))
(save-excursion
- (re-search-backward "‘\\([^‘’]+\\)’" nil t)
+ (re-search-backward (substitute-command-keys "‘\\([^‘’]+\\)’")
+ nil t)
(help-xref-button 1 'help-function-cmacro function lib)))))
(insert ".\n"))))
@@ -404,13 +408,13 @@ suitable file is found, return nil."
(get function
'derived-mode-parent))))
(when parent-mode
- (insert "\nParent mode: ‘")
+ (insert (substitute-command-keys "\nParent mode: ‘"))
(let ((beg (point)))
(insert (format "%s" parent-mode))
(make-text-button beg (point)
'type 'help-function
'help-args (list parent-mode)))
- (insert "’.\n"))))
+ (insert (substitute-command-keys "’.\n")))))
(defun help-fns--obsolete (function)
;; Ignore lambda constructs, keyboard macros, etc.
@@ -426,7 +430,9 @@ suitable file is found, return nil."
(when (nth 2 obsolete)
(insert (format " since %s" (nth 2 obsolete))))
(insert (cond ((stringp use) (concat ";\n" use))
- (use (format ";\nuse ‘%s’ instead." use))
+ (use (format (substitute-command-keys
+ ";\nuse ‘%s’ instead.")
+ use))
(t "."))
"\n"))))
@@ -462,7 +468,8 @@ FILE is the file where FUNCTION was probably defined."
(format ";\nin Lisp code %s" interactive-only))
((and (symbolp 'interactive-only)
(not (eq interactive-only t)))
- (format ";\nin Lisp code use ‘%s’ instead."
+ (format (substitute-command-keys
+ ";\nin Lisp code use ‘%s’ instead.")
interactive-only))
(t "."))
"\n")))))
@@ -531,7 +538,8 @@ FILE is the file where FUNCTION was probably defined."
;; Aliases are Lisp functions, so we need to check
;; aliases before functions.
(aliased
- (format "an alias for ‘%s’" real-def))
+ (format (substitute-command-keys "an alias for ‘%s’")
+ real-def))
((autoloadp def)
(format "%s autoloaded %s"
(if (commandp def) "an interactive" "an")
@@ -565,21 +573,24 @@ FILE is the file where FUNCTION was probably defined."
(with-current-buffer standard-output
(save-excursion
(save-match-data
- (when (re-search-backward "alias for ‘\\([^‘’]+\\)’" nil t)
+ (when (re-search-backward (substitute-command-keys
+ "alias for ‘\\([^‘’]+\\)’")
+ nil t)
(help-xref-button 1 'help-function real-def)))))
(when file-name
- (princ " in ‘")
+ (princ (substitute-command-keys " in ‘"))
;; We used to add .el to the file name,
;; but that's completely wrong when the user used load-file.
(princ (if (eq file-name 'C-source)
"C source code"
(help-fns-short-filename file-name)))
- (princ "’")
+ (princ (substitute-command-keys "’"))
;; Make a hyperlink to the library.
(with-current-buffer standard-output
(save-excursion
- (re-search-backward "‘\\([^‘’]+\\)’" nil t)
+ (re-search-backward (substitute-command-keys "‘\\([^‘’]+\\)’")
+ nil t)
(help-xref-button 1 'help-function-def function file-name))))
(princ ".")
(with-current-buffer (help-buffer)
@@ -712,14 +723,17 @@ it is displayed along with the global value."
(if file-name
(progn
- (princ " is a variable defined in ‘")
+ (princ (substitute-command-keys
+ " is a variable defined in ‘"))
(princ (if (eq file-name 'C-source)
"C source code"
(file-name-nondirectory file-name)))
- (princ "’.\n")
+ (princ (substitute-command-keys "’.\n"))
(with-current-buffer standard-output
(save-excursion
- (re-search-backward "‘\\([^‘’]+\\)’" nil t)
+ (re-search-backward (substitute-command-keys
+ "‘\\([^‘’]+\\)’")
+ nil t)
(help-xref-button 1 'help-variable-def
variable file-name)))
(if valvoid
@@ -849,7 +863,8 @@ if it is given a local binding.\n")))
;; Mention if it's an alias.
(unless (eq alias variable)
(setq extra-line t)
- (princ (format " This variable is an alias for ‘%s’.\n"
+ (princ (format (substitute-command-keys
+ " This variable is an alias for ‘%s’.\n")
alias)))
(when obsolete
@@ -858,7 +873,8 @@ if it is given a local binding.\n")))
(if (nth 2 obsolete)
(princ (format " since %s" (nth 2 obsolete))))
(princ (cond ((stringp use) (concat ";\n " use))
- (use (format ";\n use ‘%s’ instead."
+ (use (format (substitute-command-keys
+ ";\n use ‘%s’ instead.")
(car obsolete)))
(t ".")))
(terpri))
@@ -889,14 +905,15 @@ if it is given a local binding.\n")))
;; Otherwise, assume it was set directly.
(setq file (car file)
dir-file nil)))
- (princ (if dir-file
- "by the file\n ‘"
- "for the directory\n ‘"))
+ (princ (substitute-command-keys
+ (if dir-file
+ "by the file\n ‘"
+ "for the directory\n ‘")))
(with-current-buffer standard-output
(insert-text-button
file 'type 'help-dir-local-var-def
'help-args (list variable file)))
- (princ "’.\n")))
+ (princ (substitute-command-keys "’.\n"))))
(princ " This variable's value is file-local.\n")))
(when (memq variable ignored-local-variables)
@@ -910,8 +927,9 @@ variable.\n"))
(princ " This variable may be risky if used as a \
file-local variable.\n")
(when (assq variable safe-local-variable-values)
- (princ " However, you have added it to \
-‘safe-local-variable-values’.\n")))
+ (princ (substitute-command-keys
+ " However, you have added it to \
+‘safe-local-variable-values’.\n"))))
(when safe-var
(setq extra-line t)
@@ -919,7 +937,8 @@ file-local variable.\n")
(princ "if its value\n satisfies the predicate ")
(princ (if (byte-code-function-p safe-var)
"which is a byte-compiled expression.\n"
- (format "‘%s’.\n" safe-var))))
+ (format (substitute-command-keys "‘%s’.\n")
+ safe-var))))
(if extra-line (terpri))
(princ "Documentation:\n")
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 3fc0ad2b403..6454eed27bd 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -322,7 +322,7 @@ Commands:
"\\(source \\(?:code \\)?\\(?:of\\|for\\)\\)\\)"
"[ \t\n]+\\)?"
;; Note starting with word-syntax character:
- "[`‘]\\(\\sw\\(\\sw\\|\\s_\\)+\\)['’]"))
+ "['`‘]\\(\\sw\\(\\sw\\|\\s_\\)+\\)['’]"))
"Regexp matching doc string references to symbols.
The words preceding the quoted symbol can be used in doc strings to
@@ -338,11 +338,11 @@ when help commands related to multilingual environment (e.g.,
(defconst help-xref-info-regexp
(purecopy
- "\\<[Ii]nfo[ \t\n]+\\(node\\|anchor\\)[ \t\n]+[`‘]\\([^'’]+\\)['’]")
+ "\\<[Ii]nfo[ \t\n]+\\(node\\|anchor\\)[ \t\n]+['`‘]\\([^'’]+\\)['’]")
"Regexp matching doc string references to an Info node.")
(defconst help-xref-url-regexp
- (purecopy "\\<[Uu][Rr][Ll][ \t\n]+[`‘]\\([^'’]+\\)['’]")
+ (purecopy "\\<[Uu][Rr][Ll][ \t\n]+['`‘]\\([^'’]+\\)['’]")
"Regexp matching doc string references to a URL.")
;;;###autoload
diff --git a/lisp/help.el b/lisp/help.el
index 2bf53c09b05..7a3460c1b3d 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -964,12 +964,14 @@ documentation for the major and minor modes of that buffer."
(let* ((mode major-mode)
(file-name (find-lisp-object-file-name mode nil)))
(when file-name
- (princ (concat " defined in ‘" (file-name-nondirectory file-name)
- "’"))
+ (princ (concat (substitute-command-keys " defined in ‘")
+ (file-name-nondirectory file-name)
+ (substitute-command-keys "’")))
;; Make a hyperlink to the library.
(with-current-buffer standard-output
(save-excursion
- (re-search-backward "‘\\([^‘’]+\\)’" nil t)
+ (re-search-backward (substitute-command-keys "‘\\([^‘’]+\\)’")
+ nil t)
(help-xref-button 1 'help-function-def mode file-name)))))
(princ ":\n")
(princ (documentation major-mode)))))
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index e56fcebfc26..16c1003960a 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -177,7 +177,7 @@
"\\(charset\\)"
"\\)\\s-+\\)?"
;; Note starting with word-syntax character:
- "[`‘]\\(\\sw\\(\\sw\\|\\s_\\)+\\)['’]")))
+ "['`‘]\\(\\sw\\(\\sw\\|\\s_\\)+\\)['’]")))
(defun coding-system-change-eol-conversion (coding-system eol-type)
"Return a coding system which differs from CODING-SYSTEM in EOL conversion.
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 295e2aada2a..f7d8964c9fc 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -2863,7 +2863,7 @@ The following properties have special meanings for this widget:
:type 'boolean
:group 'widget-documentation)
-(defcustom widget-documentation-link-regexp "[`‘]\\([^\n `'‘’]+\\)['’]"
+(defcustom widget-documentation-link-regexp "['`‘]\\([^\n `'‘’]+\\)['’]"
"Regexp for matching potential links in documentation strings.
The first group should be the link itself."
:type 'regexp