diff options
| author | Paul Eggert | 2015-01-21 20:21:45 -0800 |
|---|---|---|
| committer | Paul Eggert | 2015-01-21 20:29:42 -0800 |
| commit | 8dd58a2d1fedaa16573bc67e986dc2014620c681 (patch) | |
| tree | 14d570f1ebf867a8feb07cfe3d3a385989643e1f /src/fileio.c | |
| parent | 938bca8e4141f5f96497f9be26b0ea0bb90f40cd (diff) | |
| download | emacs-8dd58a2d1fedaa16573bc67e986dc2014620c681.tar.gz emacs-8dd58a2d1fedaa16573bc67e986dc2014620c681.zip | |
Don't downcase system diagnostics' first letters
* etc/NEWS: Document this.
* lisp/emacs-lisp/bytecomp.el (byte-compile-file):
* lisp/ffap.el (find-file-at-point):
* lisp/files.el (insert-file-1):
* lisp/net/ange-ftp.el (ange-ftp-barf-if-not-directory)
(ange-ftp-copy-file-internal):
* lisp/progmodes/etags.el (visit-tags-table):
* lisp/url/url-dav.el (url-dav-delete-directory, url-dav-delete-file)
(url-dav-directory-files):
Keep diagnostics consistent with system's.
* lisp/erc/erc-dcc.el (erc-dcc-server):
* lisp/ffap.el (ffap-machine-p):
Ignore case while comparing diagnostics.
* src/fileio.c (report_file_errno): Don't downcase, and simplify.
Fixes: bug#19642
Diffstat (limited to 'src/fileio.c')
| -rw-r--r-- | src/fileio.c | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/src/fileio.c b/src/fileio.c index ff6720d4ae2..d0fd08a742e 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -186,37 +186,17 @@ void | |||
| 186 | report_file_errno (char const *string, Lisp_Object name, int errorno) | 186 | report_file_errno (char const *string, Lisp_Object name, int errorno) |
| 187 | { | 187 | { |
| 188 | Lisp_Object data = CONSP (name) || NILP (name) ? name : list1 (name); | 188 | Lisp_Object data = CONSP (name) || NILP (name) ? name : list1 (name); |
| 189 | Lisp_Object errstring; | ||
| 190 | char *str; | ||
| 191 | |||
| 192 | synchronize_system_messages_locale (); | 189 | synchronize_system_messages_locale (); |
| 193 | str = strerror (errorno); | 190 | char *str = strerror (errorno); |
| 194 | errstring = code_convert_string_norecord (build_unibyte_string (str), | 191 | Lisp_Object errstring |
| 195 | Vlocale_coding_system, 0); | 192 | = code_convert_string_norecord (build_unibyte_string (str), |
| 196 | 193 | Vlocale_coding_system, 0); | |
| 197 | while (1) | 194 | Lisp_Object errdata = Fcons (errstring, data); |
| 198 | switch (errorno) | 195 | |
| 199 | { | 196 | if (errorno == EEXIST) |
| 200 | case EEXIST: | 197 | xsignal (Qfile_already_exists, errdata); |
| 201 | xsignal (Qfile_already_exists, Fcons (errstring, data)); | 198 | else |
| 202 | break; | 199 | xsignal (Qfile_error, Fcons (build_string (string), errdata)); |
| 203 | default: | ||
| 204 | /* System error messages are capitalized. Downcase the initial | ||
| 205 | unless it is followed by a slash. (The slash case caters to | ||
| 206 | error messages that begin with "I/O" or, in German, "E/A".) */ | ||
| 207 | if (STRING_MULTIBYTE (errstring) | ||
| 208 | && ! EQ (Faref (errstring, make_number (1)), make_number ('/'))) | ||
| 209 | { | ||
| 210 | int c; | ||
| 211 | |||
| 212 | str = SSDATA (errstring); | ||
| 213 | c = STRING_CHAR ((unsigned char *) str); | ||
| 214 | Faset (errstring, make_number (0), make_number (downcase (c))); | ||
| 215 | } | ||
| 216 | |||
| 217 | xsignal (Qfile_error, | ||
| 218 | Fcons (build_string (string), Fcons (errstring, data))); | ||
| 219 | } | ||
| 220 | } | 200 | } |
| 221 | 201 | ||
| 222 | /* Signal a file-access failure that set errno. STRING describes the | 202 | /* Signal a file-access failure that set errno. STRING describes the |