changeset 26084:804cba424b64

Fix bootstrapping problems. Use the system locale to specify Emacs locale defaults. * international/mule-cmds.el (global-map): Do not use backquote, because that makes a bootstrapping problem if you need to recompile all Lisp files using interpreted code. * international/mule.el (charset-id, charset-bytes, charset-dimension, charset-chars, charset-width, charset-direction, charset-iso-final-char, charset-iso-graphic-plane, charset-reverse-charset, charset-short-name, charset-long-name, charset-description, charset-plist): Likewise. * subr.el (save-match-data): Likewise. * international/mule-cmds.el (set-display-table-and-terminal-coding-system): New function, containing code migrated out of set-language-environment. (set-language-environment, set-locale-environment): Use it. (locale-translation-file-name): Moved here from startup.el. (locale-language-names, locale-preferred-coding-systems): New vars. (locale-name-match, set-locale-environment): New functions. * language/japan-util.el (setup-japanese-environment-internal): Prefer japanese-iso-8bit if the system-type is usg-unix-v. * startup.el (iso-8859-n-locale-regexp): Remove. (locale-translation-file-name): Move to mule-cmds.el. (command-line): Move locale-stuff into set-locale-environment.
author Paul Eggert <eggert@twinsun.com>
date Tue, 19 Oct 1999 07:18:58 +0000
parents 134b57acef68
children 2473e4ca59b3
files lisp/ChangeLog lisp/loaddefs.el lisp/startup.el lisp/subr.el
diffstat 4 files changed, 95 insertions(+), 103 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Oct 19 07:17:20 1999 +0000
+++ b/lisp/ChangeLog	Tue Oct 19 07:18:58 1999 +0000
@@ -1,3 +1,35 @@
+1999-10-19  Paul Eggert  <eggert@twinsun.com>
+
+	Fix bootstrapping problems.
+	Use the system locale to specify Emacs locale defaults.
+	
+	* international/mule-cmds.el (global-map):
+	Do not use backquote, because that makes a bootstrapping
+	problem if you need to recompile all Lisp files using interpreted code.
+	* international/mule.el (charset-id, charset-bytes,
+	charset-dimension, charset-chars, charset-width,
+	charset-direction, charset-iso-final-char,
+	charset-iso-graphic-plane, charset-reverse-charset,
+	charset-short-name, charset-long-name, charset-description,
+	charset-plist): Likewise.
+	* subr.el (save-match-data): Likewise.
+
+	* international/mule-cmds.el
+	(set-display-table-and-terminal-coding-system): New function,
+	containing code migrated out of set-language-environment.
+	(set-language-environment, set-locale-environment): Use it.
+	(locale-translation-file-name): Moved here from startup.el.
+	(locale-language-names, locale-preferred-coding-systems):
+	New vars.
+	(locale-name-match, set-locale-environment): New functions.
+
+	* language/japan-util.el (setup-japanese-environment-internal):
+	Prefer japanese-iso-8bit if the system-type is usg-unix-v.
+
+	* startup.el (iso-8859-n-locale-regexp): Remove.
+	(locale-translation-file-name): Move to mule-cmds.el.
+	(command-line): Move locale-stuff into set-locale-environment.
+
 1999-10-18  Dave Love  <fx@gnu.org>
 
 	* abbrev.el (add-abbrev, inverse-add-abbrev)
--- a/lisp/loaddefs.el	Tue Oct 19 07:17:20 1999 +0000
+++ b/lisp/loaddefs.el	Tue Oct 19 07:18:58 1999 +0000
@@ -154,7 +154,7 @@
 ;;;***
 
 ;;;### (autoloads (ada-header) "ada-stmt" "progmodes/ada-stmt.el"
-;;;;;;  (14332 44800))
+;;;;;;  (14344 1074))
 ;;; Generated autoloads from progmodes/ada-stmt.el
 
 (autoload (quote ada-header) "ada-stmt" "\
@@ -341,7 +341,7 @@
 ;;;***
 
 ;;;### (autoloads (ange-ftp-hook-function ange-ftp-reread-dir) "ange-ftp"
-;;;;;;  "ange-ftp.el" (14333 58084))
+;;;;;;  "ange-ftp.el" (14344 981))
 ;;; Generated autoloads from ange-ftp.el
  (defalias 'ange-ftp-re-read-dir 'ange-ftp-reread-dir)
 
