aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
authorPaul Eggert2015-08-14 15:50:35 -0700
committerPaul Eggert2015-08-14 15:55:57 -0700
commit244c801689d2f7a80480d83cd7d092d4762ebe08 (patch)
tree6a07abc8b26966002de304b3546f3ccbebb2c865 /src/lisp.h
parent293775f10555f7da7e61ed8dbdb78d72f30f7e2d (diff)
downloademacs-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 'src/lisp.h')
-rw-r--r--src/lisp.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 2545203a674..d3dcaecd2bb 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4300,6 +4300,25 @@ extern void set_initial_environment (void);
4300extern void syms_of_callproc (void); 4300extern void syms_of_callproc (void);
4301 4301
4302/* Defined in doc.c. */ 4302/* Defined in doc.c. */
4303enum
4304 {
4305 /* Named constants for the UTF-8 encodings of U+2018 LEFT SINGLE
4306 QUOTATION MARK and U+2019 RIGHT SINGLE QUOTATION MARK. */
4307 uLSQM0 = 0xE2, uLSQM1 = 0x80, uLSQM2 = 0x98,
4308 uRSQM0 = 0xE2, uRSQM1 = 0x80, uRSQM2 = 0x99
4309 };
4310enum text_quoting_style
4311 {
4312 /* Use curved single quotes ‘like this’. */
4313 CURVE_QUOTING_STYLE,
4314
4315 /* Use grave accent and apostrophe `like this'. */
4316 GRAVE_QUOTING_STYLE,
4317
4318 /* Use apostrophes 'like this'. */
4319 STRAIGHT_QUOTING_STYLE
4320 };
4321extern enum text_quoting_style text_quoting_style (void);
4303extern Lisp_Object read_doc_string (Lisp_Object); 4322extern Lisp_Object read_doc_string (Lisp_Object);
4304extern Lisp_Object get_doc_string (Lisp_Object, bool, bool); 4323extern Lisp_Object get_doc_string (Lisp_Object, bool, bool);
4305extern void syms_of_doc (void); 4324extern void syms_of_doc (void);