comparison lisp/subr.el @ 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 4f46db3c9d7d
children f5713c397636
comparison
equal deleted inserted replaced
26083:134b57acef68 26084:804cba424b64
1 ;;; subr.el --- basic lisp subroutines for Emacs 1 ;;; subr.el --- basic lisp subroutines for Emacs
2 2
3 ;; Copyright (C) 1985, 1986, 1992, 1994, 1995 Free Software Foundation, Inc. 3 ;; Copyright (C) 1985, 86, 92, 94, 95, 1999 Free Software Foundation, Inc.
4 4
5 ;; This file is part of GNU Emacs. 5 ;; This file is part of GNU Emacs.
6 6
7 ;; GNU Emacs is free software; you can redistribute it and/or modify 7 ;; GNU Emacs is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by 8 ;; it under the terms of the GNU General Public License as published by
1067 ;; that works ok in practice (people should not use that variable elsewhere). 1067 ;; that works ok in practice (people should not use that variable elsewhere).
1068 ;; We used to use an uninterned symbol; the compiler handles that properly 1068 ;; We used to use an uninterned symbol; the compiler handles that properly
1069 ;; now, but it generates slower code. 1069 ;; now, but it generates slower code.
1070 (defmacro save-match-data (&rest body) 1070 (defmacro save-match-data (&rest body)
1071 "Execute the BODY forms, restoring the global value of the match data." 1071 "Execute the BODY forms, restoring the global value of the match data."
1072 `(let ((save-match-data-internal (match-data))) 1072 ;; It is better not to use backquote here,
1073 (unwind-protect 1073 ;; because that makes a bootstrapping problem
1074 (progn ,@body) 1074 ;; if you need to recompile all the Lisp files using interpreted code.
1075 (set-match-data save-match-data-internal)))) 1075 (list 'let
1076 '((save-match-data-internal (match-data)))
1077 (list 'unwind-protect
1078 (cons 'progn body)
1079 '(set-match-data save-match-data-internal))))
1076 1080
1077 (defun match-string (num &optional string) 1081 (defun match-string (num &optional string)
1078 "Return string of text matched by last search. 1082 "Return string of text matched by last search.
1079 NUM specifies which parenthesized expression in the last regexp. 1083 NUM specifies which parenthesized expression in the last regexp.
1080 Value is nil if NUMth pair didn't match, or there were less than NUM pairs. 1084 Value is nil if NUMth pair didn't match, or there were less than NUM pairs.