@@ -1221,7 +1221,7 @@
 ;;;;;;  browse-url-of-buffer browse-url-of-file browse-url-generic-program
 ;;;;;;  browse-url-save-file browse-url-netscape-display browse-url-new-window-p
 ;;;;;;  browse-url-browser-function) "browse-url" "browse-url.el"
-;;;;;;  (14124 22275))
+;;;;;;  (14344 983))
 ;;; Generated autoloads from browse-url.el
 
 (defvar browse-url-browser-function (if (eq system-type (quote windows-nt)) (quote browse-url-default-windows-browser) (quote browse-url-netscape)) "\
@@ -2414,7 +2414,7 @@
 ;;;***
 
 ;;;### (autoloads (common-lisp-indent-function) "cl-indent" "emacs-lisp/cl-indent.el"
-;;;;;;  (13903 51267))
+;;;;;;  (14347 61984))
 ;;; Generated autoloads from emacs-lisp/cl-indent.el
 
 (autoload (quote common-lisp-indent-function) "cl-indent" nil nil nil)
@@ -2422,7 +2422,7 @@
 ;;;***
 
 ;;;### (autoloads (c-macro-expand) "cmacexp" "progmodes/cmacexp.el"
-;;;;;;  (14286 28586))
+;;;;;;  (14344 1077))
 ;;; Generated autoloads from progmodes/cmacexp.el
 
 (autoload (quote c-macro-expand) "cmacexp" "\
@@ -3396,7 +3396,7 @@
 ;;;***
 
 ;;;### (autoloads (delimit-columns-rectangle delimit-columns-region)
-;;;;;;  "delim-col" "delim-col.el" (14309 21213))
+;;;;;;  "delim-col" "delim-col.el" (14344 985))
 ;;; Generated autoloads from delim-col.el
 
 (autoload (quote delimit-columns-region) "delim-col" "\
@@ -3662,11 +3662,25 @@
 
 ;;;***
 
+;;;### (autoloads (diff-mode) "diff-mode" "diff-mode.el" (14344 986))
+;;; Generated autoloads from diff-mode.el
+
+(autoload (quote diff-mode) "diff-mode" "\
+Major mode for viewing context diffs.
+Supports unified and context diffs as well as (to a lesser extent) normal diffs.
+When the buffer is read-only, the ESC prefix is not necessary.
+This mode runs `diff-mode-hook'.
+\\{diff-mode-map}" t nil)
+
+(add-to-list (quote auto-mode-alist) (quote ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode)))
+
+;;;***
+
 ;;;### (autoloads (dired-noselect dired-other-frame dired-other-window
 ;;;;;;  dired dired-copy-preserve-time dired-dwim-target dired-keep-marker-symlink
 ;;;;;;  dired-keep-marker-hardlink dired-keep-marker-copy dired-keep-marker-rename
 ;;;;;;  dired-trivial-filenames dired-ls-F-marks-symlinks dired-listing-switches)
-;;;;;;  "dired" "dired.el" (14315 30001))
+;;;;;;  "dired" "dired.el" (14344 987))
 ;;; Generated autoloads from dired.el
 
 (defvar dired-listing-switches "-al" "\
@@ -4328,7 +4342,7 @@
 ;;;***
 
 ;;;### (autoloads (edebug-eval-top-level-form def-edebug-spec edebug-all-forms
-;;;;;;  edebug-all-defs) "edebug" "emacs-lisp/edebug.el" (14315 34133))
+;;;;;;  edebug-all-defs) "edebug" "emacs-lisp/edebug.el" (14347 61987))
 ;;; Generated autoloads from emacs-lisp/edebug.el
 
 (defvar edebug-all-defs nil "\
@@ -4542,7 +4556,7 @@
 ;;;***
 
 ;;;### (autoloads (ediff-toggle-use-toolbar ediff-toggle-multiframe)
-;;;;;;  "ediff-util" "ediff-util.el" (13896 8938))
+;;;;;;  "ediff-util" "ediff-util.el" (14344 991))
 ;;; Generated autoloads from ediff-util.el
 
 (autoload (quote ediff-toggle-multiframe) "ediff-util" "\
@@ -4733,7 +4747,7 @@
 ;;;;;;  emerge-revisions emerge-files-with-ancestor-remote emerge-files-remote
 ;;;;;;  emerge-files-with-ancestor-command emerge-files-command emerge-buffers-with-ancestor
 ;;;;;;  emerge-buffers emerge-files-with-ancestor emerge-files) "emerge"
-;;;;;;  "emerge.el" (13661 53633))
+;;;;;;  "emerge.el" (14344 994))
 ;;; Generated autoloads from emerge.el
 
 (defvar menu-bar-emerge-menu (make-sparse-keymap "Emerge"))
@@ -5605,7 +5619,7 @@
 ;;;***
 
 ;;;### (autoloads (file-cache-minibuffer-complete) "filecache" "filecache.el"
-;;;;;;  (14332 47695))
+;;;;;;  (14332 47759))
 ;;; Generated autoloads from filecache.el
 
 (autoload (quote file-cache-minibuffer-complete) "filecache" "\
@@ -5622,7 +5636,7 @@
 ;;;***
 
 ;;;### (autoloads (find-grep-dired find-name-dired find-dired find-grep-options
-;;;;;;  find-ls-option) "find-dired" "find-dired.el" (14263 35426))
+;;;;;;  find-ls-option) "find-dired" "find-dired.el" (14344 998))
 ;;; Generated autoloads from find-dired.el
 
 (defvar find-ls-option (if (eq system-type (quote berkeley-unix)) (quote ("-ls" . "-gilsb")) (quote ("-exec ls -ld {} \\;" . "-ld"))) "\
@@ -6058,7 +6072,7 @@
 ;;;***
 
 ;;;### (autoloads (create-fontset-from-fontset-spec) "fontset" "international/fontset.el"
-;;;;;;  (14094 46602))
+;;;;;;  (14344 1056))
 ;;; Generated autoloads from international/fontset.el
 
 (autoload (quote create-fontset-from-fontset-spec) "fontset" "\
@@ -6404,7 +6418,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-declare-backend gnus-unload) "gnus-start"
-;;;;;;  "gnus/gnus-start.el" (14030 49423))
+;;;;;;  "gnus/gnus-start.el" (14344 1048))
 ;;; Generated autoloads from gnus/gnus-start.el
 
 (autoload (quote gnus-unload) "gnus-start" "\
@@ -7094,7 +7108,7 @@
 
 ;;;### (autoloads (defimage remove-images insert-image put-image
 ;;;;;;  create-image image-type-available-p image-type-from-file-header)
-;;;;;;  "image" "image.el" (14330 17997))
+;;;;;;  "image" "image.el" (14344 1003))
 ;;; Generated autoloads from image.el
 
 (autoload (quote image-type-from-file-header) "image" "\
@@ -7357,7 +7371,7 @@
 
 ;;;### (autoloads (Info-speedbar-browser Info-goto-emacs-key-command-node
 ;;;;;;  Info-goto-emacs-command-node info-standalone info info-other-window)
-;;;;;;  "info" "info.el" (14331 38705))
+;;;;;;  "info" "info.el" (14344 1005))
 ;;; Generated autoloads from info.el
 
 (autoload (quote info-other-window) "info" "\
@@ -7809,7 +7823,7 @@
 
 ;;;### (autoloads (iswitchb-buffer-other-frame iswitchb-display-buffer
 ;;;;;;  iswitchb-buffer-other-window iswitchb-buffer iswitchb-default-keybindings
-;;;;;;  iswitchb-read-buffer) "iswitchb" "iswitchb.el" (14327 30798))
+;;;;;;  iswitchb-read-buffer) "iswitchb" "iswitchb.el" (14347 61960))
 ;;; Generated autoloads from iswitchb.el
 
 (autoload (quote iswitchb-read-buffer) "iswitchb" "\
@@ -7854,7 +7868,7 @@
 ;;;;;;  japanese-hiragana-region japanese-katakana-region japanese-zenkaku
 ;;;;;;  japanese-hankaku japanese-hiragana japanese-katakana setup-japanese-environment-internal
 ;;;;;;  setup-japanese-environment) "japan-util" "language/japan-util.el"
-;;;;;;  (13903 50605))
+;;;;;;  (14347 63248))
 ;;; Generated autoloads from language/japan-util.el
 
 (autoload (quote setup-japanese-environment) "japan-util" "\
@@ -7955,7 +7969,7 @@
 ;;;***
 
 ;;;### (autoloads (auto-compression-mode) "jka-compr" "jka-compr.el"
-;;;;;;  (14263 64153))
+;;;;;;  (14344 1006))
 ;;; Generated autoloads from jka-compr.el
 
 (defvar auto-compression-mode nil "\
@@ -8181,11 +8195,12 @@
 ;;;***
 
 ;;;### (autoloads (locate-with-filter locate) "locate" "locate.el"
-;;;;;;  (13685 31872))
+;;;;;;  (14344 1013))
 ;;; Generated autoloads from locate.el
 
 (autoload (quote locate) "locate" "\
-Run the program `locate', putting results in `*Locate*' buffer." t nil)
+Run the program `locate', putting results in `*Locate*' buffer.
+With prefix arg, prompt for the locate command to run." t nil)
 
 (autoload (quote locate-with-filter) "locate" "\
 Run the locate command with a filter." t nil)
@@ -8791,7 +8806,7 @@
 
 ;;;### (autoloads (metamail-region metamail-buffer metamail-interpret-body
 ;;;;;;  metamail-interpret-header) "metamail" "mail/metamail.el"
-;;;;;;  (14280 10636))
+;;;;;;  (14344 1065))
 ;;; Generated autoloads from mail/metamail.el
 
 (autoload (quote metamail-interpret-header) "metamail" "\
@@ -9321,9 +9336,9 @@
 ;;;***
 
 ;;;### (autoloads (network-connection network-connection-to-service
-;;;;;;  whois-reverse-lookup whois finger ftp nslookup nslookup-host
+;;;;;;  whois-reverse-lookup whois finger ftp dig nslookup nslookup-host
 ;;;;;;  route arp netstat ipconfig ping traceroute) "net-utils" "net-utils.el"
