aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/faces.el
diff options
context:
space:
mode:
authorPaul Eggert2015-05-28 00:06:14 -0700
committerPaul Eggert2015-05-28 00:22:02 -0700
commit0fd5e6593af620863dcf90dff5d04631458e24cd (patch)
treeeba3529cdd544089f6661db3b3b09f0218aa1076 /lisp/faces.el
parent11b2744f48fc03f1511de1152ad49807557c6f85 (diff)
downloademacs-0fd5e6593af620863dcf90dff5d04631458e24cd.tar.gz
emacs-0fd5e6593af620863dcf90dff5d04631458e24cd.zip
Support curved quotes in doc strings
Emacs's traditional doc string style has been to quote symbols `like this'. This worked well on now-obsolete terminals where ` and ' were symmetric quotes, but nowadays curved quotes ‘like this’ look better. Support quoting the new way too. (Bug#20385) * doc/lispref/tips.texi (Documentation Tips): Symbols can be quoted ‘like-this’ as well as `like-this'. * etc/NEWS: Mention this. * lisp/cedet/mode-local.el (overload-docstring-extension) (mode-local-print-binding, mode-local-describe-bindings-2): * lisp/cus-theme.el (describe-theme-1): * lisp/descr-text.el (describe-text-properties-1, describe-char): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * 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): * lisp/international/mule-cmds.el (describe-input-method) (describe-language-environment): * lisp/international/mule-diag.el (describe-character-set) (print-coding-system-briefly, list-input-methods) (list-input-methods-1): Insert curved quotes rather than grave accent and apostrophe. * lisp/cedet/srecode/texi.el (srecode-texi-texify-docstring): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine) (checkdoc-proper-noun-region-engine): * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2) (lisp-cl-font-lock-keywords-2): * lisp/finder.el (finder-font-lock-keywords): * lisp/gnus/gnus-art.el (gnus-button-alist): * lisp/help-fns.el (help-do-arg-highlight) (describe-function-1, describe-variable): * lisp/help-mode.el (help-xref-symbol-regexp) (help-xref-info-regexp, help-xref-url-regexp): * lisp/help.el (describe-mode): * lisp/international/mule-cmds.el (help-xref-mule-regexp-template): * lisp/wid-edit.el (widget-documentation-link-regexp): Parse symbols quoted ‘like-this’ as well as `like-this'. * lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Add "‘" and "’" to electric-pair-text-pairs. (elisp--form-quoted-p): Also allow "‘" as a quoting char. (elisp-completion-at-point, elisp--preceding-sexp): Also treat "‘" and "’" as quoting chars.
Diffstat (limited to 'lisp/faces.el')
-rw-r--r--lisp/faces.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index f6b11074af0..4366c0b9f23 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1428,18 +1428,19 @@ If FRAME is omitted or nil, use the selected frame."
1428 (when alias 1428 (when alias
1429 (setq face alias) 1429 (setq face alias)
1430 (insert 1430 (insert
1431 (format "\n %s is an alias for the face `%s'.\n%s" 1431 (format "\n %s is an alias for the face %s.\n%s"
1432 f alias 1432 f alias
1433 (if (setq obsolete (get f 'obsolete-face)) 1433 (if (setq obsolete (get f 'obsolete-face))
1434 (format " This face is obsolete%s; use `%s' instead.\n" 1434 (format " This face is obsolete%s; use %s instead.\n"
1435 (if (stringp obsolete) 1435 (if (stringp obsolete)
1436 (format " since %s" obsolete) 1436 (format " since %s" obsolete)
1437 "") 1437 "")
1438 alias) 1438 alias)
1439 "")))) 1439 ""))))
1440 (insert "\nDocumentation:\n" 1440 (insert "\nDocumentation:\n"
1441 (or (face-documentation face) 1441 (substitute-command-keys
1442 "Not documented as a face.") 1442 (or (face-documentation face)
1443 "Not documented as a face."))
1443 "\n\n")) 1444 "\n\n"))
1444 (with-current-buffer standard-output 1445 (with-current-buffer standard-output
1445 (save-excursion 1446 (save-excursion
@@ -1448,12 +1449,12 @@ If FRAME is omitted or nil, use the selected frame."
1448 (help-xref-button 1 'help-customize-face f))) 1449 (help-xref-button 1 'help-customize-face f)))
1449 (setq file-name (find-lisp-object-file-name f 'defface)) 1450 (setq file-name (find-lisp-object-file-name f 'defface))
1450 (when file-name 1451 (when file-name
1451 (princ "Defined in `") 1452 (princ "Defined in ")
1452 (princ (file-name-nondirectory file-name)) 1453 (princ (file-name-nondirectory file-name))
1453 (princ "'") 1454 (princ "")
1454 ;; Make a hyperlink to the library. 1455 ;; Make a hyperlink to the library.
1455 (save-excursion 1456 (save-excursion
1456 (re-search-backward "`\\([^`']+\\)'" nil t) 1457 (re-search-backward "\\([^‘’]+\\)" nil t)
1457 (help-xref-button 1 'help-face-def f file-name)) 1458 (help-xref-button 1 'help-face-def f file-name))
1458 (princ ".") 1459 (princ ".")
1459 (terpri) 1460 (terpri)