aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorPaul Eggert2015-05-28 00:06:14 -0700
committerPaul Eggert2015-05-28 00:22:02 -0700
commit0fd5e6593af620863dcf90dff5d04631458e24cd (patch)
treeeba3529cdd544089f6661db3b3b09f0218aa1076 /doc
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 'doc')
-rw-r--r--doc/lispref/tips.texi35
1 files changed, 20 insertions, 15 deletions
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index cc1f0e42750..798b6700aac 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -658,17 +658,22 @@ starting double-quote is not part of the string!
658@anchor{Docstring hyperlinks} 658@anchor{Docstring hyperlinks}
659@item 659@item
660When a documentation string refers to a Lisp symbol, write it as it 660When a documentation string refers to a Lisp symbol, write it as it
661would be printed (which usually means in lower case), with a grave 661would be printed (which usually means in lower case), surrounding
662accent @samp{`} before and apostrophe @samp{'} after it. There are 662it with curved single quotes (@samp{} and @samp{}). There are
663two exceptions: write @code{t} and @code{nil} without surrounding 663two exceptions: write @code{t} and @code{nil} without surrounding
664punctuation. For example: @samp{CODE can be `lambda', nil, or t.} 664punctuation. For example: @samp{CODE can be ‘lambda’, nil, or t.}
665(In this manual, we use a different convention, with single-quotes 665
666around symbols.) 666Documentation strings can also use an older single-quoting convention,
667which quotes symbols with grave accent @samp{`} and apostrophe
668@samp{'}: @samp{`like-this'} rather than @samp{‘like-this’}. This
669older convention was designed for now-obsolete displays in which grave
670accent and apostrophe were mirror images. Documentation in this older
671convention is converted to the standard convention when it is copied
672into a help buffer. @xref{Keys in Documentation}.
667 673
668@cindex hyperlinks in documentation strings 674@cindex hyperlinks in documentation strings
669Help mode automatically creates a hyperlink when a documentation string 675Help mode automatically creates a hyperlink when a documentation string
670uses a symbol name between grave accent and apostrophe, if the symbol 676uses a single-quoted symbol name, if the symbol has either a
671has either a
672function or a variable definition. You do not need to do anything 677function or a variable definition. You do not need to do anything
673special to make use of this feature. However, when a symbol has both a 678special to make use of this feature. However, when a symbol has both a
674function definition and a variable definition, and you want to refer to 679function definition and a variable definition, and you want to refer to
@@ -678,7 +683,7 @@ immediately before the symbol name. (Case makes no difference in
678recognizing these indicator words.) For example, if you write 683recognizing these indicator words.) For example, if you write
679 684
680@example 685@example
681This function sets the variable `buffer-file-name'. 686This function sets the variable buffer-file-name.
682@end example 687@end example
683 688
684@noindent 689@noindent
@@ -691,7 +696,7 @@ you can write the words @samp{symbol} or @samp{program} before the
691symbol name to prevent making any hyperlink. For example, 696symbol name to prevent making any hyperlink. For example,
692 697
693@example 698@example
694If the argument KIND-OF-RESULT is the symbol `list', 699If the argument KIND-OF-RESULT is the symbol list,
695this function returns a list of all the objects 700this function returns a list of all the objects
696that satisfy the criterion. 701that satisfy the criterion.
697@end example 702@end example
@@ -710,21 +715,21 @@ followed by the word @samp{face}. In that case, only the face
710documentation will be shown, even if the symbol is also defined as a 715documentation will be shown, even if the symbol is also defined as a
711variable or as a function. 716variable or as a function.
712 717
713To make a hyperlink to Info documentation, write the name of the Info 718To make a hyperlink to Info documentation, write the single-quoted
714node (or anchor) between grave accent and apostrophe, preceded by 719name of the Info node (or anchor), preceded by
715@samp{info node}, @samp{Info node}, @samp{info anchor} or @samp{Info 720@samp{info node}, @samp{Info node}, @samp{info anchor} or @samp{Info
716anchor}. The Info file name defaults to @samp{emacs}. For example, 721anchor}. The Info file name defaults to @samp{emacs}. For example,
717 722
718@smallexample 723@smallexample
719See Info node `Font Lock' and Info node `(elisp)Font Lock Basics'. 724See Info node Font Lock and Info node (elisp)Font Lock Basics.
720@end smallexample 725@end smallexample
721 726
722Finally, to create a hyperlink to URLs, write the URL between grave 727Finally, to create a hyperlink to URLs, write the single-quoted URL,
723accent and apostrophe, preceded by @samp{URL}. For example, 728preceded by @samp{URL}. For example,
724 729
725@smallexample 730@smallexample
726The home page for the GNU project has more information (see URL 731The home page for the GNU project has more information (see URL
727`http://www.gnu.org/'). 732http://www.gnu.org/).
728@end smallexample 733@end smallexample
729 734
730@item 735@item