diff options
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/coding.c b/src/coding.c index 4bf0b2aea81..1e75be5ab6f 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -268,11 +268,14 @@ encode_coding_XXX (coding, source, destination, src_bytes, dst_bytes) | |||
| 268 | 268 | ||
| 269 | /*** 1. Preamble ***/ | 269 | /*** 1. Preamble ***/ |
| 270 | 270 | ||
| 271 | #ifdef emacs | ||
| 272 | #include <config.h> | ||
| 273 | #endif | ||
| 274 | |||
| 271 | #include <stdio.h> | 275 | #include <stdio.h> |
| 272 | 276 | ||
| 273 | #ifdef emacs | 277 | #ifdef emacs |
| 274 | 278 | ||
| 275 | #include <config.h> | ||
| 276 | #include "lisp.h" | 279 | #include "lisp.h" |
| 277 | #include "buffer.h" | 280 | #include "buffer.h" |
| 278 | #include "charset.h" | 281 | #include "charset.h" |
| @@ -357,6 +360,8 @@ Lisp_Object Vfile_coding_system_alist; | |||
| 357 | Lisp_Object Vprocess_coding_system_alist; | 360 | Lisp_Object Vprocess_coding_system_alist; |
| 358 | Lisp_Object Vnetwork_coding_system_alist; | 361 | Lisp_Object Vnetwork_coding_system_alist; |
| 359 | 362 | ||
| 363 | Lisp_Object Vlocale_coding_system; | ||
| 364 | |||
| 360 | #endif /* emacs */ | 365 | #endif /* emacs */ |
| 361 | 366 | ||
| 362 | Lisp_Object Qcoding_category, Qcoding_category_index; | 367 | Lisp_Object Qcoding_category, Qcoding_category_index; |
| @@ -5786,6 +5791,10 @@ or a cons of coding systems which are used as above.\n\ | |||
| 5786 | See also the function `find-operation-coding-system'."); | 5791 | See also the function `find-operation-coding-system'."); |
| 5787 | Vnetwork_coding_system_alist = Qnil; | 5792 | Vnetwork_coding_system_alist = Qnil; |
| 5788 | 5793 | ||
| 5794 | DEFVAR_LISP ("locale-coding-system", &Vlocale_coding_system, | ||
| 5795 | "Coding system to use with system messages."); | ||
| 5796 | Vlocale_coding_system = Qnil; | ||
| 5797 | |||
| 5789 | DEFVAR_LISP ("eol-mnemonic-unix", &eol_mnemonic_unix, | 5798 | DEFVAR_LISP ("eol-mnemonic-unix", &eol_mnemonic_unix, |
| 5790 | "*String displayed in mode line for UNIX-like (LF) end-of-line format."); | 5799 | "*String displayed in mode line for UNIX-like (LF) end-of-line format."); |
| 5791 | eol_mnemonic_unix = build_string (":"); | 5800 | eol_mnemonic_unix = build_string (":"); |
| @@ -5853,4 +5862,24 @@ The default value is `select-safe-coding-system' (which see)."); | |||
| 5853 | 5862 | ||
| 5854 | } | 5863 | } |
| 5855 | 5864 | ||
| 5865 | char * | ||
| 5866 | emacs_strerror (error_number) | ||
| 5867 | int error_number; | ||
| 5868 | { | ||
| 5869 | char *str; | ||
| 5870 | |||
| 5871 | synchronize_messages_locale (); | ||
| 5872 | str = strerror (error_number); | ||
| 5873 | |||
| 5874 | if (! NILP (Vlocale_coding_system)) | ||
| 5875 | { | ||
| 5876 | Lisp_Object dec = code_convert_string_norecord (build_string (str), | ||
| 5877 | Vlocale_coding_system, | ||
| 5878 | 0); | ||
| 5879 | str = (char *) XSTRING (dec)->data; | ||
| 5880 | } | ||
| 5881 | |||
| 5882 | return str; | ||
| 5883 | } | ||
| 5884 | |||
| 5856 | #endif /* emacs */ | 5885 | #endif /* emacs */ |