From 6a45e72052498e082f7f67345daaff5596cbd812 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 9 Aug 2015 16:21:05 -0700 Subject: [PATCH] Fix some minor quoting issues with grave accent MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * src/dispnew.c (add_window_display_history) [GLYPH_DEBUG]: Remove redundant quotes. * src/doc.c (uLSQM, uRSQM): New macros. * src/doc.c (Fsubstitute_command_keys): * src/syntax.c (Finternal_describe_syntax_value): Follow the user preference for quotes rather than hardcoding the ‘grave’ style. * src/regex.c (PUSH_FAILURE_POINT, POP_FAILURE_POINT) (re_match_2_internal) [DEBUG]: In debugging output, quote C strings with "...", not `...'. --- src/dispnew.c | 2 +- src/doc.c | 9 +++++++-- src/regex.c | 14 +++++++------- src/syntax.c | 4 +++- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/dispnew.c b/src/dispnew.c index 7833fe3d01c..18afe50dd9b 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -177,7 +177,7 @@ add_window_display_history (struct window *w, const char *msg, bool paused_p) ++history_idx; snprintf (buf, sizeof redisplay_history[0].trace, - "%"pMu": window %p (`%s')%s\n%s", + "%"pMu": window %p (%s)%s\n%s", history_tick++, ptr, ((BUFFERP (w->contents) diff --git a/src/doc.c b/src/doc.c index 36619e1142e..a079cd27493 100644 --- a/src/doc.c +++ b/src/doc.c @@ -695,6 +695,8 @@ enum }; static unsigned char const LSQM[] = { uLSQM0, uLSQM1, uLSQM2 }; static unsigned char const RSQM[] = { uRSQM0, uRSQM1, uRSQM2 }; +#define uLSQM "\xE2\x80\x98" +#define uRSQM "\xE2\x80\x99" DEFUN ("substitute-command-keys", Fsubstitute_command_keys, Ssubstitute_command_keys, 1, 1, 0, @@ -921,11 +923,14 @@ Otherwise, return a new string. */) if (NILP (tem)) { name = Fsymbol_name (name); - insert_string ("\nUses keymap `"); + insert1 (Fsubstitute_command_keys + (build_string ("\nUses keymap "uLSQM))); insert_from_string (name, 0, 0, SCHARS (name), SBYTES (name), 1); - insert_string ("', which is not currently defined.\n"); + insert1 (Fsubstitute_command_keys + (build_string + (uRSQM", which is not currently defined.\n"))); if (start[-1] == '<') keymap = Qnil; } else if (start[-1] == '<') diff --git a/src/regex.c b/src/regex.c index 38c5e350541..dcf286454b3 100644 --- a/src/regex.c +++ b/src/regex.c @@ -1544,9 +1544,9 @@ do { \ DEBUG_PRINT (" Push frame index: %zd\n", fail_stack.frame); \ PUSH_FAILURE_INT (fail_stack.frame); \ \ - DEBUG_PRINT (" Push string %p: `", string_place); \ + DEBUG_PRINT (" Push string %p: \"", string_place); \ DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, size2);\ - DEBUG_PRINT ("'\n"); \ + DEBUG_PRINT ("\"\n"); \ PUSH_FAILURE_POINTER (string_place); \ \ DEBUG_PRINT (" Push pattern %p: ", pattern); \ @@ -1598,9 +1598,9 @@ do { \ on_failure_keep_string_jump opcode, and we want to throw away the \ saved NULL, thus retaining our current position in the string. */ \ str = POP_FAILURE_POINTER (); \ - DEBUG_PRINT (" Popping string %p: `", str); \ + DEBUG_PRINT (" Popping string %p: \"", str); \ DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \ - DEBUG_PRINT ("'\n"); \ + DEBUG_PRINT ("\"\n"); \ \ fail_stack.frame = POP_FAILURE_INT (); \ DEBUG_PRINT (" Popping frame index: %zd\n", fail_stack.frame); \ @@ -5127,9 +5127,9 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1, DEBUG_PRINT ("The compiled pattern is: "); DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend); - DEBUG_PRINT ("The string to match is: `"); + DEBUG_PRINT ("The string to match is: \""); DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2); - DEBUG_PRINT ("'\n"); + DEBUG_PRINT ("\"\n"); /* This loops over pattern commands. It exits by returning from the function if the match is complete, or it drops through if the match @@ -5435,7 +5435,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1, && buf_ch == '\000')) goto fail; - DEBUG_PRINT (" Matched `%d'.\n", *d); + DEBUG_PRINT (" Matched \"%d\".\n", *d); d += buf_charlen; } break; diff --git a/src/syntax.c b/src/syntax.c index 0d8b08c01b6..d45936b2b28 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -1333,7 +1333,9 @@ DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value, insert_string (" (nestable)"); if (prefix) - insert_string (",\n\t is a prefix character for `backward-prefix-chars'"); + insert1 (Fsubstitute_command_keys + (build_string + (",\n\t is a prefix character for `backward-prefix-chars'"))); return syntax; } -- 2.39.2