diff options
| author | Paul Eggert | 1999-11-25 05:33:31 +0000 |
|---|---|---|
| committer | Paul Eggert | 1999-11-25 05:33:31 +0000 |
| commit | 0c8559bbd1761feef1cb076d620b1ce63b20b942 (patch) | |
| tree | 29a99c4da865849f654feb1ff73628dfeefeddac | |
| parent | b844f697eb8b70bbf448ac1ae63e7302c6fadd24 (diff) | |
| download | emacs-0c8559bbd1761feef1cb076d620b1ce63b20b942.tar.gz emacs-0c8559bbd1761feef1cb076d620b1ce63b20b942.zip | |
* emacs.c (fixup_locale): Don't bother to record initial locale.
(synchronize_locale): If the desired locale is nil,
treat it as if it were the empty string,
so that we set the locale from the environment.
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/emacs.c | 22 |
2 files changed, 16 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a9c1983a7a2..b53b9d7c24c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 1999-11-25 Paul Eggert <eggert@twinsun.com> | ||
| 2 | |||
| 3 | * emacs.c (fixup_locale): Don't bother to record initial locale. | ||
| 4 | (synchronize_locale): If the desired locale is nil, | ||
| 5 | treat it as if it were the empty string, | ||
| 6 | so that we set the locale from the environment. | ||
| 7 | |||
| 1 | 1999-11-25 Kenichi Handa <handa@etl.go.jp> | 8 | 1999-11-25 Kenichi Handa <handa@etl.go.jp> |
| 2 | 9 | ||
| 3 | * fileio.c (Finsert_file_contents): Set buffer-file-coding-system | 10 | * fileio.c (Finsert_file_contents): Set buffer-file-coding-system |
diff --git a/src/emacs.c b/src/emacs.c index 4ec6e612a63..91b0c773645 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1911,30 +1911,26 @@ You must run Emacs in batch mode in order to dump it.") | |||
| 1911 | void | 1911 | void |
| 1912 | fixup_locale () | 1912 | fixup_locale () |
| 1913 | { | 1913 | { |
| 1914 | char *l; | ||
| 1915 | |||
| 1916 | /* The Emacs Lisp reader needs LC_NUMERIC to be "C", | 1914 | /* The Emacs Lisp reader needs LC_NUMERIC to be "C", |
| 1917 | so that numbers are read and printed properly for Emacs Lisp. */ | 1915 | so that numbers are read and printed properly for Emacs Lisp. */ |
| 1918 | setlocale (LC_NUMERIC, "C"); | 1916 | setlocale (LC_NUMERIC, "C"); |
| 1919 | |||
| 1920 | #ifdef LC_MESSAGES | ||
| 1921 | l = setlocale (LC_MESSAGES, (char *) 0); | ||
| 1922 | Vprevious_system_messages_locale = l ? build_string (l) : Qnil; | ||
| 1923 | #endif | ||
| 1924 | l = setlocale (LC_TIME, (char *) 0); | ||
| 1925 | Vprevious_system_time_locale = l ? build_string (l) : Qnil; | ||
| 1926 | } | 1917 | } |
| 1927 | 1918 | ||
| 1919 | /* Set system locale CATEGORY, with previous locale *PLOCALE, to | ||
| 1920 | DESIRED_LOCALE. */ | ||
| 1928 | static void | 1921 | static void |
| 1929 | synchronize_locale (category, plocale, desired_locale) | 1922 | synchronize_locale (category, plocale, desired_locale) |
| 1930 | int category; | 1923 | int category; |
| 1931 | Lisp_Object *plocale; | 1924 | Lisp_Object *plocale; |
| 1932 | Lisp_Object desired_locale; | 1925 | Lisp_Object desired_locale; |
| 1933 | { | 1926 | { |
| 1934 | if (STRINGP (desired_locale) | 1927 | if (! EQ (*plocale, desired_locale)) |
| 1935 | && (NILP (*plocale) || NILP (Fstring_equal (*plocale, desired_locale))) | 1928 | { |
| 1936 | && setlocale (category, XSTRING (desired_locale)->data)) | 1929 | *plocale = desired_locale; |
| 1937 | *plocale = desired_locale; | 1930 | setlocale (category, (STRINGP (desired_locale) |
| 1931 | ? XSTRING (desired_locale)->data | ||
| 1932 | : "")); | ||
| 1933 | } | ||
| 1938 | } | 1934 | } |
| 1939 | 1935 | ||
| 1940 | /* Set system time locale to match Vsystem_time_locale, if possible. */ | 1936 | /* Set system time locale to match Vsystem_time_locale, if possible. */ |