aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-03-21 10:19:37 +0000
committerGerd Moellmann2001-03-21 10:19:37 +0000
commit7008ccaca15bf9a6558b9ffa87cf145d3d18a183 (patch)
tree0ec87cac71287bdc93d4d7fb9230624be241ccc3
parent4dccc3f07544140284bafbb34c6b6ea5c06c158e (diff)
downloademacs-7008ccaca15bf9a6558b9ffa87cf145d3d18a183.tar.gz
emacs-7008ccaca15bf9a6558b9ffa87cf145d3d18a183.zip
(set-locale-environment): Set
system-messages-locale and system-time-locale, but only if the caller specifies a non-nil locale name.
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/international/mule-cmds.el114
2 files changed, 70 insertions, 54 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 80b85ef1ad8..b3aaae58374 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,11 +1,17 @@
12001-03-21 Paul Eggert <eggert@twinsun.com>
2
3 * international/mule-cmds.el (set-locale-environment): Set
4 system-messages-locale and system-time-locale, but only if the
5 caller specifies a non-nil locale name.
6
12001-03-20 John Wiegley <johnw@gnu.org> 72001-03-20 John Wiegley <johnw@gnu.org>
2 8
3 * calendar/calendar.el (nongregorian-diary-listing-hook): Added 9 * calendar/calendar.el (nongregorian-diary-listing-hook): Added
4 :options to cover the possible values. 10 :options to cover the possible values.
5 (nongregorian-diary-marking-hook): ditto 11 (nongregorian-diary-marking-hook): Ditto
6 12
7 * cal-bahai.el, cal-menu.el, calendar.el, diary-lib.el, 13 * cal-bahai.el, cal-menu.el, calendar.el, diary-lib.el,
8 holidays.el: Added support for the Baha'i calendar system. 14 * holidays.el: Added support for the Baha'i calendar system.
9 15
10 * pcvs-util.el (cvs-bury-buffer): Bodiless `if' statements cause 16 * pcvs-util.el (cvs-bury-buffer): Bodiless `if' statements cause
11 problems for the interpreter. 17 problems for the interpreter.
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 8f011b49008..8df321af123 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -2,7 +2,7 @@
2 2
3;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. 3;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
4;; Licensed to the Free Software Foundation. 4;; Licensed to the Free Software Foundation.
5;; Copyright (C) 2000 Free Software Foundation, Inc. 5;; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
6 6
7;; Keywords: mule, multilingual 7;; Keywords: mule, multilingual
8 8
@@ -1898,57 +1898,67 @@ See also `locale-charset-language-names', `locale-language-names',
1898 (setq files (cdr files))) 1898 (setq files (cdr files)))
1899 (car files))) 1899 (car files)))
1900 1900
1901 (unless locale-name 1901 (let ((locale locale-name))
1902 ;; Use the first of these three environment variables 1902
1903 ;; that has a nonempty value. 1903 (unless locale
1904 (let ((vars '("LC_ALL" "LC_CTYPE" "LANG"))) 1904 ;; Use the first of these three environment variables
1905 (while (and vars (not (setq locale-name (getenv (car vars))))) 1905 ;; that has a nonempty value.
1906 (setq vars (cdr vars))))) 1906 (let ((vars '("LC_ALL" "LC_CTYPE" "LANG")))
1907 1907 (while (and vars (not (setq locale (getenv (car vars)))))
1908 (when locale-name 1908 (setq vars (cdr vars)))))
1909 1909
1910 ;; Translate "swedish" into "sv_SE.ISO8859-1", and so on, 1910 (when locale
1911 ;; using the translation file that many systems have. 1911
1912 (when locale-translation-file-name 1912 ;; Translate "swedish" into "sv_SE.ISO8859-1", and so on,
1913 (with-temp-buffer 1913 ;; using the translation file that many systems have.
1914 (insert-file-contents locale-translation-file-name) 1914 (when locale-translation-file-name
1915 (when (re-search-forward 1915 (with-temp-buffer
1916 (concat "^" (regexp-quote locale-name) ":?[ \t]+") nil t) 1916 (insert-file-contents locale-translation-file-name)
1917 (setq locale-name (buffer-substring (point) (line-end-position)))))) 1917 (when (re-search-forward
1918 1918 (concat "^" (regexp-quote locale) ":?[ \t]+") nil t)
1919 (setq locale-name (downcase locale-name)) 1919 (setq locale (buffer-substring (point) (line-end-position))))))
1920 1920
1921 (let ((language-name 1921 ;; Leave the system locales alone if the caller did not specify
1922 (locale-name-match locale-name locale-language-names)) 1922 ;; an explicit locale name, as their defaults are set from
1923 (charset-language-name 1923 ;; LC_MESSAGES and LC_TIME, not LC_CTYPE, and the user might not
1924 (locale-name-match locale-name locale-charset-language-names)) 1924 ;; want to set them to the same value as LC_CTYPE.
1925 (coding-system 1925 (when locale-name
1926 (locale-name-match locale-name locale-preferred-coding-systems))) 1926 (setq system-messages-locale locale)
1927 1927 (setq system-time-locale locale))
1928 (if (and charset-language-name 1928
1929 (not 1929 (setq locale (downcase locale))
1930 (equal (get-language-info language-name 'charset) 1930
1931 (get-language-info charset-language-name 'charset)))) 1931 (let ((language-name
1932 (setq language-name charset-language-name)) 1932 (locale-name-match locale locale-language-names))
1933 1933 (charset-language-name
1934 (when language-name 1934 (locale-name-match locale locale-charset-language-names))
1935 1935 (coding-system
1936 ;; Set up for this character set. This is now the right way 1936 (locale-name-match locale locale-preferred-coding-systems)))
1937 ;; to do it for both unibyte and multibyte modes. 1937
1938 (set-language-environment language-name) 1938 (if (and charset-language-name
1939 1939 (not
1940 ;; If default-enable-multibyte-characters is nil, 1940 (equal (get-language-info language-name 'charset)
1941 ;; we are using single-byte characters, 1941 (get-language-info charset-language-name 'charset))))
1942 ;; so the display table and terminal coding system are irrelevant. 1942 (setq language-name charset-language-name))
1943 (when default-enable-multibyte-characters 1943
1944 (set-display-table-and-terminal-coding-system language-name)) 1944 (when language-name
1945 1945
1946 (setq locale-coding-system 1946 ;; Set up for this character set. This is now the right way
1947 (car (get-language-info language-name 'coding-priority)))) 1947 ;; to do it for both unibyte and multibyte modes.
1948 1948 (set-language-environment language-name)
1949 (when coding-system 1949
1950 (prefer-coding-system coding-system) 1950 ;; If default-enable-multibyte-characters is nil,
1951 (setq locale-coding-system coding-system))))) 1951 ;; we are using single-byte characters,
1952 ;; so the display table and terminal coding system are irrelevant.
1953 (when default-enable-multibyte-characters
1954 (set-display-table-and-terminal-coding-system language-name))
1955
1956 (setq locale-coding-system
1957 (car (get-language-info language-name 'coding-priority))))
1958
1959 (when coding-system
1960 (prefer-coding-system coding-system)
1961 (setq locale-coding-system coding-system))))))
1952 1962
1953;;; Charset property 1963;;; Charset property
1954 1964