-;;;;;;  (14241 51006))
+;;;;;;  (14344 1016))
 ;;; Generated autoloads from net-utils.el
 
 (autoload (quote traceroute) "net-utils" "\
@@ -9354,6 +9369,9 @@
 (autoload (quote nslookup) "net-utils" "\
 Run nslookup program." t nil)
 
+(autoload (quote dig) "net-utils" "\
+Run dig program." t nil)
+
 (autoload (quote ftp) "net-utils" "\
 Run ftp program." t nil)
 
@@ -9904,7 +9922,7 @@
 ;;;***
 
 ;;;### (autoloads (picture-mode) "picture" "textmodes/picture.el"
-;;;;;;  (14240 52722))
+;;;;;;  (14347 62026))
 ;;; Generated autoloads from textmodes/picture.el
 
 (autoload (quote picture-mode) "picture" "\
@@ -10022,8 +10040,8 @@
 
 ;;;***
 
-;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (14337
-;;;;;;  63130))
+;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (14339
+;;;;;;  19431))
 ;;; Generated autoloads from progmodes/ps-mode.el
 
 (autoload (quote ps-mode) "ps-mode" "\
@@ -10437,7 +10455,7 @@
 
 ;;;### (autoloads (quickurl-list quickurl-list-mode quickurl-edit-urls
 ;;;;;;  quickurl-browse-url-ask quickurl-browse-url quickurl-add-url
-;;;;;;  quickurl-ask quickurl) "quickurl" "quickurl.el" (14339 7894))
+;;;;;;  quickurl-ask quickurl) "quickurl" "quickurl.el" (14344 1017))
 ;;; Generated autoloads from quickurl.el
 
 (defconst quickurl-reread-hook-postfix "\n;; Local Variables:\n;; eval: (progn (require 'quickurl) (add-hook 'local-write-file-hooks (lambda () (quickurl-read) nil)))\n;; End:\n" "\
@@ -10493,7 +10511,7 @@
 ;;;***
 
 ;;;### (autoloads (recentf-cleanup recentf-save-list recentf-mode)
-;;;;;;  "recentf" "recentf.el" (14339 41278))
+;;;;;;  "recentf" "recentf.el" (14339 41776))
 ;;; Generated autoloads from recentf.el
 
 (autoload (quote recentf-mode) "recentf" "\
@@ -10671,7 +10689,7 @@
 ;;;***
 
 ;;;### (autoloads (regexp-opt-depth regexp-opt) "regexp-opt" "emacs-lisp/regexp-opt.el"
-;;;;;;  (14334 30691))
+;;;;;;  (14334 30885))
 ;;; Generated autoloads from emacs-lisp/regexp-opt.el
 
 (autoload (quote regexp-opt) "regexp-opt" "\
@@ -10812,7 +10830,7 @@
 ;;;;;;  rmail-mail-new-frame rmail-primary-inbox-list rmail-delete-after-output
 ;;;;;;  rmail-highlight-face rmail-highlighted-headers rmail-retry-ignored-headers
 ;;;;;;  rmail-displayed-headers rmail-ignored-headers rmail-dont-reply-to-names)
