diff options
| author | Paul Eggert | 2015-08-14 15:50:35 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-08-14 15:55:57 -0700 |
| commit | 244c801689d2f7a80480d83cd7d092d4762ebe08 (patch) | |
| tree | 6a07abc8b26966002de304b3546f3ccbebb2c865 /etc | |
| parent | 293775f10555f7da7e61ed8dbdb78d72f30f7e2d (diff) | |
| download | emacs-244c801689d2f7a80480d83cd7d092d4762ebe08.tar.gz emacs-244c801689d2f7a80480d83cd7d092d4762ebe08.zip | |
Extend ‘format’ to translate curved quotes
This is a followup to the recent doc string change, and deals with
diagnostics and the like. This patch is more conservative than
the doc string change, in that the behavior of ‘format’ changes
only if its first arg contains curved quotes and the user prefers
straight or grave quotes. (Come to think of it, perhaps we should
be similarly conservative with doc strings too, but that can wait.)
The upside of this conservatism is that existing usage is almost
surely unaffected. The downside is that we'll eventually have to
change Emacs's format strings to use curved quotes in places where
the user might want curved quotes, but that's a simple and
mechanical translation that I'm willing to do later. (Bug#21222)
* doc/lispref/help.texi (Keys in Documentation):
Move description of text-quoting-style from here ...
* doc/lispref/strings.texi (Formatting Strings):
... to here, and describe new behavior of ‘format’.
* etc/NEWS: Describe new behavior.
* lisp/calc/calc-help.el (calc-describe-thing):
* lisp/emacs-lisp/derived.el (derived-mode-make-docstring):
* lisp/info.el (Info-find-index-name):
Use ‘concat’ rather than ‘format’ to avoid misinterpretation
of recently-added curved quotes.
* src/doc.c (uLSQM0, uLSQM1, uLSQM2, uRSQM0, uRSQM1, uRSQM2):
Move from here ...
* src/lisp.h: ... to here.
* src/doc.c (text_quoting_style): New function.
(Fsubstitute_command_keys): Use it.
* src/editfns.c (Fformat): Implement new behavior.
* src/lisp.h (enum text_quoting_style): New enum.
Diffstat (limited to 'etc')
| -rw-r--r-- | etc/NEWS | 25 |
1 files changed, 17 insertions, 8 deletions
| @@ -895,16 +895,25 @@ denied" instead of "permission denied". The old behavior was problematic | |||
| 895 | in languages like German where downcasing rules depend on grammar. | 895 | in languages like German where downcasing rules depend on grammar. |
| 896 | 896 | ||
| 897 | +++ | 897 | +++ |
| 898 | ** ‘format’ now replaces curved single quotes. | ||
| 899 | That is, it replaces strings' curved single quotes (also known as | ||
| 900 | curly quotes) as per the value of the new custom variable | ||
| 901 | ‘text-quoting-style’: ‘curve’ means replace curved quotes with | ||
| 902 | themselves ‘like this’, ‘straight’ means use straight apostrophes | ||
| 903 | 'like this', ‘grave’ means use grave accent and apostrophe `like | ||
| 904 | this', and nil (default) means use curved quotes if displayable and | ||
| 905 | grave accent and apostrophe otherwise. Because it now may be used | ||
| 906 | in many contexts where it's a no-op, ‘format’ is no longer required to | ||
| 907 | create a string, and may return its first argument if the argument | ||
| 908 | already has the correct value. | ||
| 909 | |||
| 910 | +++ | ||
| 898 | ** substitute-command-keys now replaces quotes. | 911 | ** substitute-command-keys now replaces quotes. |
| 899 | That is, it converts documentation strings' quoting style as per the | 912 | That is, it converts documentation strings' quoting style as per the |
| 900 | value of the new custom variable ‘text-quoting-style’: ‘curve’ means | 913 | value of ‘text-quoting-style’ as described above. Doc strings in |
| 901 | use curved quotes (also known as curly quotes) ‘like this’, ‘straight’ | 914 | source code can use either curved quotes or grave accent and |
| 902 | means use straight apostrophes 'like this', ‘grave’ means use grave | 915 | apostrophe. As before, isolated apostrophes and characters preceded |
| 903 | accent and apostrophe `like this', and nil (default) means use curved | 916 | by \= are output as-is. |
| 904 | quotes if displayable and grave accent and apostrophe otherwise. Doc | ||
| 905 | strings in source code can use either curved quotes or grave accent | ||
| 906 | and apostrophe. As before, isolated apostrophes and characters | ||
| 907 | preceded by \= are output as-is. | ||
| 908 | 917 | ||
| 909 | +++ | 918 | +++ |
| 910 | ** The character classes [:alpha:] and [:alnum:] in regular expressions | 919 | ** The character classes [:alpha:] and [:alnum:] in regular expressions |