diff options
| author | Paul Eggert | 2016-05-10 07:38:23 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-05-10 07:41:40 -0700 |
| commit | 433d366dc7b053048abf710d790ff62421dd1570 (patch) | |
| tree | f68895872dd0384664bb66a56371b64e5630db61 /src/doc.c | |
| parent | 8939ae68d430ef272194ac64144ceb58ae0dbd3f (diff) | |
| download | emacs-433d366dc7b053048abf710d790ff62421dd1570.tar.gz emacs-433d366dc7b053048abf710d790ff62421dd1570.zip | |
'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.c | 41 |
1 files changed, 11 insertions, 30 deletions
| @@ -704,8 +704,6 @@ text_quoting_style (void) | |||
| 704 | ? default_to_grave_quoting_style () | 704 | ? default_to_grave_quoting_style () |
| 705 | : EQ (Vtext_quoting_style, Qgrave)) | 705 | : EQ (Vtext_quoting_style, Qgrave)) |
| 706 | return GRAVE_QUOTING_STYLE; | 706 | return GRAVE_QUOTING_STYLE; |
| 707 | else if (EQ (Vtext_quoting_style, Qleave)) | ||
| 708 | return LEAVE_QUOTING_STYLE; | ||
| 709 | else if (EQ (Vtext_quoting_style, Qstraight)) | 707 | else if (EQ (Vtext_quoting_style, Qstraight)) |
| 710 | return STRAIGHT_QUOTING_STYLE; | 708 | return STRAIGHT_QUOTING_STYLE; |
| 711 | else | 709 | else |
| @@ -982,29 +980,12 @@ Otherwise, return a new string. */) | |||
| 982 | nchars++; | 980 | nchars++; |
| 983 | changed = true; | 981 | changed = true; |
| 984 | } | 982 | } |
| 985 | else if (! multibyte) | ||
| 986 | *bufp++ = *strp++, nchars++; | ||
| 987 | else | 983 | else |
| 988 | { | 984 | { |
| 989 | int len; | 985 | *bufp++ = *strp++; |
| 990 | int ch = STRING_CHAR_AND_LENGTH (strp, len); | 986 | if (multibyte) |
| 991 | if ((ch == LEFT_SINGLE_QUOTATION_MARK | 987 | while (! CHAR_HEAD_P (*strp)) |
| 992 | || ch == RIGHT_SINGLE_QUOTATION_MARK) | 988 | *bufp++ = *strp++; |
| 993 | && quoting_style != CURVE_QUOTING_STYLE | ||
| 994 | && quoting_style != LEAVE_QUOTING_STYLE) | ||
| 995 | { | ||
| 996 | *bufp++ = ((ch == LEFT_SINGLE_QUOTATION_MARK | ||
| 997 | && quoting_style == GRAVE_QUOTING_STYLE) | ||
| 998 | ? '`' : '\''); | ||
| 999 | strp += len; | ||
| 1000 | changed = true; | ||
| 1001 | } | ||
| 1002 | else | ||
| 1003 | { | ||
| 1004 | do | ||
| 1005 | *bufp++ = *strp++; | ||
| 1006 | while (--len != 0); | ||
| 1007 | } | ||
| 1008 | nchars++; | 989 | nchars++; |
| 1009 | } | 990 | } |
| 1010 | } | 991 | } |
| @@ -1036,7 +1017,6 @@ void | |||
| 1036 | syms_of_doc (void) | 1017 | syms_of_doc (void) |
| 1037 | { | 1018 | { |
| 1038 | DEFSYM (Qfunction_documentation, "function-documentation"); | 1019 | DEFSYM (Qfunction_documentation, "function-documentation"); |
| 1039 | DEFSYM (Qleave, "leave"); | ||
| 1040 | DEFSYM (Qgrave, "grave"); | 1020 | DEFSYM (Qgrave, "grave"); |
| 1041 | DEFSYM (Qstraight, "straight"); | 1021 | DEFSYM (Qstraight, "straight"); |
| 1042 | 1022 | ||
| @@ -1051,15 +1031,16 @@ syms_of_doc (void) | |||
| 1051 | DEFVAR_LISP ("text-quoting-style", Vtext_quoting_style, | 1031 | DEFVAR_LISP ("text-quoting-style", Vtext_quoting_style, |
| 1052 | doc: /* Style to use for single quotes in help and messages. | 1032 | doc: /* Style to use for single quotes in help and messages. |
| 1053 | Its value should be a symbol. It works by substituting certain single | 1033 | Its value should be a symbol. It works by substituting certain single |
| 1054 | quotes for certain other single quotes. This is done in help output and | 1034 | quotes for grave accent and apostrophe. This is done in help output |
| 1055 | `message' output. It is not done in `format'. | 1035 | and in functions like `message' and `format-message'. It is not done |
| 1036 | in `format'. | ||
| 1056 | 1037 | ||
| 1057 | `leave' means do not do any substitutions. | ||
| 1058 | `curve' means quote with curved single quotes \\=‘like this\\=’. | 1038 | `curve' means quote with curved single quotes \\=‘like this\\=’. |
| 1059 | `straight' means quote with straight apostrophes \\='like this\\='. | 1039 | `straight' means quote with straight apostrophes \\='like this\\='. |
| 1060 | `grave' means quote with grave accent and apostrophe \\=`like this\\='. | 1040 | `grave' means quote with grave accent and apostrophe \\=`like this\\='; |
| 1061 | The default value nil acts like `curve' if curved single quotes are | 1041 | i.e., do not alter quote marks. The default value nil acts like |
| 1062 | displayable, and like `grave' otherwise. */); | 1042 | `curve' if curved single quotes are displayable, and like `grave' |
| 1043 | otherwise. */); | ||
| 1063 | Vtext_quoting_style = Qnil; | 1044 | Vtext_quoting_style = Qnil; |
| 1064 | 1045 | ||
| 1065 | DEFVAR_BOOL ("internal--text-quoting-flag", text_quoting_flag, | 1046 | DEFVAR_BOOL ("internal--text-quoting-flag", text_quoting_flag, |