@anchor{Docstring hyperlinks}
@item
When a documentation string refers to a Lisp symbol, write it as it
-would be printed (which usually means in lower case), with a grave
-accent @samp{`} before and apostrophe @samp{'} after it. There are
+would be printed (which usually means in lower case), surrounding
+it with curved single quotes (@samp{‘} and @samp{’}). There are
two exceptions: write @code{t} and @code{nil} without surrounding
-punctuation. For example: @samp{CODE can be `lambda', nil, or t.}
-(In this manual, we use a different convention, with single-quotes
-around symbols.)
+punctuation. For example: @samp{CODE can be ‘lambda’, nil, or t.}
+
+Documentation strings can also use an older single-quoting convention,
+which quotes symbols with grave accent @samp{`} and apostrophe
+@samp{'}: @samp{`like-this'} rather than @samp{‘like-this’}. This
+older convention was designed for now-obsolete displays in which grave
+accent and apostrophe were mirror images. Documentation in this older
+convention is converted to the standard convention when it is copied
+into a help buffer. @xref{Keys in Documentation}.
@cindex hyperlinks in documentation strings
Help mode automatically creates a hyperlink when a documentation string
-uses a symbol name between grave accent and apostrophe, if the symbol
-has either a
+uses a single-quoted symbol name, if the symbol has either a
function or a variable definition. You do not need to do anything
special to make use of this feature. However, when a symbol has both a
function definition and a variable definition, and you want to refer to
recognizing these indicator words.) For example, if you write
@example
-This function sets the variable `buffer-file-name'.
+This function sets the variable ‘buffer-file-name’.
@end example
@noindent
symbol name to prevent making any hyperlink. For example,
@example
-If the argument KIND-OF-RESULT is the symbol `list',
+If the argument KIND-OF-RESULT is the symbol ‘list’,
this function returns a list of all the objects
that satisfy the criterion.
@end example
documentation will be shown, even if the symbol is also defined as a
variable or as a function.
-To make a hyperlink to Info documentation, write the name of the Info
-node (or anchor) between grave accent and apostrophe, preceded by
+To make a hyperlink to Info documentation, write the single-quoted
+name of the Info node (or anchor), preceded by
@samp{info node}, @samp{Info node}, @samp{info anchor} or @samp{Info
anchor}. The Info file name defaults to @samp{emacs}. For example,
@smallexample
-See Info node `Font Lock' and Info node `(elisp)Font Lock Basics'.
+See Info node ‘Font Lock’ and Info node ‘(elisp)Font Lock Basics’.
@end smallexample
-Finally, to create a hyperlink to URLs, write the URL between grave
-accent and apostrophe, preceded by @samp{URL}. For example,
+Finally, to create a hyperlink to URLs, write the single-quoted URL,
+preceded by @samp{URL}. For example,
@smallexample
The home page for the GNU project has more information (see URL
-`http://www.gnu.org/').
+‘http://www.gnu.org/’).
@end smallexample
@item
*** New macros `thread-first' and `thread-last' allow threading a form
as the first or last argument of subsequent forms.
+** Documentation strings now support quoting with curved single quotes
+‘like-this’ in addition to the old style with grave accent and
+apostrophe `like-this'. The new style looks better on today's displays.
+When an old-style string is copied to a help buffer it is converted to
+the new style.
+
+++
** Time-related changes:
(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)
(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 "\n ‘%s’ value is\n " symbol))
(if (and value (symbolp value))
- (princ (format "`%s'" value))
+ (princ (format "‘%s’" value))
(let ((pt (point)))
(pp value)
(save-excursion
)
((symbolp buffer-or-mode)
(setq mode buffer-or-mode)
- (princ (format "`%s'\n" buffer-or-mode))
+ (princ (format "‘%s’\n" buffer-or-mode))
)
((signal 'wrong-type-argument
(list 'buffer-or-mode buffer-or-mode))))
(while mode
(setq table (get mode 'mode-local-symbol-table))
(when table
- (princ (format "\n- From `%s'\n" mode))
+ (princ (format "\n- From ‘%s’\n" mode))
(mode-local-print-bindings table))
(setq mode (get-mode-local-parent mode)))))
[ stuff ] => @code{[ stuff ]}
Key => @kbd{Key} (key is C\\-h, M\\-h, SPC, RET, TAB and the like)
... => @dots{}"
- (while (string-match "`\\([-a-zA-Z0-9<>.]+\\)'" string)
+ (while (string-match "[`‘]\\([-a-zA-Z0-9<>.]+\\)['’]" string)
(let* ((vs (substring string (match-beginning 1) (match-end 1)))
(v (intern-soft vs)))
(setq string
'("" "c")))
doc)
(when fn
- (princ " in `")
+ (princ " in ‘")
(help-insert-xref-button (file-name-nondirectory fn)
'help-theme-def fn)
- (princ "'"))
+ (princ "’"))
(princ ".\n")
(if (custom-theme-p theme)
(progn
(setq doc (nth 2 sexp)))))))
(princ "\n\nDocumentation:\n")
(princ (if (stringp doc)
- doc
+ (substitute-command-keys doc)
"No documentation available.")))
(princ "\n\nYou can ")
(help-insert-xref-button "customize" 'help-theme-edit theme)
;; Buttons
(when (and button (not (widgetp wid-button)))
(newline)
- (insert "Here is a `" (format "%S" button-type)
- "' button labeled `" button-label "'.\n\n"))
+ (insert "Here is a ‘" (format "%S" button-type)
+ "’ button labeled ‘" button-label "’.\n\n"))
;; Overlays
(when overlays
(newline)
(when face
(insert (propertize " " 'display '(space :align-to 5))
"face: ")
- (insert (concat "`" (symbol-name face) "'"))
+ (insert (concat "‘" (symbol-name face) "’"))
(insert "\n")))))
(insert "these terminal codes:\n")
(dotimes (i (length disp-vector))
;; Instead, use the `\\[...]' construct to stand for them.
(save-excursion
(let ((f nil) (m nil) (start (point))
- (re "[^`A-Za-z0-9_]\\([CMA]-[a-zA-Z]\\|\\(\\([CMA]-\\)?\
+ (re "[^`‘A-Za-z0-9_]\\([CMA]-[a-zA-Z]\\|\\(\\([CMA]-\\)?\
mouse-[0-3]\\)\\)\\>"))
;; Find the first key sequence not in a sample
(while (and (not f) (setq m (re-search-forward re e t)))
(save-excursion
(let ((case-fold-search t)
(ret nil) mb me)
- (while (and (re-search-forward "`\\(\\sw\\(\\sw\\|\\s_\\)+\\)'" e t)
+ (while (and (re-search-forward
+ "[`‘]\\(\\sw\\(\\sw\\|\\s_\\)+\\)['’]" e t)
(not ret))
(let* ((ms1 (match-string 1))
(sym (intern-soft ms1)))
)))
;;* When a documentation string refers to a Lisp symbol, write it as
;; it would be printed (which usually means in lower case), with
- ;; single-quotes around it. For example: `lambda'. There are two
- ;; exceptions: write t and nil without single-quotes. (In this
- ;; manual, we normally do use single-quotes for those symbols.)
+ ;; single-quotes around it. For example: ‘lambda’. There are two
+ ;; exceptions: write t and nil without single-quotes. (For
+ ;; compatibility with an older Emacs style, quoting with ` and '
+ ;; also works, e.g., `lambda' is treated like ‘lambda’.)
(save-excursion
(let ((found nil) (start (point)) (msg nil) (ms nil))
(while (and (not msg)
(re-search-forward
;; Ignore manual page references like
;; git-config(1).
- "[^-([`':a-zA-Z]\\(\\w+[:-]\\(\\w\\|\\s_\\)+\\)[^](']"
+ "[^-([`'‘’:a-zA-Z]\\(\\w+[:-]\\(\\w\\|\\s_\\)+\\)[^]('’]"
e t))
(setq ms (match-string 1))
;; A . is a \s_ char, so we must remove periods from
(if (checkdoc-autofix-ask-replace
(match-beginning 1) (+ (match-beginning 1)
(length ms))
- msg (concat "`" ms "'") t)
+ msg (concat "‘" ms "’") t)
(setq msg nil)
(setq msg
(format "Lisp symbol `%s' should appear in quotes"
nil)))
;; t and nil case
(save-excursion
- (if (re-search-forward "\\(`\\(t\\|nil\\)'\\)" e t)
+ (if (re-search-forward "\\([`‘]\\(t\\|nil\\)['’]\\)" e t)
(if (checkdoc-autofix-ask-replace
(match-beginning 1) (match-end 1)
(format "%s should not appear in quotes. Remove? "
(if (and (not (save-excursion
(goto-char b)
(forward-char -1)
- (looking-at "`\\|\"\\|\\.\\|\\\\")))
+ (looking-at "[`\".‘]\\|\\\\")))
;; surrounded by /, as in a URL or filename: /emacs/
(not (and (= ?/ (char-after e))
(= ?/ (char-before b))))
(cl--generic-method-specializers method)))
(file (find-lisp-object-file-name met-name 'cl-defmethod)))
(when file
- (insert " in `")
+ (insert " in ‘")
(help-insert-xref-button (help-fns-short-filename file)
'help-function-def met-name file
'cl-defmethod)
- (insert "'.\n")))
+ (insert "’.\n")))
(insert "\n" (or (nth 2 info) "Undocumented") "\n\n")))))))
;;; Support for (head <val>) specializers.
" class")
(let ((location (find-lisp-object-file-name class 'eieio-defclass)))
(when location
- (insert " in `")
+ (insert " in ‘")
(help-insert-xref-button
(help-fns-short-filename location)
'eieio-class-def class location 'eieio-defclass)
- (insert "'")))
+ (insert "’")))
(insert ".\n")
;; Parents
(let ((pl (eieio-class-parents class))
(insert " Inherits from ")
(while (setq cur (pop pl))
(setq cur (eieio--class-name cur))
- (insert "`")
+ (insert "‘")
(help-insert-xref-button (symbol-name cur)
'help-function cur)
- (insert (if pl "', " "'")))
+ (insert (if pl "’, " "’")))
(insert ".\n")))
;; Children
(let ((ch (eieio-class-children class))
(when ch
(insert " Children ")
(while (setq cur (pop ch))
- (insert "`")
+ (insert "‘")
(help-insert-xref-button (symbol-name cur)
'help-function cur)
- (insert (if ch "', " "'")))
+ (insert (if ch "’, " "’")))
(insert ".\n")))
;; System documentation
(let ((doc (documentation-property class 'variable-documentation)))
(when generics
(insert (propertize "Specialized Methods:\n\n" 'face 'bold))
(dolist (generic generics)
- (insert "`")
+ (insert "‘")
(help-insert-xref-button (symbol-name generic) 'help-function generic)
- (insert "'")
+ (insert "’")
(pcase-dolist (`(,qualifiers ,args ,doc)
(eieio-method-documentation generic class))
(insert (format " %s%S\n" qualifiers args)
(setq location
(find-lisp-object-file-name ctr def)))
(when location
- (insert " in `")
+ (insert " in ‘")
(help-insert-xref-button
(help-fns-short-filename location)
'eieio-class-def ctr location 'eieio-defclass)
- (insert "'"))
+ (insert "’"))
(insert ".\nCreates an object of class " (symbol-name ctr) ".")
(goto-char (point-max))
(if (autoloadp def)
;; Words inside \\[] tend to be for `substitute-command-keys'.
("\\\\\\\\\\[\\(\\(?:\\sw\\|\\s_\\)+\\)\\]"
(1 font-lock-constant-face prepend))
- ;; Words inside `' tend to be symbol names.
- ("`\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)'"
+ ;; Words inside ‘’ 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)
;; Erroneous structures.
(,(concat "(" cl-errs-re "\\_>")
(1 font-lock-warning-face))
- ;; Words inside `' tend to be symbol names.
- ("`\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)'"
+ ;; Words inside ‘’ 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)
"Installed"
(capitalize status)) ;FIXME: Why comment-face?
'font-lock-face 'font-lock-comment-face))
- (insert " in `")
+ (insert " 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 "’,\n shadowing a "
(propertize "built-in package"
'font-lock-face 'font-lock-builtin-face))
- (insert "'"))
+ (insert "’"))
(if signed
(insert ".")
(insert " (unsigned)."))
(when alias
(setq face alias)
(insert
- (format "\n %s is an alias for the face `%s'.\n%s"
+ (format "\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 " This face is obsolete%s; use ‘%s’ instead.\n"
(if (stringp obsolete)
(format " since %s" obsolete)
"")
alias)
""))))
(insert "\nDocumentation:\n"
- (or (face-documentation face)
- "Not documented as a face.")
+ (substitute-command-keys
+ (or (face-documentation face)
+ "Not documented as a face."))
"\n\n"))
(with-current-buffer standard-output
(save-excursion
(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 "Defined in ‘")
(princ (file-name-nondirectory file-name))
- (princ "'")
+ (princ "’")
;; Make a hyperlink to the library.
(save-excursion
- (re-search-backward "`\\([^`']+\\)'" nil t)
+ (re-search-backward "‘\\([^‘’]+\\)’" nil t)
(help-xref-button 1 'help-face-def f file-name))
(princ ".")
(terpri)
"Syntax table used while in `finder-mode'.")
(defvar finder-font-lock-keywords
- '(("`\\([^'`]+\\)'" 1 font-lock-constant-face prepend))
+ '(("[`‘]\\([^'`‘’]+\\)['’]" 1 font-lock-constant-face prepend))
"Font-lock keywords for Finder mode.")
(defvar finder-headmark nil
("/\\([a-z][-a-z0-9]+\\.el\\)\\>[^.?]"
;; Exclude [.?] for URLs in gmane.emacs.cvs
1 (>= gnus-button-emacs-level 8) gnus-button-handle-library 1)
- ("`\\([a-z][-a-z0-9]+\\.el\\)'"
+ ("[`‘]\\([a-z][-a-z0-9]+\\.el\\)['’]"
1 (>= gnus-button-emacs-level 8) gnus-button-handle-library 1)
- ("`\\([a-z][a-z0-9]+-[a-z0-9]+-[-a-z0-9]*[a-z]\\|\\(gnus\\|message\\)-[-a-z]+\\)'"
+ ("[`‘]\\([a-z][a-z0-9]+-[a-z0-9]+-[-a-z0-9]*[a-z]\\|\\(gnus\\|message\\)-[-a-z]+\\)['’]"
0 (>= gnus-button-emacs-level 8) gnus-button-handle-symbol 1)
- ("`\\([a-z][a-z0-9]+-[a-z]+\\)'"
+ ("[`‘]\\([a-z][a-z0-9]+-[a-z]+\\)['’]"
0 (>= gnus-button-emacs-level 9) gnus-button-handle-symbol 1)
("(setq[ \t\n]+\\([a-z][a-z0-9]+-[-a-z0-9]+\\)[ \t\n]+.+)"
1 (>= gnus-button-emacs-level 7) gnus-button-handle-describe-variable 1)
0 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-function 2)
("\\b\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+v[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET\\>"
0 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-variable 2)
- ("`\\(\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+k[ \t\n]+\\([^']+\\)\\)'"
+ ("[`‘]\\(\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+k[ \t\n]+\\([^'’]+\\)\\)['’]"
;; Unlike the other regexps we really have to require quoting
;; here to determine where it ends.
1 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-key 3)
"\\)"
"\\(?:es\\|s\\|th\\)?" ; for ARGth, ARGs
"\\(?:-[a-z0-9-]+\\)?" ; for ARG-xxx, ARG-n
- "\\(?:-[{([<`\"].*?\\)?"; for ARG-{x}, (x), <x>, [x], `x'
+ "\\(?:-[{([<`\"‘].*?\\)?"; for ARG-{x}, (x), <x>, [x], `x', ‘x’
"\\>") ; end of word
(help-highlight-arg arg)
doc t t 1)))
(when remapped
(princ "Its keys are remapped to ")
(princ (if (symbolp remapped)
- (concat "`" (symbol-name remapped) "'")
+ (concat "‘" (symbol-name remapped) "’")
"an anonymous command"))
(princ ".\n"))
(insert "\nThis function has a compiler macro")
(if (symbolp handler)
(progn
- (insert (format " `%s'" handler))
+ (insert (format " ‘%s’" handler))
(save-excursion
- (re-search-backward "`\\([^`']+\\)'" nil t)
+ (re-search-backward "‘\\([^‘’]+\\)’" 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 " in ‘%s’" lib))
(save-excursion
- (re-search-backward "`\\([^`']+\\)'" nil t)
+ (re-search-backward "‘\\([^‘’]+\\)’" nil t)
(help-xref-button 1 'help-function-cmacro function lib)))))
(insert ".\n"))))
(get function
'derived-mode-parent))))
(when parent-mode
- (insert "\nParent mode: `")
+ (insert "\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 "’.\n"))))
(defun help-fns--obsolete (function)
;; Ignore lambda constructs, keyboard macros, etc.
(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 ";\nuse ‘%s’ instead." use))
(t "."))
"\n"))))
(format ";\nin Lisp code %s" interactive-only))
((and (symbolp 'interactive-only)
(not (eq interactive-only t)))
- (format ";\nin Lisp code use `%s' instead."
+ (format ";\nin Lisp code use ‘%s’ instead."
interactive-only))
(t "."))
"\n")))))
;; Aliases are Lisp functions, so we need to check
;; aliases before functions.
(aliased
- (format "an alias for `%s'" real-def))
+ (format "an alias for ‘%s’" real-def))
((autoloadp def)
(format "%s autoloaded %s"
(if (commandp def) "an interactive" "an")
(with-current-buffer standard-output
(save-excursion
(save-match-data
- (when (re-search-backward "alias for `\\([^`']+\\)'" nil t)
+ (when (re-search-backward "alias for ‘\\([^‘’]+\\)’" nil t)
(help-xref-button 1 'help-function real-def)))))
(when file-name
- (princ " in `")
+ (princ " 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 "’")
;; Make a hyperlink to the library.
(with-current-buffer standard-output
(save-excursion
- (re-search-backward "`\\([^`']+\\)'" nil t)
+ (re-search-backward "‘\\([^‘’]+\\)’" nil t)
(help-xref-button 1 'help-function-def function file-name))))
(princ ".")
(with-current-buffer (help-buffer)
(if file-name
(progn
- (princ " is a variable defined in `")
+ (princ " is a variable defined in ‘")
(princ (if (eq file-name 'C-source)
"C source code"
(file-name-nondirectory file-name)))
- (princ "'.\n")
+ (princ "’.\n")
(with-current-buffer standard-output
(save-excursion
- (re-search-backward "`\\([^`']+\\)'" nil t)
+ (re-search-backward "‘\\([^‘’]+\\)’" nil t)
(help-xref-button 1 'help-variable-def
variable file-name)))
(if valvoid
;; Mention if it's an alias.
(unless (eq alias variable)
(setq extra-line t)
- (princ (format " This variable is an alias for `%s'.\n" alias)))
+ (princ (format " This variable is an alias for ‘%s’.\n"
+ alias)))
(when obsolete
(setq extra-line t)
(if (nth 2 obsolete)
(princ (format " since %s" (nth 2 obsolete))))
(princ (cond ((stringp use) (concat ";\n " use))
- (use (format ";\n use `%s' instead." (car obsolete)))
+ (use (format ";\n use ‘%s’ instead."
+ (car obsolete)))
(t ".")))
(terpri))
(setq file (car file)
dir-file nil)))
(princ (if dir-file
- "by the file\n `"
- "for the directory\n `"))
+ "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 "’.\n")))
(princ " This variable's value is file-local.\n")))
(when (memq variable ignored-local-variables)
file-local variable.\n")
(when (assq variable safe-local-variable-values)
(princ " However, you have added it to \
-`safe-local-variable-values'.\n")))
+‘safe-local-variable-values’.\n")))
(when safe-var
(setq extra-line t)
(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 "‘%s’.\n" safe-var))))
(if extra-line (terpri))
(princ "Documentation:\n")
"\\(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
(defconst help-xref-info-regexp
- (purecopy "\\<[Ii]nfo[ \t\n]+\\(node\\|anchor\\)[ \t\n]+`\\([^']+\\)'")
+ (purecopy
+ "\\<[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
(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 " defined in ‘" (file-name-nondirectory file-name)
+ "’"))
;; Make a hyperlink to the library.
(with-current-buffer standard-output
(save-excursion
- (re-search-backward "`\\([^`']+\\)'" nil t)
+ (re-search-backward "‘\\([^‘’]+\\)’" nil t)
(help-xref-button 1 'help-function-def mode file-name)))))
(princ ":\n")
(princ (documentation major-mode)))))
"\\(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.
(with-output-to-temp-buffer (help-buffer)
(let ((elt (assoc input-method input-method-alist)))
(princ (format
- "Input method: %s (`%s' in mode line) for %s\n %s\n"
+ "Input method: %s (‘%s’ in mode line) for %s\n %s\n"
input-method (nth 3 elt) (nth 1 elt) (nth 4 elt))))))))))
(defun describe-current-input-method ()
(search-backward (symbol-name (car l)))
(help-xref-button 0 'help-coding-system (car l))
(goto-char (point-max))
- (insert " (`"
+ (insert " (‘"
(coding-system-mnemonic (car l))
- "' in mode line):\n\t"
- (coding-system-doc-string (car l))
+ "’ in mode line):\n\t"
+ (substitute-command-keys
+ (coding-system-doc-string (car l)))
"\n")
(let ((aliases (coding-system-aliases (car l))))
(when aliases
(let ((char (charset-iso-final-char charset)))
(when (> char 0)
(insert "Final char of ISO2022 designation sequence: ")
- (insert (format "`%c'\n" char))))
+ (insert (format "‘%c’\n" char))))
(let (aliases)
(dolist (c charset-list)
(if (and (not (eq c charset))
(if (string-match "\n" doc)
(setq doc (substring doc 0 (match-beginning 0))))
(setq doc (concat " " doc)))
- (princ (format "%s\n" doc))))))
+ (princ (format "%s\n" (substitute-command-keys doc)))))))
;;;###autoload
(defun describe-current-coding-system ()
(save-excursion
(goto-char (point-min))
(while (re-search-forward
- "^ \\([^ ]+\\) (`.*' in mode line)$" nil t)
+ "^ \\([^ ]+\\) (‘.*’ in mode line)$" nil t)
(help-xref-button 1 'help-input-method (match-string 1)))))))
(defun list-input-methods-1 ()
(princ "
No input method is available, perhaps because you have not
installed LEIM (Libraries of Emacs Input Methods).")
- (princ "LANGUAGE\n NAME (`TITLE' in mode line)\n")
+ (princ "LANGUAGE\n NAME (‘TITLE’ in mode line)\n")
(princ " SHORT-DESCRIPTION\n------------------------------\n")
(setq input-method-alist
(sort input-method-alist
(setq language (nth 1 elt))
(princ language)
(terpri))
- (princ (format " %s (`%s' in mode line)\n %s\n"
+ (princ (format " %s (‘%s’ in mode line)\n %s\n"
(car elt)
(let ((title (nth 3 elt)))
(if (and (consp title) (stringp (car title)))
title))
;; If the doc is multi-line, indent all
;; non-blank lines. (Bug#8066)
- (replace-regexp-in-string "\n\\(.\\)" "\n \\1"
- (or (nth 4 elt) ""))))))))
+ (replace-regexp-in-string
+ "\n\\(.\\)" "\n \\1"
+ (substitute-command-keys (or (nth 4 elt) "")))))))))
\f
;;; DIAGNOSIS
(lisp-mode-variables nil nil 'elisp)
(add-hook 'after-load-functions #'elisp--font-lock-flush-elisp-buffers)
(setq-local electric-pair-text-pairs
- (cons '(?\` . ?\') electric-pair-text-pairs))
+ (append '((?\` . ?\') (?‘ . ?’)) electric-pair-text-pairs))
(setq imenu-case-fold-search nil)
(add-function :before-until (local 'eldoc-documentation-function)
#'elisp-eldoc-documentation-function)
((or (eq (char-after) ?\[)
(progn
(skip-chars-backward " ")
- (memq (char-before) '(?' ?`))))
+ (memq (char-before) '(?' ?` ?‘))))
(setq res t))
((eq (char-before) ?,)
(setq nesting nil))))
(beg (condition-case nil
(save-excursion
(backward-sexp 1)
- (skip-syntax-forward "'")
+ (skip-chars-forward "`',‘")
(point))
(scan-error pos)))
(end
(save-excursion
(goto-char beg)
(forward-sexp 1)
- (skip-chars-backward "'")
+ (skip-chars-backward "'’")
(when (>= (point) pos)
(point)))
(scan-error pos))))
(funpos (eq (char-before beg) ?\())
(quoted (elisp--form-quoted-p beg)))
(when (and end (or (not (nth 8 (syntax-ppss)))
- (eq (char-before beg) ?`)))
+ (memq (char-before beg) '(?` ?‘))))
(let ((table-etc
(if (or (not funpos) quoted)
;; FIXME: We could look at the first element of the list and
(defun elisp--preceding-sexp ()
"Return sexp before the point."
(let ((opoint (point))
- ignore-quotes
+ (left-quote ?‘)
expr)
(save-excursion
(with-syntax-table emacs-lisp-mode-syntax-table
- ;; If this sexp appears to be enclosed in `...'
+ ;; If this sexp appears to be enclosed in `...' or ‘...’
;; then ignore the surrounding quotes.
- (setq ignore-quotes
- (or (eq (following-char) ?\')
- (eq (preceding-char) ?\')))
+ (cond ((eq (preceding-char) ?’)
+ (progn (forward-char -1) (setq opoint (point))))
+ ((or (eq (following-char) ?\')
+ (eq (preceding-char) ?\'))
+ (setq left-quote ?\`)))
(forward-sexp -1)
;; If we were after `?\e' (or similar case),
;; use the whole thing, not just the `e'.
(forward-sexp -1))))
(save-restriction
- (if (and ignore-quotes (eq (following-char) ?`))
+ (if (eq (following-char) left-quote)
;; vladimir@cs.ualberta.ca 30-Jul-1997: Skip ` in `variable' so
;; that the value is returned, not the name.
(forward-char))
: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