diff options
| author | Paul Eggert | 2015-08-14 15:50:35 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-08-14 15:55:58 -0700 |
| commit | 6af5aad26411ffe21c3fe4bc5438347110910111 (patch) | |
| tree | 2fdf4b741c5025f60924c902123bb31536eca511 /src | |
| parent | 244c801689d2f7a80480d83cd7d092d4762ebe08 (diff) | |
| download | emacs-6af5aad26411ffe21c3fe4bc5438347110910111.tar.gz emacs-6af5aad26411ffe21c3fe4bc5438347110910111.zip | |
Prefer ‘format’ to ‘substitute-command-keys’
* src/character.h (uLSQM, uRSQM): Move here ...
* src/doc.c (uLSQM, uRSQM): ... from here.
* src/doc.c (Fsubstitute_command_keys):
* src/syntax.c (Finternal_describe_syntax_value):
* lisp/cedet/mode-local.el (mode-local-print-binding)
(mode-local-describe-bindings-2):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-theme.el (describe-theme-1):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/emacs-lisp/cl-extra.el (cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl--generic-describe):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/package.el (describe-package-1):
* lisp/faces.el (describe-face):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode):
Prefer ‘format’ to ‘substitute-command-keys’ when either will do
to implement quoting style. This generally makes the code simpler.
Diffstat (limited to 'src')
| -rw-r--r-- | src/character.h | 5 | ||||
| -rw-r--r-- | src/doc.c | 11 | ||||
| -rw-r--r-- | src/syntax.c | 7 |
3 files changed, 13 insertions, 10 deletions
diff --git a/src/character.h b/src/character.h index 0b2c419de99..67d4bca4a23 100644 --- a/src/character.h +++ b/src/character.h | |||
| @@ -78,6 +78,11 @@ enum | |||
| 78 | OBJECT_REPLACEMENT_CHARACTER = 0xFFFC, | 78 | OBJECT_REPLACEMENT_CHARACTER = 0xFFFC, |
| 79 | }; | 79 | }; |
| 80 | 80 | ||
| 81 | /* UTF-8 encodings. Use \x escapes, so they are portable to pre-C11 | ||
| 82 | compilers and can be concatenated with ordinary string literals. */ | ||
| 83 | #define uLSQM "\xE2\x80\x98" /* U+2018 LEFT SINGLE QUOTATION MARK */ | ||
| 84 | #define uRSQM "\xE2\x80\x99" /* U+2019 RIGHT SINGLE QUOTATION MARK */ | ||
| 85 | |||
| 81 | /* Nonzero iff C is a character that corresponds to a raw 8-bit | 86 | /* Nonzero iff C is a character that corresponds to a raw 8-bit |
| 82 | byte. */ | 87 | byte. */ |
| 83 | #define CHAR_BYTE8_P(c) ((c) > MAX_5_BYTE_CHAR) | 88 | #define CHAR_BYTE8_P(c) ((c) > MAX_5_BYTE_CHAR) |
| @@ -687,8 +687,6 @@ the same file name is found in the `doc-directory'. */) | |||
| 687 | /* Curved quotation marks. */ | 687 | /* Curved quotation marks. */ |
| 688 | static unsigned char const LSQM[] = { uLSQM0, uLSQM1, uLSQM2 }; | 688 | static unsigned char const LSQM[] = { uLSQM0, uLSQM1, uLSQM2 }; |
| 689 | static unsigned char const RSQM[] = { uRSQM0, uRSQM1, uRSQM2 }; | 689 | static unsigned char const RSQM[] = { uRSQM0, uRSQM1, uRSQM2 }; |
| 690 | #define uLSQM "\xE2\x80\x98" | ||
| 691 | #define uRSQM "\xE2\x80\x99" | ||
| 692 | 690 | ||
| 693 | /* Return the current effective text quoting style. */ | 691 | /* Return the current effective text quoting style. */ |
| 694 | enum text_quoting_style | 692 | enum text_quoting_style |
| @@ -922,14 +920,13 @@ Otherwise, return a new string. */) | |||
| 922 | if (NILP (tem)) | 920 | if (NILP (tem)) |
| 923 | { | 921 | { |
| 924 | name = Fsymbol_name (name); | 922 | name = Fsymbol_name (name); |
| 925 | insert1 (Fsubstitute_command_keys | 923 | insert1 (CALLN (Fformat, build_string ("\nUses keymap "uLSQM))); |
| 926 | (build_string ("\nUses keymap "uLSQM))); | ||
| 927 | insert_from_string (name, 0, 0, | 924 | insert_from_string (name, 0, 0, |
| 928 | SCHARS (name), | 925 | SCHARS (name), |
| 929 | SBYTES (name), 1); | 926 | SBYTES (name), 1); |
| 930 | insert1 (Fsubstitute_command_keys | 927 | insert1 (CALLN (Fformat, |
| 931 | (build_string | 928 | (build_string |
| 932 | (uRSQM", which is not currently defined.\n"))); | 929 | (uRSQM", which is not currently defined.\n")))); |
| 933 | if (start[-1] == '<') keymap = Qnil; | 930 | if (start[-1] == '<') keymap = Qnil; |
| 934 | } | 931 | } |
| 935 | else if (start[-1] == '<') | 932 | else if (start[-1] == '<') |
diff --git a/src/syntax.c b/src/syntax.c index d45936b2b28..d543a5f9823 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -1333,9 +1333,10 @@ DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value, | |||
| 1333 | insert_string (" (nestable)"); | 1333 | insert_string (" (nestable)"); |
| 1334 | 1334 | ||
| 1335 | if (prefix) | 1335 | if (prefix) |
| 1336 | insert1 (Fsubstitute_command_keys | 1336 | insert1 (CALLN (Fformat, |
| 1337 | (build_string | 1337 | (build_string |
| 1338 | (",\n\t is a prefix character for `backward-prefix-chars'"))); | 1338 | (",\n\t is a prefix character for " |
| 1339 | uLSQM"backward-prefix-chars"uRSQM)))); | ||
| 1339 | 1340 | ||
| 1340 | return syntax; | 1341 | return syntax; |
| 1341 | } | 1342 | } |