summaryrefslogtreecommitdiff
path: root/src/doc.c
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2016-05-04 19:59:50 +0000
committerAlan Mackenzie <acm@muc.de>2016-05-04 19:59:50 +0000
commit32f5bf0c29bbad6524f71079e4380b8156289551 (patch)
tree3d9270640d73442c28880296bfd6a16613c1b3d4 /src/doc.c
parent088acab3831b45e0e0749705226b8680076df4b6 (diff)
downloademacs-32f5bf0c29bbad6524f71079e4380b8156289551.tar.gz
Allow `text-quoting-style' to be `leave', i.e. no translation of quotes.
* lisp/help-fns.el (describe-function-1): Don't set coding system to UTF-8 when text-quoting-style is `leave'. * src/lisp.h (enum text_quoting_style): Add identifier LEAVE_QUOTING_STYLE. * src/doc.c (syms_of_doc): New symbol "leave". Amend doc string of `text_quoting_style'. (text_quoting_style): Handle `leave' by returning LEAVE_QUOTING_STYLE. (Fsubstitute_command_keys): Don't translate quotes when quoting_style is LEAVE_QUOTING_STYLE. * src/editfns.c (styled_format): Set quoting_style to -1 when text-quoting-style is `leave'.
Diffstat (limited to 'src/doc.c')
-rw-r--r--src/doc.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/doc.c b/src/doc.c
index e1f508e5014..53264334ed5 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -704,6 +704,8 @@ text_quoting_style (void)
? default_to_grave_quoting_style ()
: EQ (Vtext_quoting_style, Qgrave))
return GRAVE_QUOTING_STYLE;
+ else if (EQ (Vtext_quoting_style, Qleave))
+ return LEAVE_QUOTING_STYLE;
else if (EQ (Vtext_quoting_style, Qstraight))
return STRAIGHT_QUOTING_STYLE;
else
@@ -988,7 +990,8 @@ Otherwise, return a new string. */)
int ch = STRING_CHAR_AND_LENGTH (strp, len);
if ((ch == LEFT_SINGLE_QUOTATION_MARK
|| ch == RIGHT_SINGLE_QUOTATION_MARK)
- && quoting_style != CURVE_QUOTING_STYLE)
+ && quoting_style != CURVE_QUOTING_STYLE
+ && quoting_style != LEAVE_QUOTING_STYLE)
{
*bufp++ = ((ch == LEFT_SINGLE_QUOTATION_MARK
&& quoting_style == GRAVE_QUOTING_STYLE)
@@ -1033,6 +1036,7 @@ void
syms_of_doc (void)
{
DEFSYM (Qfunction_documentation, "function-documentation");
+ DEFSYM (Qleave, "leave");
DEFSYM (Qgrave, "grave");
DEFSYM (Qstraight, "straight");
@@ -1046,7 +1050,11 @@ syms_of_doc (void)
DEFVAR_LISP ("text-quoting-style", Vtext_quoting_style,
doc: /* Style to use for single quotes in help and messages.
-Its value should be a symbol.
+Its value should be a symbol. It works by substituting certain single
+quotes for certain other single quotes. This is done in help output and
+`message' output. It is not done in `format'.
+
+`leave' means do not do any substitutions.
`curve' means quote with curved single quotes \\=‘like this\\=’.
`straight' means quote with straight apostrophes \\='like this\\='.
`grave' means quote with grave accent and apostrophe \\=`like this\\='.