-;;;;;;  "rmail" "mail/rmail.el" (14292 14011))
+;;;;;;  "rmail" "mail/rmail.el" (14344 1068))
 ;;; Generated autoloads from mail/rmail.el
 
 (defvar rmail-dont-reply-to-names nil "\
@@ -11546,7 +11564,7 @@
 ;;;***
 
 ;;;### (autoloads (sh-mode) "sh-script" "progmodes/sh-script.el"
-;;;;;;  (14339 9963))
+;;;;;;  (14344 1082))
 ;;; Generated autoloads from progmodes/sh-script.el
 
 (put (quote sh-mode) (quote mode-class) (quote special))
@@ -11863,7 +11881,7 @@
 ;;;***
 
 ;;;### (autoloads (smtpmail-send-it) "smtpmail" "mail/smtpmail.el"
-;;;;;;  (14186 47152))
+;;;;;;  (14344 1070))
 ;;; Generated autoloads from mail/smtpmail.el
 
 (autoload (quote smtpmail-send-it) "smtpmail" nil nil nil)
@@ -13689,8 +13707,8 @@
 ;;;;;;  vc-create-snapshot vc-directory vc-resolve-conflicts vc-merge
 ;;;;;;  vc-insert-headers vc-version-other-window vc-diff vc-register
 ;;;;;;  vc-next-action edit-vc-file with-vc-file vc-annotate-mode-hook
