diff options
| author | Paul Eggert | 2015-05-31 23:52:09 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-05-31 23:53:45 -0700 |
| commit | 2c656f7deb3b192a5063151368782c2715e81051 (patch) | |
| tree | 94f93fae541ca21c126c53162242ae8403b8c9f3 /src | |
| parent | 467af178f53798e4cd102e04eb2990121eb655df (diff) | |
| download | emacs-2c656f7deb3b192a5063151368782c2715e81051.tar.gz emacs-2c656f7deb3b192a5063151368782c2715e81051.zip | |
Avoid grave accent quoting in stderr diagnostics
A few Emacs diagnostics go directly to stderr, and so can't easily
contain curved quotes (as non-UTF-8 locales might mishandle them).
Instead of bothering to add support for this rarity, reword the
diagnostics so that they don't use grave accent to quote.
* src/alloc.c (mark_memory): Fix comment.
* src/buffer.c (init_buffer):
* src/dispnew.c (init_display):
* src/emacs.c (main, sort_args):
* src/lread.c (dir_warning):
* src/term.c (init_tty):
* src/unexmacosx.c (unexec):
* src/xfns.c (select_visual):
* src/xterm.c (cvt_string_to_pixel, x_io_error_quitter):
Reword stderr diagnostics to avoid quoting `like this'.
* src/unexmacosx.c: Include errno.h.
* src/xfns.c (select_visual): Encode value for locale.
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 2 | ||||
| -rw-r--r-- | src/buffer.c | 4 | ||||
| -rw-r--r-- | src/dispnew.c | 4 | ||||
| -rw-r--r-- | src/emacs.c | 8 | ||||
| -rw-r--r-- | src/lread.c | 5 | ||||
| -rw-r--r-- | src/term.c | 16 | ||||
| -rw-r--r-- | src/unexmacosx.c | 5 | ||||
| -rw-r--r-- | src/xfns.c | 3 | ||||
| -rw-r--r-- | src/xterm.c | 4 |
9 files changed, 27 insertions, 24 deletions
diff --git a/src/alloc.c b/src/alloc.c index 14baf291bd8..a956e95bf14 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -4775,7 +4775,7 @@ mark_memory (void *start, void *end) | |||
| 4775 | Lisp_Object obj = build_string ("test"); | 4775 | Lisp_Object obj = build_string ("test"); |
| 4776 | struct Lisp_String *s = XSTRING (obj); | 4776 | struct Lisp_String *s = XSTRING (obj); |
| 4777 | Fgarbage_collect (); | 4777 | Fgarbage_collect (); |
| 4778 | fprintf (stderr, "test `%s'\n", s->data); | 4778 | fprintf (stderr, "test '%s'\n", s->data); |
| 4779 | return Qnil; | 4779 | return Qnil; |
| 4780 | } | 4780 | } |
| 4781 | 4781 | ||
diff --git a/src/buffer.c b/src/buffer.c index 13843a2ac4d..0b98431eb0e 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5285,7 +5285,7 @@ init_buffer (int initialized) | |||
| 5285 | pwd = get_current_dir_name (); | 5285 | pwd = get_current_dir_name (); |
| 5286 | 5286 | ||
| 5287 | if (!pwd) | 5287 | if (!pwd) |
| 5288 | fatal ("`get_current_dir_name' failed: %s\n", strerror (errno)); | 5288 | fatal ("get_current_dir_name: %s\n", strerror (errno)); |
| 5289 | 5289 | ||
| 5290 | /* Maybe this should really use some standard subroutine | 5290 | /* Maybe this should really use some standard subroutine |
| 5291 | whose definition is filename syntax dependent. */ | 5291 | whose definition is filename syntax dependent. */ |
| @@ -5295,7 +5295,7 @@ init_buffer (int initialized) | |||
| 5295 | /* Grow buffer to add directory separator and '\0'. */ | 5295 | /* Grow buffer to add directory separator and '\0'. */ |
| 5296 | pwd = realloc (pwd, len + 2); | 5296 | pwd = realloc (pwd, len + 2); |
| 5297 | if (!pwd) | 5297 | if (!pwd) |
| 5298 | fatal ("`get_current_dir_name' failed: %s\n", strerror (errno)); | 5298 | fatal ("get_current_dir_name: %s\n", strerror (errno)); |
| 5299 | pwd[len] = DIRECTORY_SEP; | 5299 | pwd[len] = DIRECTORY_SEP; |
| 5300 | pwd[len + 1] = '\0'; | 5300 | pwd[len + 1] = '\0'; |
| 5301 | len++; | 5301 | len++; |
diff --git a/src/dispnew.c b/src/dispnew.c index 7e7afa71d20..1fc3cfeef44 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -6036,10 +6036,10 @@ init_display (void) | |||
| 6036 | { | 6036 | { |
| 6037 | #ifdef HAVE_WINDOW_SYSTEM | 6037 | #ifdef HAVE_WINDOW_SYSTEM |
| 6038 | if (! inhibit_window_system) | 6038 | if (! inhibit_window_system) |
| 6039 | fprintf (stderr, "Please set the environment variable DISPLAY or TERM (see `tset').\n"); | 6039 | fprintf (stderr, "Please set the environment variable DISPLAY or TERM (see 'tset').\n"); |
| 6040 | else | 6040 | else |
| 6041 | #endif /* HAVE_WINDOW_SYSTEM */ | 6041 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 6042 | fprintf (stderr, "Please set the environment variable TERM; see `tset'.\n"); | 6042 | fprintf (stderr, "Please set the environment variable TERM; see 'tset'.\n"); |
| 6043 | exit (1); | 6043 | exit (1); |
| 6044 | } | 6044 | } |
| 6045 | 6045 | ||
diff --git a/src/emacs.c b/src/emacs.c index bba68068a83..8396f5d4e45 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -776,12 +776,12 @@ main (int argc, char **argv) | |||
| 776 | tem2 = Fsymbol_value (intern_c_string ("emacs-copyright")); | 776 | tem2 = Fsymbol_value (intern_c_string ("emacs-copyright")); |
| 777 | if (!STRINGP (tem)) | 777 | if (!STRINGP (tem)) |
| 778 | { | 778 | { |
| 779 | fprintf (stderr, "Invalid value of `emacs-version'\n"); | 779 | fprintf (stderr, "Invalid value of 'emacs-version'\n"); |
| 780 | exit (1); | 780 | exit (1); |
| 781 | } | 781 | } |
| 782 | if (!STRINGP (tem2)) | 782 | if (!STRINGP (tem2)) |
| 783 | { | 783 | { |
| 784 | fprintf (stderr, "Invalid value of `emacs-copyright'\n"); | 784 | fprintf (stderr, "Invalid value of 'emacs-copyright'\n"); |
| 785 | exit (1); | 785 | exit (1); |
| 786 | } | 786 | } |
| 787 | else | 787 | else |
| @@ -1796,7 +1796,7 @@ sort_args (int argc, char **argv) | |||
| 1796 | options[from] = standard_args[i].nargs; | 1796 | options[from] = standard_args[i].nargs; |
| 1797 | priority[from] = standard_args[i].priority; | 1797 | priority[from] = standard_args[i].priority; |
| 1798 | if (from + standard_args[i].nargs >= argc) | 1798 | if (from + standard_args[i].nargs >= argc) |
| 1799 | fatal ("Option `%s' requires an argument\n", argv[from]); | 1799 | fatal ("Option '%s' requires an argument\n", argv[from]); |
| 1800 | from += standard_args[i].nargs; | 1800 | from += standard_args[i].nargs; |
| 1801 | goto done; | 1801 | goto done; |
| 1802 | } | 1802 | } |
| @@ -1833,7 +1833,7 @@ sort_args (int argc, char **argv) | |||
| 1833 | if (equals != 0) | 1833 | if (equals != 0) |
| 1834 | options[from] = 0; | 1834 | options[from] = 0; |
| 1835 | if (from + options[from] >= argc) | 1835 | if (from + options[from] >= argc) |
| 1836 | fatal ("Option `%s' requires an argument\n", argv[from]); | 1836 | fatal ("Option '%s' requires an argument\n", argv[from]); |
| 1837 | from += options[from]; | 1837 | from += options[from]; |
| 1838 | } | 1838 | } |
| 1839 | /* FIXME When match < 0, shouldn't there be some error, | 1839 | /* FIXME When match < 0, shouldn't there be some error, |
diff --git a/src/lread.c b/src/lread.c index 26c19d8338b..11c8d0031c9 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -4418,9 +4418,10 @@ init_lread (void) | |||
| 4418 | void | 4418 | void |
| 4419 | dir_warning (char const *use, Lisp_Object dirname) | 4419 | dir_warning (char const *use, Lisp_Object dirname) |
| 4420 | { | 4420 | { |
| 4421 | static char const format[] = "Warning: %s `%s': %s\n"; | 4421 | static char const format[] = "Warning: %s '%s': %s\n"; |
| 4422 | int access_errno = errno; | 4422 | int access_errno = errno; |
| 4423 | fprintf (stderr, format, use, SSDATA (dirname), strerror (access_errno)); | 4423 | fprintf (stderr, format, use, SSDATA (ENCODE_SYSTEM (dirname)), |
| 4424 | strerror (access_errno)); | ||
| 4424 | 4425 | ||
| 4425 | /* Don't log the warning before we've initialized!! */ | 4426 | /* Don't log the warning before we've initialized!! */ |
| 4426 | if (initialized) | 4427 | if (initialized) |
diff --git a/src/term.c b/src/term.c index d2a9c3d1f30..8ebb620dd9b 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -4028,12 +4028,12 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed) | |||
| 4028 | "Terminal type %s is not defined", | 4028 | "Terminal type %s is not defined", |
| 4029 | "Terminal type %s is not defined.\n\ | 4029 | "Terminal type %s is not defined.\n\ |
| 4030 | If that is not the actual type of terminal you have,\n\ | 4030 | If that is not the actual type of terminal you have,\n\ |
| 4031 | use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ | 4031 | use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\ |
| 4032 | `setenv TERM ...') to specify the correct type. It may be necessary\n" | 4032 | 'setenv TERM ...') to specify the correct type. It may be necessary\n" |
| 4033 | #ifdef TERMINFO | 4033 | #ifdef TERMINFO |
| 4034 | "to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.", | 4034 | "to do 'unset TERMINFO' (C-shell: 'unsetenv TERMINFO') as well.", |
| 4035 | #else | 4035 | #else |
| 4036 | "to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", | 4036 | "to do 'unset TERMCAP' (C-shell: 'unsetenv TERMCAP') as well.", |
| 4037 | #endif | 4037 | #endif |
| 4038 | terminal_type); | 4038 | terminal_type); |
| 4039 | } | 4039 | } |
| @@ -4307,12 +4307,12 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ | |||
| 4307 | "Terminal type \"%s\" is not powerful enough to run Emacs.\n\ | 4307 | "Terminal type \"%s\" is not powerful enough to run Emacs.\n\ |
| 4308 | It lacks the ability to position the cursor.\n\ | 4308 | It lacks the ability to position the cursor.\n\ |
| 4309 | If that is not the actual type of terminal you have,\n\ | 4309 | If that is not the actual type of terminal you have,\n\ |
| 4310 | use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ | 4310 | use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\ |
| 4311 | `setenv TERM ...') to specify the correct type. It may be necessary\n" | 4311 | 'setenv TERM ...') to specify the correct type. It may be necessary\n" |
| 4312 | # ifdef TERMINFO | 4312 | # ifdef TERMINFO |
| 4313 | "to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.", | 4313 | "to do 'unset TERMINFO' (C-shell: 'unsetenv TERMINFO') as well.", |
| 4314 | # else /* TERMCAP */ | 4314 | # else /* TERMCAP */ |
| 4315 | "to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", | 4315 | "to do 'unset TERMCAP' (C-shell: 'unsetenv TERMCAP') as well.", |
| 4316 | # endif /* TERMINFO */ | 4316 | # endif /* TERMINFO */ |
| 4317 | terminal_type); | 4317 | terminal_type); |
| 4318 | } | 4318 | } |
diff --git a/src/unexmacosx.c b/src/unexmacosx.c index fe6637e2ef5..319ec7956e5 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c | |||
| @@ -99,6 +99,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 99 | #include "unexec.h" | 99 | #include "unexec.h" |
| 100 | #include "lisp.h" | 100 | #include "lisp.h" |
| 101 | 101 | ||
| 102 | #include <errno.h> | ||
| 102 | #include <stdio.h> | 103 | #include <stdio.h> |
| 103 | #include <fcntl.h> | 104 | #include <fcntl.h> |
| 104 | #include <stdarg.h> | 105 | #include <stdarg.h> |
| @@ -1264,14 +1265,14 @@ unexec (const char *outfile, const char *infile) | |||
| 1264 | infd = emacs_open (infile, O_RDONLY, 0); | 1265 | infd = emacs_open (infile, O_RDONLY, 0); |
| 1265 | if (infd < 0) | 1266 | if (infd < 0) |
| 1266 | { | 1267 | { |
| 1267 | unexec_error ("cannot open input file `%s'", infile); | 1268 | unexec_error ("%s: %s", infile, strerror (errno)); |
| 1268 | } | 1269 | } |
| 1269 | 1270 | ||
| 1270 | outfd = emacs_open (outfile, O_WRONLY | O_TRUNC | O_CREAT, 0777); | 1271 | outfd = emacs_open (outfile, O_WRONLY | O_TRUNC | O_CREAT, 0777); |
| 1271 | if (outfd < 0) | 1272 | if (outfd < 0) |
| 1272 | { | 1273 | { |
| 1273 | emacs_close (infd); | 1274 | emacs_close (infd); |
| 1274 | unexec_error ("cannot open output file `%s'", outfile); | 1275 | unexec_error ("%s: %s", outfile, strerror (errno)); |
| 1275 | } | 1276 | } |
| 1276 | 1277 | ||
| 1277 | build_region_list (); | 1278 | build_region_list (); |
diff --git a/src/xfns.c b/src/xfns.c index 16a568e9153..634881d0a66 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -4519,7 +4519,8 @@ select_visual (struct x_display_info *dpyinfo) | |||
| 4519 | if (class == -1 | 4519 | if (class == -1 |
| 4520 | || !XMatchVisualInfo (dpy, XScreenNumberOfScreen (screen), | 4520 | || !XMatchVisualInfo (dpy, XScreenNumberOfScreen (screen), |
| 4521 | dpyinfo->n_planes, class, &vinfo)) | 4521 | dpyinfo->n_planes, class, &vinfo)) |
| 4522 | fatal ("Invalid visual specification `%s'", SDATA (value)); | 4522 | fatal ("Invalid visual specification '%s'", |
| 4523 | SSDATA (ENCODE_SYSTEM (value))); | ||
| 4523 | 4524 | ||
| 4524 | dpyinfo->visual = vinfo.visual; | 4525 | dpyinfo->visual = vinfo.visual; |
| 4525 | } | 4526 | } |
diff --git a/src/xterm.c b/src/xterm.c index 4f5dfed9ae8..17c1a645d98 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -2091,7 +2091,7 @@ cvt_string_to_pixel (Display *dpy, XrmValue *args, Cardinal *nargs, | |||
| 2091 | params[0] = color_name; | 2091 | params[0] = color_name; |
| 2092 | XtAppWarningMsg (XtDisplayToApplicationContext (dpy), | 2092 | XtAppWarningMsg (XtDisplayToApplicationContext (dpy), |
| 2093 | "badValue", "cvt_string_to_pixel", | 2093 | "badValue", "cvt_string_to_pixel", |
| 2094 | "XtToolkitError", "Invalid color `%s'", | 2094 | "XtToolkitError", "Invalid color '%s'", |
| 2095 | params, &nparams); | 2095 | params, &nparams); |
| 2096 | return False; | 2096 | return False; |
| 2097 | } | 2097 | } |
| @@ -9388,7 +9388,7 @@ x_io_error_quitter (Display *display) | |||
| 9388 | { | 9388 | { |
| 9389 | char buf[256]; | 9389 | char buf[256]; |
| 9390 | 9390 | ||
| 9391 | snprintf (buf, sizeof buf, "Connection lost to X server `%s'", | 9391 | snprintf (buf, sizeof buf, "Connection lost to X server '%s'", |
| 9392 | DisplayString (display)); | 9392 | DisplayString (display)); |
| 9393 | x_connection_closed (display, buf, true); | 9393 | x_connection_closed (display, buf, true); |
| 9394 | return 0; | 9394 | return 0; |