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.
specifies @var{mapvar}'s value as the keymap for any following
@samp{\[@var{command}]} sequences in this documentation string.
specifies @var{mapvar}'s value as the keymap for any following
@samp{\[@var{command}]} sequences in this documentation string.
-@item ‘
-@itemx `
-(left single quotation mark and grave accent) both stand for a left quote.
+@item `
+(grave accent) stands for a left quote.
This generates a left single quotation mark, an apostrophe, or a grave
accent depending on the value of @code{text-quoting-style}.
This generates a left single quotation mark, an apostrophe, or a grave
accent depending on the value of @code{text-quoting-style}.
-@item ’
-@itemx '
-(right single quotation mark and apostrophe) both stand for a right quote.
+@item '
+(apostrophe) stands for a right quote.
This generates a right single quotation mark or an apostrophe
depending on the value of @code{text-quoting-style}.
This generates a right single quotation mark or an apostrophe
depending on the value of @code{text-quoting-style}.
If the variable's value is @code{curve}, the style is
@t{‘like this’} with curved single quotes. If the value is
@code{straight}, the style is @t{'like this'} with straight
If the variable's value is @code{curve}, the style is
@t{‘like this’} with curved single quotes. If the value is
@code{straight}, the style is @t{'like this'} with straight
-apostrophes. If the value is @code{grave}, the style is @t{`like
+apostrophes. If the value is @code{grave},
+quotes are not translated and the style is @t{`like
this'} with grave accent and apostrophe, the standard style
before Emacs version 25. The default value @code{nil}
acts like @code{curve} if curved single quotes are displayable, and
this'} with grave accent and apostrophe, the standard style
before Emacs version 25. The default value @code{nil}
acts like @code{curve} if curved single quotes are displayable, and
@cindex curved quotes
@cindex curly quotes
This function acts like @code{format}, except it also converts any
@cindex curved quotes
@cindex curly quotes
This function acts like @code{format}, except it also converts any
-curved single quotes in @var{string} as per the value of
-@code{text-quoting-style}, and treats grave accent (@t{`}) and
-apostrophe (@t{'}) as if they were curved single quotes.
+grave accents (@t{`}) and apostrophes (@t{'}) in @var{string} as per the
+value of @code{text-quoting-style}.
A format that quotes with grave accents and apostrophes @t{`like
this'} typically generates curved quotes @t{‘like this’}. In
A format that quotes with grave accents and apostrophes @t{`like
this'} typically generates curved quotes @t{‘like this’}. In
@t{'}: @t{`like-this'} rather than @t{‘like-this’}. This
older convention was designed for now-obsolete displays in which grave
accent and apostrophe were mirror images.
@t{'}: @t{`like-this'} rather than @t{‘like-this’}. This
older convention was designed for now-obsolete displays in which grave
accent and apostrophe were mirror images.
-
-Documentation using either convention is converted to the user's
+Documentation using this convention is converted to the user's
preferred format when it is copied into a help buffer. @xref{Keys in
Documentation}.
preferred format when it is copied into a help buffer. @xref{Keys in
Documentation}.
*** Ediff can be prevented from pausing 1 second after reaching a
breakpoint (e.g. with "f" and "o") by customizing the new option
*** Ediff can be prevented from pausing 1 second after reaching a
breakpoint (e.g. with "f" and "o") by customizing the new option
before running. This is controlled by the 'grep-save-buffers'
variable.
before running. This is controlled by the 'grep-save-buffers'
variable.
++++
+** The variable 'text-quoting-style' no longer affects the treatment
+of curved quotes in format arguments to functions like 'message' and
+'format-message'. In particular, when this variable's value is
+'grave', all quotes in formats are output as-is.
+
\f
* Lisp Changes in Emacs 25.2
** New var syntax-ppss-table to control the syntax-table used in syntax-ppss.
+++
\f
* Lisp Changes in Emacs 25.2
** New var syntax-ppss-table to control the syntax-table used in syntax-ppss.
+++
-** `define-derived-mode' can now specify an :after-hook form, which
+** 'define-derived-mode' can now specify an :after-hook form, which
gets evaluated after the new mode's hook has run. This can be used to
incorporate configuration changes made in the mode hook into the
mode's setup.
gets evaluated after the new mode's hook has run. This can be used to
incorporate configuration changes made in the mode hook into the
mode's setup.
;; Avoid asking the user annoying questions if she decides
;; to save the help buffer, when her locale's codeset
;; isn't UTF-8.
;; Avoid asking the user annoying questions if she decides
;; to save the help buffer, when her locale's codeset
;; isn't UTF-8.
- (unless (memq text-quoting-style '(leave straight grave))
+ (unless (memq text-quoting-style '(straight grave))
(set-buffer-file-coding-system 'utf-8))))))))
;; Add defaults to `help-fns-describe-function-functions'.
(set-buffer-file-coding-system 'utf-8))))))))
;; Add defaults to `help-fns-describe-function-functions'.
? default_to_grave_quoting_style ()
: EQ (Vtext_quoting_style, Qgrave))
return GRAVE_QUOTING_STYLE;
? 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
else if (EQ (Vtext_quoting_style, Qstraight))
return STRAIGHT_QUOTING_STYLE;
else
nchars++;
changed = true;
}
nchars++;
changed = true;
}
- else if (! multibyte)
- *bufp++ = *strp++, nchars++;
- 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++;
syms_of_doc (void)
{
DEFSYM (Qfunction_documentation, "function-documentation");
syms_of_doc (void)
{
DEFSYM (Qfunction_documentation, "function-documentation");
- DEFSYM (Qleave, "leave");
DEFSYM (Qgrave, "grave");
DEFSYM (Qstraight, "straight");
DEFSYM (Qgrave, "grave");
DEFSYM (Qstraight, "straight");
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
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\\='.
`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,
Vtext_quoting_style = Qnil;
DEFVAR_BOOL ("internal--text-quoting-flag", text_quoting_flag,
multibyte = true;
int quoting_style = message ? text_quoting_style () : -1;
multibyte = true;
int quoting_style = message ? text_quoting_style () : -1;
- if (quoting_style == LEAVE_QUOTING_STYLE)
- quoting_style = -1;
/* If we start out planning a unibyte result,
then discover it has to be multibyte, we jump back to retry. */
/* If we start out planning a unibyte result,
then discover it has to be multibyte, we jump back to retry. */
- /* Named constants for the UTF-8 encodings of U+2018 LEFT SINGLE
- QUOTATION MARK and U+2019 RIGHT SINGLE QUOTATION MARK. */
- enum
- {
- uLSQM0 = 0xE2, uLSQM1 = 0x80, uLSQM2 = 0x98,
- /* uRSQM0 = 0xE2, uRSQM1 = 0x80, */ uRSQM2 = 0x99
- };
-
unsigned char str[MAX_MULTIBYTE_LENGTH];
if ((format_char == '`' || format_char == '\'')
unsigned char str[MAX_MULTIBYTE_LENGTH];
if ((format_char == '`' || format_char == '\'')
}
else if (format_char == '`' && quoting_style == STRAIGHT_QUOTING_STYLE)
convsrc = "'";
}
else if (format_char == '`' && quoting_style == STRAIGHT_QUOTING_STYLE)
convsrc = "'";
- else if (format_char == uLSQM0 && CURVE_QUOTING_STYLE < quoting_style
- && multibyte_format
- && (unsigned char) format[0] == uLSQM1
- && ((unsigned char) format[1] == uLSQM2
- || (unsigned char) format[1] == uRSQM2))
- {
- convsrc = (((unsigned char) format[1] == uLSQM2
- && quoting_style == GRAVE_QUOTING_STYLE)
- ? "`" : "'");
- format += 2;
- memset (&discarded[format0 + 1 - format_start], 2, 2);
- }
else
{
/* Copy a single character from format to buf. */
else
{
/* Copy a single character from format to buf. */
/* Defined in doc.c. */
enum text_quoting_style
{
/* Defined in doc.c. */
enum text_quoting_style
{
- /* Leave quotes unchanged. */
- LEAVE_QUOTING_STYLE,
-
/* Use curved single quotes ‘like this’. */
CURVE_QUOTING_STYLE,
/* Use curved single quotes ‘like this’. */
CURVE_QUOTING_STYLE,