-;;;;;;  vc-before-checkin-hook vc-checkin-hook) "vc" "vc.el" (14325
-;;;;;;  58398))
+;;;;;;  vc-before-checkin-hook vc-checkin-hook) "vc" "vc.el" (14344
+;;;;;;  1029))
 ;;; Generated autoloads from vc.el
 
 (defvar vc-checkin-hook nil "\
--- a/lisp/startup.el	Tue Oct 19 07:17:20 1999 +0000
+++ b/lisp/startup.el	Tue Oct 19 07:18:58 1999 +0000
@@ -296,15 +296,6 @@
   :type '(choice (const :tag "none" nil) string)
   :group 'initialization)
 
-(defconst iso-8859-n-locale-regexp "8859[-_]?\\([1-49]\\|1[45]\\)\\>"
-  "Regexp that specifies when to enable an ISO 8859-N character set.
-We do that if this regexp matches the locale name specified by
-one of the environment variables LC_ALL, LC_CTYPE, or LANG.
-The paren group in the regexp should match the specific character
-set number, N.  Currently only Latin-[1234589] are supported.
-\(Note that Latin-5 is ISO 8859-9, because 8859-[678] are non-Latin
-alphabets; hence, supported values of N are 1, 2, 3, 4, 9, 14 and 15.\)")
-
 (defcustom mail-host-address nil
   "*Name of this machine, for purposes of naming users."
   :type '(choice (const nil) string)
@@ -331,20 +322,6 @@
 		 string)
   :group 'auto-save)
 
-(defvar locale-translation-file-name
-  (let ((files '("/usr/lib/X11/locale/locale.alias" ; e.g. X11R6.4
-		 "/usr/X11R6/lib/X11/locale/locale.alias" ; e.g. RedHat 4.2
-		 "/usr/openwin/lib/locale/locale.alias" ; e.g. Solaris 2.6
-		 ;;
-		 ;; The following name appears after the X-related names above,
-		 ;; since the X-related names are what X actually uses.
-		 "/usr/share/locale/locale.alias" ; GNU/Linux sans X
-		 )))
-    (while (and files (not (file-exists-p (car files))))
-      (setq files (cdr files)))
-    (car files))
-  "*File name for the system's file of locale-name aliases, or nil if none.")
-
 (defvar init-file-debug nil)
 
 (defvar init-file-had-error nil)
@@ -521,46 +498,7 @@
 	       (string= vc "simple"))
 	   (setq version-control 'never))))
 
-  (let ((ctype
-	 ;; Use the first of these three envvars that has a nonempty value.
-	 (or (let ((string (getenv "LC_ALL")))
-	       (and (not (equal string "")) string))
-	     (let ((string (getenv "LC_CTYPE")))
-	       (and (not (equal string "")) string))
-	     (let ((string (getenv "LANG")))
-	       (and (not (equal string "")) string)))))
-    ;; Translate "swedish" into "sv_SE.ISO-8859-1", and so on,
-    ;; using the translation file that GNU/Linux systems have.
-    (and ctype
-	 locale-translation-file-name
-	 (not (string-match iso-8859-n-locale-regexp ctype))
-	 (with-temp-buffer
-	   (insert-file-contents locale-translation-file-name)
-	   (if (re-search-forward
-		(concat "^" (regexp-quote ctype) ":?[ \t]+") nil t)
-	       (setq ctype (buffer-substring (point) (line-end-position))))))
-    ;; Now see if the locale specifies an ISO 8859 character set.
-    (when (and ctype
-	       (string-match iso-8859-n-locale-regexp ctype))
-      (let* ((which (match-string 1 ctype))
-	     (latin (cdr (assoc which '(("9" . "5") ("14" . "8")
-					("15" . "9")))))
-	    charset)
-	(if latin  (setq which latin))
-	(setq charset (concat "latin-" which))
-	(when (string-match "latin-[1-589]" charset)
-	  ;; Set up for this character set.
-	  ;; This is now the right way to do it
-	  ;; for both unibyte and multibyte modes.
-	  (set-language-environment charset)
-	  (unless (or noninteractive (eq window-system 'x))
-	    ;; Send those codes literally to a non-X terminal.
-	    (when default-enable-multibyte-characters
-	      ;; If this is nil, we are using single-byte characters,
-	      ;; so the terminal coding system is irrelevant.
-	      (set-terminal-coding-system
-	       (intern (downcase charset)))))
-	  (standard-display-european-internal)))))
+  (set-locale-environment nil)
 
   ;;! This has been commented out; I currently find the behavior when
   ;;! split-window-keep-point is nil disturbing, but if I can get used
--- a/lisp/subr.el	Tue Oct 19 07:17:20 1999 +0000
+++ b/lisp/subr.el	Tue Oct 19 07:18:58 1999 +0000
@@ -1,6 +1,6 @@
 ;;; subr.el --- basic lisp subroutines for Emacs
 
-;; Copyright (C) 1985, 1986, 1992, 1994, 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 86, 92, 94, 95, 1999 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -1069,10 +1069,14 @@
 ;; now, but it generates slower code.
 (defmacro save-match-data (&rest body)
   "Execute the BODY forms, restoring the global value of the match data."
-  `(let ((save-match-data-internal (match-data)))
-       (unwind-protect
-	   (progn ,@body)
-	 (set-match-data save-match-data-internal))))
+  ;; It is better not to use backquote here,
+  ;; because that makes a bootstrapping problem
+  ;; if you need to recompile all the Lisp files using interpreted code.
+  (list 'let
+	'((save-match-data-internal (match-data)))
+	(list 'unwind-protect
+	      (cons 'progn body)
+	      '(set-match-data save-match-data-internal))))
 
 (defun match-string (num &optional string)
   "Return string of text matched by last search.