diff options
| author | Paul Eggert | 2015-05-28 00:06:14 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-05-28 00:22:02 -0700 |
| commit | 0fd5e6593af620863dcf90dff5d04631458e24cd (patch) | |
| tree | eba3529cdd544089f6661db3b3b09f0218aa1076 /doc | |
| parent | 11b2744f48fc03f1511de1152ad49807557c6f85 (diff) | |
| download | emacs-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.texi | 35 |
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 |
| 660 | When a documentation string refers to a Lisp symbol, write it as it | 660 | When a documentation string refers to a Lisp symbol, write it as it |
| 661 | would be printed (which usually means in lower case), with a grave | 661 | would be printed (which usually means in lower case), surrounding |
| 662 | accent @samp{`} before and apostrophe @samp{'} after it. There are | 662 | it with curved single quotes (@samp{‘} and @samp{’}). There are |
| 663 | two exceptions: write @code{t} and @code{nil} without surrounding | 663 | two exceptions: write @code{t} and @code{nil} without surrounding |
| 664 | punctuation. For example: @samp{CODE can be `lambda', nil, or t.} | 664 | punctuation. For example: @samp{CODE can be ‘lambda’, nil, or t.} |
| 665 | (In this manual, we use a different convention, with single-quotes | 665 | |
| 666 | around symbols.) | 666 | Documentation strings can also use an older single-quoting convention, |
| 667 | which quotes symbols with grave accent @samp{`} and apostrophe | ||
| 668 | @samp{'}: @samp{`like-this'} rather than @samp{‘like-this’}. This | ||
| 669 | older convention was designed for now-obsolete displays in which grave | ||
| 670 | accent and apostrophe were mirror images. Documentation in this older | ||
| 671 | convention is converted to the standard convention when it is copied | ||
| 672 | into a help buffer. @xref{Keys in Documentation}. | ||
| 667 | 673 | ||
| 668 | @cindex hyperlinks in documentation strings | 674 | @cindex hyperlinks in documentation strings |
| 669 | Help mode automatically creates a hyperlink when a documentation string | 675 | Help mode automatically creates a hyperlink when a documentation string |
| 670 | uses a symbol name between grave accent and apostrophe, if the symbol | 676 | uses a single-quoted symbol name, if the symbol has either a |
| 671 | has either a | ||
| 672 | function or a variable definition. You do not need to do anything | 677 | function or a variable definition. You do not need to do anything |
| 673 | special to make use of this feature. However, when a symbol has both a | 678 | special to make use of this feature. However, when a symbol has both a |
| 674 | function definition and a variable definition, and you want to refer to | 679 | function 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 | |||
| 678 | recognizing these indicator words.) For example, if you write | 683 | recognizing these indicator words.) For example, if you write |
| 679 | 684 | ||
| 680 | @example | 685 | @example |
| 681 | This function sets the variable `buffer-file-name'. | 686 | This 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 | |||
| 691 | symbol name to prevent making any hyperlink. For example, | 696 | symbol name to prevent making any hyperlink. For example, |
| 692 | 697 | ||
| 693 | @example | 698 | @example |
| 694 | If the argument KIND-OF-RESULT is the symbol `list', | 699 | If the argument KIND-OF-RESULT is the symbol ‘list’, |
| 695 | this function returns a list of all the objects | 700 | this function returns a list of all the objects |
| 696 | that satisfy the criterion. | 701 | that 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 | |||
| 710 | documentation will be shown, even if the symbol is also defined as a | 715 | documentation will be shown, even if the symbol is also defined as a |
| 711 | variable or as a function. | 716 | variable or as a function. |
| 712 | 717 | ||
| 713 | To make a hyperlink to Info documentation, write the name of the Info | 718 | To make a hyperlink to Info documentation, write the single-quoted |
| 714 | node (or anchor) between grave accent and apostrophe, preceded by | 719 | name 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 |
| 716 | anchor}. The Info file name defaults to @samp{emacs}. For example, | 721 | anchor}. The Info file name defaults to @samp{emacs}. For example, |
| 717 | 722 | ||
| 718 | @smallexample | 723 | @smallexample |
| 719 | See Info node `Font Lock' and Info node `(elisp)Font Lock Basics'. | 724 | See Info node ‘Font Lock’ and Info node ‘(elisp)Font Lock Basics’. |
| 720 | @end smallexample | 725 | @end smallexample |
| 721 | 726 | ||
| 722 | Finally, to create a hyperlink to URLs, write the URL between grave | 727 | Finally, to create a hyperlink to URLs, write the single-quoted URL, |
| 723 | accent and apostrophe, preceded by @samp{URL}. For example, | 728 | preceded by @samp{URL}. For example, |
| 724 | 729 | ||
| 725 | @smallexample | 730 | @smallexample |
| 726 | The home page for the GNU project has more information (see URL | 731 | The home page for the GNU project has more information (see URL |
| 727 | `http://www.gnu.org/'). | 732 | ‘http://www.gnu.org/’). |
| 728 | @end smallexample | 733 | @end smallexample |
| 729 | 734 | ||
| 730 | @item | 735 | @item |