summaryrefslogtreecommitdiff
path: root/src/doc.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-05-10 07:38:23 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-05-10 07:41:40 -0700
commit433d366dc7b053048abf710d790ff62421dd1570 (patch)
treef68895872dd0384664bb66a56371b64e5630db61 /src/doc.c
parent8939ae68d430ef272194ac64144ceb58ae0dbd3f (diff)
downloademacs-433d366dc7b053048abf710d790ff62421dd1570.tar.gz
'text-quoting-style' now affects only ` and '
Change 'text-quoting-style' so that it no longer affects formatting of curved quotes in format arguments to functions like 'message'. In particular, when this variable's value is 'grave', all quotes in formats are output as-is. * doc/lispref/help.texi (Keys in Documentation): * doc/lispref/strings.texi (Formatting Strings): * doc/lispref/tips.texi (Documentation Tips): * etc/NEWS: * src/doc.c (syms_of_doc): Document this. * lisp/help-fns.el (describe-function-1): * src/doc.c (text_quoting_style, Fsubstitute_command_keys) (syms_of_doc): * src/editfns.c (styled_format): Omit now-unnecessary code. * src/lisp.h (LEAVE_QUOTING_STYLE): Remove.
Diffstat (limited to 'src/doc.c')
-rw-r--r--src/doc.c41
1 files changed, 11 insertions, 30 deletions
diff --git a/src/doc.c b/src/doc.c
index 53264334ed5..017dd173d0a 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -704,8 +704,6 @@ 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
@@ -982,29 +980,12 @@ Otherwise, return a new string. */)
nchars++;
changed = true;
}
- else if (! multibyte)
- *bufp++ = *strp++, nchars++;
else
{
- int len;
- 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 != LEAVE_QUOTING_STYLE)
- {
- *bufp++ = ((ch == LEFT_SINGLE_QUOTATION_MARK
- && quoting_style == GRAVE_QUOTING_STYLE)
- ? '`' : '\'');
- strp += len;
- changed = true;
- }
- else
- {
- do
- *bufp++ = *strp++;
- while (--len != 0);
- }
+ *bufp++ = *strp++;
+ if (multibyte)
+ while (! CHAR_HEAD_P (*strp))
+ *bufp++ = *strp++;
nchars++;
}
}
@@ -1036,7 +1017,6 @@ void
syms_of_doc (void)
{
DEFSYM (Qfunction_documentation, "function-documentation");
- DEFSYM (Qleave, "leave");
DEFSYM (Qgrave, "grave");
DEFSYM (Qstraight, "straight");
@@ -1051,15 +1031,16 @@ 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. 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'.
+quotes for grave accent and apostrophe. This is done in help output
+and in functions like `message' and `format-message'. 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\\='.
-The default value nil acts like `curve' if curved single quotes are
-displayable, and like `grave' otherwise. */);
+`grave' means quote with grave accent and apostrophe \\=`like this\\=';
+i.e., do not alter quote marks. The default value nil acts like
+`curve' if curved single quotes are displayable, and like `grave'
+otherwise. */);
Vtext_quoting_style = Qnil;
DEFVAR_BOOL ("internal--text-quoting-flag", text_quoting_flag,