commit 572f68ea292e7207ceab8bfe5af365204bfcb9d2 (HEAD, refs/remotes/origin/master) Author: Wieland Hoffmann Date: Wed Aug 26 10:31:19 2015 +0200 ; Fix a typo in the EPA docs * doc/misc/epa.texi: Fix a typo diff --git a/doc/misc/epa.texi b/doc/misc/epa.texi index 6830ba7..3c9aa8a 100644 --- a/doc/misc/epa.texi +++ b/doc/misc/epa.texi @@ -382,7 +382,7 @@ Enable automatic encryption/decryption of *.gpg files. @noindent By default, @code{epa-file} will try to use symmetric encryption, aka password-based encryption. If you want to use public key encryption -instead, do @kbd{M-x epa-file-select-keys}, which will pops up the key +instead, do @kbd{M-x epa-file-select-keys}, which pops up the key selection dialog. @deffn Command epa-file-select-keys commit b142c4837543b7e36e95b2150409782f665cd474 Author: Paul Eggert Date: Thu Aug 27 11:34:45 2015 -0700 Tweak startup screen quoting * lisp/startup.el (normal-splash-screen): Use standard "M-" abbrevation rather than a confusingly-different one. (normal-no-mouse-startup-screen): Follow ‘text-quoting-style’. diff --git a/lisp/startup.el b/lisp/startup.el index 0da2e14..1cb3bb6 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1886,7 +1886,7 @@ splash screen in another window." auto-save-list-file-prefix))) t) (insert "\n\nIf an Emacs session crashed recently, " - "type Meta-x recover-session RET\nto recover" + "type M-x recover-session RET\nto recover" " the files you were editing.\n")) (use-local-map splash-screen-keymap) @@ -2001,9 +2001,9 @@ To quit a partially entered command, type Control-g.\n") (insert (substitute-command-keys " \\[tmm-menubar]"))) ;; Many users seem to have problems with these. - (insert " + (insert (substitute-command-keys " \(`C-' means use the CTRL key. `M-' means use the Meta (or Alt) key. -If you have no Meta key, you may instead type ESC followed by the character.)") +If you have no Meta key, you may instead type ESC followed by the character.)")) ;; Insert links to useful tasks (insert "\nUseful tasks:\n") commit 6dbe056b9beec0b9ff6c84331a49c568408dbbaa Author: Paul Eggert Date: Thu Aug 27 08:50:22 2015 -0700 Add test case for ‘format’ bug and refactor * src/editfns.c (styled_format): Refactor internally, mostly by moving declarations closer to uses. This should not affect behavior. * test/automated/textprop-tests.el (textprop-tests-format): New test. diff --git a/src/editfns.c b/src/editfns.c index bbb139f..a85c9e7 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3861,68 +3861,59 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) ptrdiff_t max_bufsize = STRING_BYTES_BOUND + 1; char *p; ptrdiff_t buf_save_value_index IF_LINT (= 0); - char *format, *end, *format_start; - ptrdiff_t formatlen, nchars; - /* True if the format is multibyte. */ - bool multibyte_format = 0; - /* True if the output should be a multibyte string, - which is true if any of the inputs is one. */ - bool multibyte = 0; + char *format, *end; + ptrdiff_t nchars; /* When we make a multibyte string, we must pay attention to the byte combining problem, i.e., a byte may be combined with a multibyte character of the previous string. This flag tells if we must consider such a situation or not. */ bool maybe_combine_byte; - Lisp_Object val; - bool arg_intervals = 0; + bool arg_intervals = false; USE_SAFE_ALLOCA; - /* discarded[I] is 1 if byte I of the format - string was not copied into the output. - It is 2 if byte I was not the first byte of its character. */ - char *discarded; - /* Each element records, for one argument, the start and end bytepos in the output string, whether the argument has been converted to string (e.g., due to "%S"), - and whether the argument is a string with intervals. - info[0] is unused. Unused elements have -1 for start. */ + and whether the argument is a string with intervals. */ struct info { ptrdiff_t start, end; bool_bf converted_to_string : 1; bool_bf intervals : 1; - } *info = 0; + } *info; CHECK_STRING (args[0]); - format_start = SSDATA (args[0]); - formatlen = SBYTES (args[0]); + char *format_start = SSDATA (args[0]); + ptrdiff_t formatlen = SBYTES (args[0]); /* Allocate the info and discarded tables. */ - { - ptrdiff_t i; - if ((SIZE_MAX - formatlen) / sizeof (struct info) <= nargs) - memory_full (SIZE_MAX); - info = SAFE_ALLOCA ((nargs + 1) * sizeof *info + formatlen); - discarded = (char *) &info[nargs + 1]; - for (i = 0; i < nargs + 1; i++) - { - info[i].start = -1; - info[i].intervals = info[i].converted_to_string = 0; - } - memset (discarded, 0, formatlen); - } + if ((SIZE_MAX - formatlen) / sizeof (struct info) <= nargs) + memory_full (SIZE_MAX); + size_t alloca_size = (nargs + 1) * sizeof *info + formatlen; + /* info[0] is unused. Unused elements have -1 for start. */ + info = SAFE_ALLOCA (alloca_size); + memset (info, 0, alloca_size); + for (ptrdiff_t i = 0; i < nargs + 1; i++) + info[i].start = -1; + /* discarded[I] is 1 if byte I of the format + string was not copied into the output. + It is 2 if byte I was not the first byte of its character. */ + char *discarded = (char *) &info[nargs + 1]; /* Try to determine whether the result should be multibyte. This is not always right; sometimes the result needs to be multibyte because of an object that we will pass through prin1. or because a grave accent or apostrophe is requoted, and in that case, we won't know it here. */ - multibyte_format = STRING_MULTIBYTE (args[0]); - multibyte = multibyte_format; - for (n = 1; !multibyte && n < nargs; n++) - if (STRINGP (args[n]) && STRING_MULTIBYTE (args[n])) - multibyte = 1; + + /* True if the format is multibyte. */ + bool multibyte_format = STRING_MULTIBYTE (args[0]); + /* True if the output should be a multibyte string, + which is true if any of the inputs is one. */ + bool multibyte = multibyte_format; + for (ptrdiff_t i = 1; !multibyte && i < nargs; i++) + if (STRINGP (args[i]) && STRING_MULTIBYTE (args[i])) + multibyte = true; int quoting_style = message ? text_quoting_style () : -1; @@ -3937,7 +3928,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) /* Scan the format and store result in BUF. */ format = format_start; end = format + formatlen; - maybe_combine_byte = 0; + maybe_combine_byte = false; while (format != end) { @@ -3975,11 +3966,6 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) bool space_flag = false; bool sharp_flag = false; bool zero_flag = false; - ptrdiff_t field_width; - bool precision_given; - uintmax_t precision = UINTMAX_MAX; - char *num_end; - char conversion; for (; ; format++) { @@ -3998,29 +3984,26 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) space_flag &= ~ plus_flag; zero_flag &= ~ minus_flag; - { - uintmax_t w = strtoumax (format, &num_end, 10); - if (max_bufsize <= w) - string_overflow (); - field_width = w; - } - precision_given = *num_end == '.'; - if (precision_given) - precision = strtoumax (num_end + 1, &num_end, 10); + char *num_end; + uintmax_t raw_field_width = strtoumax (format, &num_end, 10); + if (max_bufsize <= raw_field_width) + string_overflow (); + ptrdiff_t field_width = raw_field_width; + + bool precision_given = *num_end == '.'; + uintmax_t precision = (precision_given + ? strtoumax (num_end + 1, &num_end, 10) + : UINTMAX_MAX); format = num_end; if (format == end) error ("Format string ends in middle of format specifier"); - memset (&discarded[format0 - format_start], 1, format - format0); - conversion = *format; + char conversion = *format++; + memset (&discarded[format0 - format_start], 1, + format - format0 - (conversion == '%')); if (conversion == '%') - { - format++; - goto copy_char; - } - discarded[format - format_start] = 1; - format++; + goto copy_char; ++n; if (! (n < nargs)) @@ -4038,10 +4021,10 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) { Lisp_Object noescape = conversion == 'S' ? Qnil : Qt; args[n] = Fprin1_to_string (args[n], noescape); - info[n].converted_to_string = 1; + info[n].converted_to_string = true; if (STRING_MULTIBYTE (args[n]) && ! multibyte) { - multibyte = 1; + multibyte = true; goto retry; } } @@ -4059,16 +4042,16 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) { if (!multibyte) { - multibyte = 1; + multibyte = true; goto retry; } args[n] = Fchar_to_string (args[n]); - info[n].converted_to_string = 1; + info[n].converted_to_string = true; } if (info[n].converted_to_string) conversion = 's'; - zero_flag = 0; + zero_flag = false; } if (SYMBOLP (args[n])) @@ -4076,7 +4059,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) args[n] = SYMBOL_NAME (args[n]); if (STRING_MULTIBYTE (args[n]) && ! multibyte) { - multibyte = 1; + multibyte = true; goto retry; } } @@ -4085,9 +4068,6 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) { /* handle case (precision[n] >= 0) */ - ptrdiff_t width, padding, nbytes; - ptrdiff_t nchars_string; - ptrdiff_t prec = -1; if (precision_given && precision <= TYPE_MAXIMUM (ptrdiff_t)) prec = precision; @@ -4098,6 +4078,8 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) lisp_string_width is the right thing, and will be done, but meanwhile we work with it. */ + ptrdiff_t width, nbytes; + ptrdiff_t nchars_string; if (prec == 0) width = nchars_string = nbytes = 0; else @@ -4120,7 +4102,8 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) if (convbytes && multibyte && ! STRING_MULTIBYTE (args[n])) convbytes = count_size_as_multibyte (SDATA (args[n]), nbytes); - padding = width < field_width ? field_width - width : 0; + ptrdiff_t padding + = width < field_width ? field_width - width : 0; if (max_bufsize - padding <= convbytes) string_overflow (); @@ -4139,7 +4122,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) && !ASCII_CHAR_P (*((unsigned char *) p - 1)) && STRING_MULTIBYTE (args[n]) && !CHAR_HEAD_P (SREF (args[n], 0))) - maybe_combine_byte = 1; + maybe_combine_byte = true; p += copy_text (SDATA (args[n]), (unsigned char *) p, nbytes, @@ -4159,7 +4142,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) /* If this argument has text properties, record where in the result string it appears. */ if (string_intervals (args[n])) - info[n].intervals = arg_intervals = 1; + info[n].intervals = arg_intervals = true; continue; } @@ -4198,24 +4181,15 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) }; verify (USEFUL_PRECISION_MAX > 0); - int prec; - ptrdiff_t padding, sprintf_bytes; - uintmax_t excess_precision, numwidth; - uintmax_t leading_zeros = 0, trailing_zeros = 0; - - char sprintf_buf[SPRINTF_BUFSIZE]; - - /* Copy of conversion specification, modified somewhat. - At most three flags F can be specified at once. */ - char convspec[sizeof "%FFF.*d" + pMlen]; - /* Avoid undefined behavior in underlying sprintf. */ if (conversion == 'd' || conversion == 'i') - sharp_flag = 0; + sharp_flag = false; /* Create the copy of the conversion specification, with any width and precision removed, with ".*" inserted, - and with pM inserted for integer formats. */ + and with pM inserted for integer formats. + At most three flags F can be specified at once. */ + char convspec[sizeof "%FFF.*d" + pMlen]; { char *f = convspec; *f++ = '%'; @@ -4238,7 +4212,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) *f = '\0'; } - prec = -1; + int prec = -1; if (precision_given) prec = min (precision, USEFUL_PRECISION_MAX); @@ -4253,6 +4227,8 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) careful about integer overflow, NaNs, infinities, and conversions; for example, the min and max macros are not suitable here. */ + char sprintf_buf[SPRINTF_BUFSIZE]; + ptrdiff_t sprintf_bytes; if (conversion == 'e' || conversion == 'f' || conversion == 'g') { double x = (INTEGERP (args[n]) @@ -4317,7 +4293,8 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) padding and excess precision. Deal with excess precision first. This happens only when the format specifies ridiculously large precision. */ - excess_precision = precision - prec; + uintmax_t excess_precision = precision - prec; + uintmax_t leading_zeros = 0, trailing_zeros = 0; if (excess_precision) { if (conversion == 'e' || conversion == 'f' @@ -4344,8 +4321,9 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) /* Compute the total bytes needed for this item, including excess precision and padding. */ - numwidth = sprintf_bytes + excess_precision; - padding = numwidth < field_width ? field_width - numwidth : 0; + uintmax_t numwidth = sprintf_bytes + excess_precision; + ptrdiff_t padding + = numwidth < field_width ? field_width - numwidth : 0; if (max_bufsize - sprintf_bytes <= excess_precision || max_bufsize - padding <= numwidth) string_overflow (); @@ -4360,7 +4338,6 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) char src0 = src[0]; int exponent_bytes = 0; bool signedp = src0 == '-' || src0 == '+' || src0 == ' '; - int significand_bytes; if (zero_flag && ((src[signedp] >= '0' && src[signedp] <= '9') || (src[signedp] >= 'a' && src[signedp] <= 'f') @@ -4390,7 +4367,8 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) p += signedp; memset (p, '0', leading_zeros); p += leading_zeros; - significand_bytes = sprintf_bytes - signedp - exponent_bytes; + int significand_bytes + = sprintf_bytes - signedp - exponent_bytes; memcpy (p, src, significand_bytes); p += significand_bytes; src += significand_bytes; @@ -4460,7 +4438,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) if (p > buf && !ASCII_CHAR_P (*((unsigned char *) p - 1)) && !CHAR_HEAD_P (format_char)) - maybe_combine_byte = 1; + maybe_combine_byte = true; while (! CHAR_HEAD_P (*format)) format++; @@ -4490,31 +4468,28 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) /* There wasn't enough room to store this conversion or single character. CONVBYTES says how much room is needed. Allocate enough room (and then some) and do it again. */ - { - ptrdiff_t used = p - buf; - - if (max_bufsize - used < convbytes) - string_overflow (); - bufsize = used + convbytes; - bufsize = bufsize < max_bufsize / 2 ? bufsize * 2 : max_bufsize; - if (buf == initial_buffer) - { - buf = xmalloc (bufsize); - sa_must_free = true; - buf_save_value_index = SPECPDL_INDEX (); - record_unwind_protect_ptr (xfree, buf); - memcpy (buf, initial_buffer, used); - } - else - { - buf = xrealloc (buf, bufsize); - set_unwind_protect_ptr (buf_save_value_index, xfree, buf); - } + ptrdiff_t used = p - buf; + if (max_bufsize - used < convbytes) + string_overflow (); + bufsize = used + convbytes; + bufsize = bufsize < max_bufsize / 2 ? bufsize * 2 : max_bufsize; - p = buf + used; - } + if (buf == initial_buffer) + { + buf = xmalloc (bufsize); + sa_must_free = true; + buf_save_value_index = SPECPDL_INDEX (); + record_unwind_protect_ptr (xfree, buf); + memcpy (buf, initial_buffer, used); + } + else + { + buf = xrealloc (buf, bufsize); + set_unwind_protect_ptr (buf_save_value_index, xfree, buf); + } + p = buf + used; format = format0; n = n0; } @@ -4524,7 +4499,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) if (maybe_combine_byte) nchars = multibyte_chars_in_text ((unsigned char *) buf, p - buf); - val = make_specified_string (buf, nchars, p - buf, multibyte); + Lisp_Object val = make_specified_string (buf, nchars, p - buf, multibyte); /* If the format string has text properties, or any of the string arguments has text properties, set up text properties of the @@ -4532,17 +4507,14 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) if (string_intervals (args[0]) || arg_intervals) { - Lisp_Object len, new_len, props; - /* Add text properties from the format string. */ - len = make_number (SCHARS (args[0])); - props = text_property_list (args[0], make_number (0), len, Qnil); - + Lisp_Object len = make_number (SCHARS (args[0])); + Lisp_Object props = text_property_list (args[0], make_number (0), + len, Qnil); if (CONSP (props)) { ptrdiff_t bytepos = 0, position = 0, translated = 0; ptrdiff_t argn = 1; - Lisp_Object list; /* Adjust the bounds of each text property to the proper start and end in the output string. */ @@ -4556,15 +4528,12 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) POSITION is the untranslated char position in it, TRANSLATED is the translated char position in BUF, and ARGN is the number of the next arg we will come to. */ - for (list = props; CONSP (list); list = XCDR (list)) + for (Lisp_Object list = props; CONSP (list); list = XCDR (list)) { - Lisp_Object item; - ptrdiff_t pos; - - item = XCAR (list); + Lisp_Object item = XCAR (list); /* First adjust the property start position. */ - pos = XINT (XCAR (item)); + ptrdiff_t pos = XINT (XCAR (item)); /* Advance BYTEPOS, POSITION, TRANSLATED and ARGN up to this position. */ @@ -4611,19 +4580,19 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) /* Add text properties from arguments. */ if (arg_intervals) - for (n = 1; n < nargs; ++n) - if (info[n].intervals) + for (ptrdiff_t i = 1; i < nargs; i++) + if (info[i].intervals) { - len = make_number (SCHARS (args[n])); - new_len = make_number (info[n].end - info[n].start); - props = text_property_list (args[n], make_number (0), len, Qnil); + len = make_number (SCHARS (args[i])); + Lisp_Object new_len = make_number (info[i].end - info[i].start); + props = text_property_list (args[i], make_number (0), len, Qnil); props = extend_property_ranges (props, new_len); /* If successive arguments have properties, be sure that the value of `composition' property be the copy. */ - if (n > 1 && info[n - 1].end) + if (1 < i && info[i - 1].end) make_composition_value_copy (props); add_text_properties_from_list (val, props, - make_number (info[n].start)); + make_number (info[i].start)); } } diff --git a/test/automated/textprop-tests.el b/test/automated/textprop-tests.el index 310a7a0..f6604fb 100644 --- a/test/automated/textprop-tests.el +++ b/test/automated/textprop-tests.el @@ -24,6 +24,18 @@ (require 'ert) +(ert-deftest textprop-tests-format () + "Test ‘format’ with text properties." + ;; See Bug#21351. + (should (equal-including-properties + (format #("mouse-1, RET: %s -- w: copy %s" + 12 20 (face minibuffer-prompt) + 21 30 (face minibuffer-prompt)) + "visit" "link") + #("mouse-1, RET: visit -- w: copy link" + 12 23 (face minibuffer-prompt) + 24 35 (face minibuffer-prompt))))) + (ert-deftest textprop-tests-font-lock--remove-face-from-text-property () "Test `font-lock--remove-face-from-text-property'." (let* ((string "foobar") commit f33c164123e2bc46c4d06853b1a32130126d54c8 Author: Paul Eggert Date: Thu Aug 27 04:09:11 2015 -0700 Fix ‘format’ bug with property offsets * src/editfns.c (styled_format): Fix recently-introduced ‘format’ bug in calculating string property offsets (Bug#21351). diff --git a/src/editfns.c b/src/editfns.c index 9db4d93..bbb139f 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -4013,10 +4013,14 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) error ("Format string ends in middle of format specifier"); memset (&discarded[format0 - format_start], 1, format - format0); - conversion = *format++; + conversion = *format; if (conversion == '%') - goto copy_char; + { + format++; + goto copy_char; + } discarded[format - format_start] = 1; + format++; ++n; if (! (n < nargs)) commit 2934c21f2d74d9043420db1661704f080718873a Author: Paul Eggert Date: Thu Aug 27 02:36:56 2015 -0700 Use straight quotes in lib-src diagnostics These auxiliary programs can’t use Emacs’s text-quoting-style, and it’s too much trouble to redo that mechanism by hand. So just use straight quotes for now. * lib-src/ebrowse.c (main): * lib-src/emacsclient.c (decode_options, main): * lib-src/etags.c (Ada_help, default_C_help, Cplusplus_help) (Forth_help, HTML_help, Lisp_help, Makefile_help, Objc_help) (Perl_help, PHP_help, Python_help, Scheme_help, TeX_help, auto_help) (none_help, print_language_names, print_help, add_regex) (suggest_asking_for_help): * lib-src/make-docfile.c (write_c_args, scan_c_stream): Use straight quotes in diagnostics. diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index 5c1e9d9..09edc7d 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c @@ -3747,27 +3747,27 @@ main (int argc, char **argv) fp = fopen (out_filename, "r"); if (fp == NULL) { - yyerror ("file `%s' must exist for --append", out_filename); + yyerror ("file '%s' must exist for --append", out_filename); exit (EXIT_FAILURE); } rc = fseek (fp, 0, SEEK_END); if (rc == -1) { - yyerror ("error seeking in file `%s'", out_filename); + yyerror ("error seeking in file '%s'", out_filename); exit (EXIT_FAILURE); } rc = ftell (fp); if (rc == -1) { - yyerror ("error getting size of file `%s'", out_filename); + yyerror ("error getting size of file '%s'", out_filename); exit (EXIT_FAILURE); } else if (rc == 0) { - yyerror ("file `%s' is empty", out_filename); + yyerror ("file '%s' is empty", out_filename); /* It may be ok to use an empty file for appending. exit (EXIT_FAILURE); */ } @@ -3778,7 +3778,7 @@ main (int argc, char **argv) yyout = fopen (out_filename, f_append ? "a" : "w"); if (yyout == NULL) { - yyerror ("cannot open output file `%s'", out_filename); + yyerror ("cannot open output file '%s'", out_filename); exit (EXIT_FAILURE); } } @@ -3806,7 +3806,7 @@ main (int argc, char **argv) FILE *fp = fopen (input_filenames[i], "r"); if (fp == NULL) - yyerror ("cannot open input file `%s'", input_filenames[i]); + yyerror ("cannot open input file '%s'", input_filenames[i]); else { char *file; diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 4426240..c3e5635 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -539,7 +539,7 @@ decode_options (int argc, char **argv) break; default: - message (true, "Try `%s --help' for more information\n", progname); + message (true, "Try '%s --help' for more information\n", progname); exit (EXIT_FAILURE); break; } @@ -1611,7 +1611,7 @@ main (int argc, char **argv) if ((argc - optind < 1) && !eval && current_frame) { message (true, "%s: file name or argument required\n" - "Try `%s --help' for more information\n", + "Try '%s --help' for more information\n", progname, progname); exit (EXIT_FAILURE); } diff --git a/lib-src/etags.c b/lib-src/etags.c index 8b7f53c..f34c985 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -515,7 +515,7 @@ static const char *Ada_suffixes [] = { "ads", "adb", "ada", NULL }; static const char Ada_help [] = "In Ada code, functions, procedures, packages, tasks and types are\n\ -tags. Use the `--packages-only' option to create tags for\n\ +tags. Use the '--packages-only' option to create tags for\n\ packages only.\n\ Ada tag names have suffixes indicating the type of entity:\n\ Entity type: Qualifier:\n\ @@ -526,9 +526,9 @@ Ada tag names have suffixes indicating the type of entity:\n\ package body /b\n\ type /t\n\ task /k\n\ -Thus, `M-x find-tag bidule/b ' will go directly to the\n\ -body of the package `bidule', while `M-x find-tag bidule '\n\ -will just search for any tag `bidule'."; +Thus, 'M-x find-tag bidule/b ' will go directly to the\n\ +body of the package 'bidule', while 'M-x find-tag bidule '\n\ +will just search for any tag 'bidule'."; /* Assembly code */ static const char *Asm_suffixes [] = @@ -555,22 +555,22 @@ static const char *default_C_suffixes [] = #if CTAGS /* C help for Ctags */ static const char default_C_help [] = "In C code, any C function is a tag. Use -t to tag typedefs.\n\ -Use -T to tag definitions of `struct', `union' and `enum'.\n\ -Use -d to tag `#define' macro definitions and `enum' constants.\n\ +Use -T to tag definitions of 'struct', 'union' and 'enum'.\n\ +Use -d to tag '#define' macro definitions and 'enum' constants.\n\ Use --globals to tag global variables.\n\ You can tag function declarations and external variables by\n\ -using `--declarations', and struct members by using `--members'."; +using '--declarations', and struct members by using '--members'."; #else /* C help for Etags */ static const char default_C_help [] = "In C code, any C function or typedef is a tag, and so are\n\ -definitions of `struct', `union' and `enum'. `#define' macro\n\ -definitions and `enum' constants are tags unless you specify\n\ -`--no-defines'. Global variables are tags unless you specify\n\ -`--no-globals' and so are struct members unless you specify\n\ -`--no-members'. Use of `--no-globals', `--no-defines' and\n\ -`--no-members' can make the tags table file much smaller.\n\ +definitions of 'struct', 'union' and 'enum'. '#define' macro\n\ +definitions and 'enum' constants are tags unless you specify\n\ +'--no-defines'. Global variables are tags unless you specify\n\ +'--no-globals' and so are struct members unless you specify\n\ +'--no-members'. Use of '--no-globals', '--no-defines' and\n\ +'--no-members' can make the tags table file much smaller.\n\ You can tag function declarations and external variables by\n\ -using `--declarations'."; +using '--declarations'."; #endif /* C help for Ctags and Etags */ static const char *Cplusplus_suffixes [] = @@ -582,10 +582,10 @@ static const char Cplusplus_help [] = "In C++ code, all the tag constructs of C code are tagged. (Use\n\ --help --lang=c --lang=c++ for full help.)\n\ In addition to C tags, member functions are also recognized. Member\n\ -variables are recognized unless you use the `--no-members' option.\n\ -Tags for variables and functions in classes are named `CLASS::VARIABLE'\n\ -and `CLASS::FUNCTION'. `operator' definitions have tag names like\n\ -`operator+'."; +variables are recognized unless you use the '--no-members' option.\n\ +Tags for variables and functions in classes are named 'CLASS::VARIABLE'\n\ +and 'CLASS::FUNCTION'. 'operator' definitions have tag names like\n\ +'operator+'."; static const char *Cjava_suffixes [] = { "java", NULL }; @@ -612,7 +612,7 @@ defined in the file."; const char *Forth_suffixes [] = { "fth", "tok", NULL }; static const char Forth_help [] = -"In Forth code, tags are words defined by `:',\n\ +"In Forth code, tags are words defined by ':',\n\ constant, code, create, defer, value, variable, buffer:, field."; static const char *Fortran_suffixes [] = @@ -623,18 +623,18 @@ static const char Fortran_help [] = static const char *HTML_suffixes [] = { "htm", "html", "shtml", NULL }; static const char HTML_help [] = -"In HTML input files, the tags are the `title' and the `h1', `h2',\n\ -`h3' headers. Also, tags are `name=' in anchors and all\n\ -occurrences of `id='."; +"In HTML input files, the tags are the 'title' and the 'h1', 'h2',\n\ +'h3' headers. Also, tags are 'name=' in anchors and all\n\ +occurrences of 'id='."; static const char *Lisp_suffixes [] = { "cl", "clisp", "el", "l", "lisp", "LSP", "lsp", "ml", NULL }; static const char Lisp_help [] = -"In Lisp code, any function defined with `defun', any variable\n\ -defined with `defvar' or `defconst', and in general the first\n\ -argument of any expression that starts with `(def' in column zero\n\ +"In Lisp code, any function defined with 'defun', any variable\n\ +defined with 'defvar' or 'defconst', and in general the first\n\ +argument of any expression that starts with '(def' in column zero\n\ is a tag.\n\ -The `--declarations' option tags \"(defvar foo)\" constructs too."; +The '--declarations' option tags \"(defvar foo)\" constructs too."; static const char *Lua_suffixes [] = { "lua", "LUA", NULL }; @@ -645,7 +645,7 @@ static const char *Makefile_filenames [] = { "Makefile", "makefile", "GNUMakefile", "Makefile.in", "Makefile.am", NULL}; static const char Makefile_help [] = "In makefiles, targets are tags; additionally, variables are tags\n\ -unless you specify `--no-globals'."; +unless you specify '--no-globals'."; static const char *Objc_suffixes [] = { "lm", /* Objective lex file */ @@ -654,7 +654,7 @@ static const char *Objc_suffixes [] = static const char Objc_help [] = "In Objective C code, tags include Objective C definitions for classes,\n\ class categories, methods and protocols. Tags for variables and\n\ -functions in classes are named `CLASS::VARIABLE' and `CLASS::FUNCTION'.\n\ +functions in classes are named 'CLASS::VARIABLE' and 'CLASS::FUNCTION'.\n\ (Use --help --lang=c --lang=objc --lang=java for full help.)"; static const char *Pascal_suffixes [] = @@ -670,16 +670,16 @@ static const char *Perl_interpreters [] = { "perl", "@PERL@", NULL }; static const char Perl_help [] = "In Perl code, the tags are the packages, subroutines and variables\n\ -defined by the `package', `sub', `my' and `local' keywords. Use\n\ -`--globals' if you want to tag global variables. Tags for\n\ -subroutines are named `PACKAGE::SUB'. The name for subroutines\n\ -defined in the default package is `main::SUB'."; +defined by the 'package', 'sub', 'my' and 'local' keywords. Use\n\ +'--globals' if you want to tag global variables. Tags for\n\ +subroutines are named 'PACKAGE::SUB'. The name for subroutines\n\ +defined in the default package is 'main::SUB'."; static const char *PHP_suffixes [] = { "php", "php3", "php4", NULL }; static const char PHP_help [] = "In PHP code, tags are functions, classes and defines. Unless you use\n\ -the `--no-members' option, vars are tags too."; +the '--no-members' option, vars are tags too."; static const char *plain_C_suffixes [] = { "pc", /* Pro*C file */ @@ -699,28 +699,28 @@ line."; static const char *Python_suffixes [] = { "py", NULL }; static const char Python_help [] = -"In Python code, `def' or `class' at the beginning of a line\n\ +"In Python code, 'def' or 'class' at the beginning of a line\n\ generate a tag."; /* Can't do the `SCM' or `scm' prefix with a version number. */ static const char *Scheme_suffixes [] = { "oak", "sch", "scheme", "SCM", "scm", "SM", "sm", "ss", "t", NULL }; static const char Scheme_help [] = -"In Scheme code, tags include anything defined with `def' or with a\n\ -construct whose name starts with `def'. They also include\n\ -variables set with `set!' at top level in the file."; +"In Scheme code, tags include anything defined with 'def' or with a\n\ +construct whose name starts with 'def'. They also include\n\ +variables set with 'set!' at top level in the file."; static const char *TeX_suffixes [] = { "bib", "clo", "cls", "ltx", "sty", "TeX", "tex", NULL }; static const char TeX_help [] = -"In LaTeX text, the argument of any of the commands `\\chapter',\n\ -`\\section', `\\subsection', `\\subsubsection', `\\eqno', `\\label',\n\ -`\\ref', `\\cite', `\\bibitem', `\\part', `\\appendix', `\\entry',\n\ -`\\index', `\\def', `\\newcommand', `\\renewcommand',\n\ -`\\newenvironment' or `\\renewenvironment' is a tag.\n\ +"In LaTeX text, the argument of any of the commands '\\chapter',\n\ +'\\section', '\\subsection', '\\subsubsection', '\\eqno', '\\label',\n\ +'\\ref', '\\cite', '\\bibitem', '\\part', '\\appendix', '\\entry',\n\ +'\\index', '\\def', '\\newcommand', '\\renewcommand',\n\ +'\\newenvironment' or '\\renewenvironment' is a tag.\n\ \n\ Other commands can be specified by setting the environment variable\n\ -`TEXTAGS' to a colon-separated list like, for example,\n\ +'TEXTAGS' to a colon-separated list like, for example,\n\ TEXTAGS=\"mycommand:myothercommand\"."; @@ -738,11 +738,11 @@ C code are parsed as C code (use --help --lang=c --lang=yacc\n\ for full help)."; static const char auto_help [] = -"`auto' is not a real language, it indicates to use\n\ +"'auto' is not a real language, it indicates to use\n\ a default language for files base on file name suffix and file contents."; static const char none_help [] = -"`none' is not a real language, it indicates to only do\n\ +"'none' is not a real language, it indicates to only do\n\ regexp processing on files."; static const char no_lang_help [] = @@ -809,8 +809,8 @@ default file names and dot suffixes:"); printf (" .%s", *ext); puts (""); } - puts ("where `auto' means use default language for files based on file\n\ -name suffix, and `none' means only do regexp processing on files.\n\ + puts ("where 'auto' means use default language for files based on file\n\ +name suffix, and 'none' means only do regexp processing on files.\n\ If no language is specified and no matching suffix is found,\n\ the first line of the file is read for a sharp-bang (#!) sequence\n\ followed by the name of an interpreter. If no such sequence is found,\n\ @@ -950,8 +950,8 @@ Relative ones are stored relative to the output file's directory.\n"); puts (" If TAGNAME/ is present, the tags created are named.\n\ For example Tcl named tags can be created with:\n\ --regex=\"/proc[ \\t]+\\([^ \\t]+\\)/\\1/.\".\n\ - MODS are optional one-letter modifiers: `i' means to ignore case,\n\ - `m' means to allow multi-line matches, `s' implies `m' and\n\ + MODS are optional one-letter modifiers: 'i' means to ignore case,\n\ + 'm' means to allow multi-line matches, 's' implies 'm' and\n\ causes dot to match any character, including newline."); puts ("-R, --no-regex\n\ @@ -1012,7 +1012,7 @@ Relative ones are stored relative to the output file's directory.\n"); Print the version of the program.\n\ -h, --help\n\ Print this help message.\n\ - Followed by one or more `--language' options prints detailed\n\ + Followed by one or more '--language' options prints detailed\n\ help about tag generation for the specified languages."); print_language_names (); @@ -5797,7 +5797,7 @@ add_regex (char *regexp_pattern, language *lang) need_filebuf = true; break; default: - error ("invalid regexp modifier `%c', ignoring", modifiers[0]); + error ("invalid regexp modifier '%c', ignoring", modifiers[0]); break; } @@ -6368,7 +6368,7 @@ pfatal (const char *s1) static void suggest_asking_for_help (void) { - fprintf (stderr, "\tTry `%s --help' for a complete list of options.\n", + fprintf (stderr, "\tTry '%s --help' for a complete list of options.\n", progname); exit (EXIT_FAILURE); } diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index bada8df..3d8f34f 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -507,7 +507,7 @@ write_c_args (char *func, char *buf, int minargs, int maxargs) { if (ident_length == 0) { - error ("empty arg list for `%s' should be (void), not ()", func); + error ("empty arg list for '%s' should be (void), not ()", func); continue; } @@ -1163,7 +1163,7 @@ scan_c_stream (FILE *infile) } else if (defunflag && maxargs == -1 && !saw_usage) /* The DOC should provide the usage form. */ - fprintf (stderr, "Missing `usage' for function `%s'.\n", + fprintf (stderr, "Missing 'usage' for function '%s'.\n", input_buffer); } } commit 862561f4a642416259ed265ba8c5071cffa4f303 Author: Paul Eggert Date: Thu Aug 27 02:24:48 2015 -0700 ‘text-quoting-style’ fixes for admin * admin/admin.el (cusver-scan, cusver-check): * admin/authors.el (authors-canonical-file-name): * admin/bzrmerge.el (bzrmerge-missing): Respect ‘text-quoting-style’ in diagnostics. diff --git a/admin/admin.el b/admin/admin.el index 914f187..6b213a7 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -674,8 +674,8 @@ If optional argument OLD is non-nil, also scan for `defvar's." (and (not old) (equal "custom" (match-string 2)) (not (memq :type form)) - (display-warning 'custom - (format "Missing type in: `%s'" form))) + (display-warning + 'custom (format-message "Missing type in: `%s'" form))) (setq ver (car (cdr-safe (memq :version form)))) (if (equal "group" (match-string 2)) ;; Group :version could be old. @@ -689,7 +689,7 @@ If optional argument OLD is non-nil, also scan for `defvar's." (setq grp (car (cdr-safe grp))) ; (quote foo) -> foo (setq ver (assq grp glist)))) (setq alist (cons (cons var ver) alist)))) - (if form (message "Malformed defcustom: `%s'" form))))) + (if form (format-message "Malformed defcustom: `%s'" form))))) (message "%sdone" m) alist)) @@ -781,7 +781,8 @@ changes (in a non-trivial way). This function does not check for that." (message "No missing :version tags") (pop-to-buffer "*cusver*") (erase-buffer) - (insert "These `defcustom's might be missing :version tags:\n\n") + (insert (substitute-command-keys + "These `defcustom's might be missing :version tags:\n\n")) (dolist (elem result) (let* ((str (file-relative-name (car elem) newdir)) (strlen (length str))) diff --git a/admin/authors.el b/admin/authors.el index 547e046..0afb3a8 100644 --- a/admin/authors.el +++ b/admin/authors.el @@ -1078,10 +1078,10 @@ to print a message if FILE is not found." (string-match "^[0-9.]+$" file) laxlog) (setq authors-invalid-file-names - (cons (format "%s:%d: unrecognized `%s' for %s" - log-file - (1+ (count-lines (point-min) pos)) - file author) + (cons (format-message "%s:%d: unrecognized `%s' for %s" + log-file + (1+ (count-lines (point-min) pos)) + file author) authors-invalid-file-names))) valid))) diff --git a/admin/bzrmerge.el b/admin/bzrmerge.el index 7d4cd19..1bcbaa2 100644 --- a/admin/bzrmerge.el +++ b/admin/bzrmerge.el @@ -140,11 +140,11 @@ are both lists of revnos, in oldest-first order." (setq str (substring str (match-end 0)))) (when (string-match "[.!;, ]+\\'" str) (setq str (substring str 0 (match-beginning 0)))) - (let ((help-form "\ + (let ((help-form (substitute-command-keys "\ Type `y' to skip this revision, `N' to include it and go on to the next revision, `n' to not skip, but continue to search this log entry for skip regexps, -`q' to quit merging.")) +`q' to quit merging."))) (pcase (save-excursion (read-char-choice (format "%s: Skip (y/n/N/q/%s)? " str