Mercurial > emacs
comparison lisp/international/mule.el @ 83548:c71725faff1a
Merged from emacs@sv.gnu.org. Last-minute emacsclient rewrites be damned!
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-490
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-491
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-492
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-493
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-494
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-495
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-496
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-497
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-498
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-499
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-500
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-501
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-502
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-503
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-504
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-505
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-506
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-507
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-508
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-509
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-510
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-511
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-512
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-513
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-514
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-515
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-516
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-517
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-518
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-519
Update from CVS: etc/TUTORIAL.cn: Updated.
* emacs@sv.gnu.org/emacs--devo--0--patch-520
Merge from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-521
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-522
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-523
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-524
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-525
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-526
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-527
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-528
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-529
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-530
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-531
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-532
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-533
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-534
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-535
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-161
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-162
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-163
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-164
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-165
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-166
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-167
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-168
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-169
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-170
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-588
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sun, 03 Dec 2006 15:03:30 +0000 |
parents | 2d56e13fd23d a3d2bf407246 |
children | 17e0dd217877 |
comparison
equal
deleted
inserted
replaced
83547:0912b745fc75 | 83548:c71725faff1a |
---|---|
36 Distribution date of this version of MULE (multilingual environment).") | 36 Distribution date of this version of MULE (multilingual environment).") |
37 | 37 |
38 (defun load-with-code-conversion (fullname file &optional noerror nomessage) | 38 (defun load-with-code-conversion (fullname file &optional noerror nomessage) |
39 "Execute a file of Lisp code named FILE whose absolute name is FULLNAME. | 39 "Execute a file of Lisp code named FILE whose absolute name is FULLNAME. |
40 The file contents are decoded before evaluation if necessary. | 40 The file contents are decoded before evaluation if necessary. |
41 If optional second arg NOERROR is non-nil, | 41 If optional third arg NOERROR is non-nil, |
42 report no error if FILE doesn't exist. | 42 report no error if FILE doesn't exist. |
43 Print messages at start and end of loading unless | 43 Print messages at start and end of loading unless |
44 optional third arg NOMESSAGE is non-nil. | 44 optional fourth arg NOMESSAGE is non-nil. |
45 Return t if file exists." | 45 Return t if file exists." |
46 (if (null (file-readable-p fullname)) | 46 (if (null (file-readable-p fullname)) |
47 (and (null noerror) | 47 (and (null noerror) |
48 (signal 'file-error (list "Cannot open load file" file))) | 48 (signal 'file-error (list "Cannot open load file" file))) |
49 ;; Read file with code conversion, and then eval. | 49 ;; Read file with code conversion, and then eval. |
69 (push file preloaded-file-list)) | 69 (push file preloaded-file-list)) |
70 (unwind-protect | 70 (unwind-protect |
71 (let ((load-file-name fullname) | 71 (let ((load-file-name fullname) |
72 (set-auto-coding-for-load t) | 72 (set-auto-coding-for-load t) |
73 (inhibit-file-name-operation nil)) | 73 (inhibit-file-name-operation nil)) |
74 (save-excursion | 74 (with-current-buffer buffer |
75 (set-buffer buffer) | |
76 ;; Don't let deactivate-mark remain set. | 75 ;; Don't let deactivate-mark remain set. |
77 (let (deactivate-mark) | 76 (let (deactivate-mark) |
78 (insert-file-contents fullname)) | 77 (insert-file-contents fullname)) |
79 ;; If the loaded file was inserted with no-conversion or | 78 ;; If the loaded file was inserted with no-conversion or |
80 ;; raw-text coding system, make the buffer unibyte. | 79 ;; raw-text coding system, make the buffer unibyte. |
98 )) | 97 )) |
99 (let (kill-buffer-hook kill-buffer-query-functions) | 98 (let (kill-buffer-hook kill-buffer-query-functions) |
100 (kill-buffer buffer))) | 99 (kill-buffer buffer))) |
101 (unless purify-flag | 100 (unless purify-flag |
102 (do-after-load-evaluation fullname)) | 101 (do-after-load-evaluation fullname)) |
103 | 102 |
104 (unless (or nomessage noninteractive) | 103 (unless (or nomessage noninteractive) |
105 (if source | 104 (if source |
106 (message "Loading %s (source)...done" file) | 105 (message "Loading %s (source)...done" file) |
107 (message "Loading %s...done" file))) | 106 (message "Loading %s...done" file))) |
108 t))) | 107 t))) |
116 (let ((vector (get (car-safe (cdr obj)) 'charset))) | 115 (let ((vector (get (car-safe (cdr obj)) 'charset))) |
117 (and (vectorp vector) | 116 (and (vectorp vector) |
118 (< (aref vector 0) 160))))) | 117 (< (aref vector 0) 160))))) |
119 | 118 |
120 (defsubst charsetp (object) | 119 (defsubst charsetp (object) |
121 "T if OBJECT is a charset." | 120 "Return t if OBJECT is a charset." |
122 (and (symbolp object) (vectorp (get object 'charset)))) | 121 (and (symbolp object) (vectorp (get object 'charset)))) |
123 | 122 |
124 (defsubst charset-info (charset) | 123 (defsubst charset-info (charset) |
125 "Return a vector of information of CHARSET. | 124 "Return a vector of information of CHARSET. |
126 The elements of the vector are: | 125 The elements of the vector are: |
266 (defun make-char (charset &optional code1 code2) | 265 (defun make-char (charset &optional code1 code2) |
267 "Return a character of CHARSET whose position codes are CODE1 and CODE2. | 266 "Return a character of CHARSET whose position codes are CODE1 and CODE2. |
268 CODE1 and CODE2 are optional, but if you don't supply | 267 CODE1 and CODE2 are optional, but if you don't supply |
269 sufficient position codes, return a generic character which stands for | 268 sufficient position codes, return a generic character which stands for |
270 all characters or group of characters in the character set. | 269 all characters or group of characters in the character set. |
271 A generic character can be used to index a char table (e.g. syntax-table). | 270 A generic character can be used to index a char table (e.g. `syntax-table'). |
272 | 271 |
273 Such character sets as ascii, eight-bit-control, and eight-bit-graphic | 272 Such character sets as ascii, eight-bit-control, and eight-bit-graphic |
274 don't have corresponding generic characters. If CHARSET is one of | 273 don't have corresponding generic characters. If CHARSET is one of |
275 them and you don't supply CODE1, return the character of the smallest | 274 them and you don't supply CODE1, return the character of the smallest |
276 code in CHARSET. | 275 code in CHARSET. |
1681 If a coding system is specifed, the return value is a | 1680 If a coding system is specifed, the return value is a |
1682 cons (CODING . SOURCE), where CODING is the specified coding | 1681 cons (CODING . SOURCE), where CODING is the specified coding |
1683 system and SOURCE is a symbol `auto-coding-alist', | 1682 system and SOURCE is a symbol `auto-coding-alist', |
1684 `auto-coding-regexp-alist', `coding:', or `auto-coding-functions' | 1683 `auto-coding-regexp-alist', `coding:', or `auto-coding-functions' |
1685 indicating by what CODING is specified. Note that the validity | 1684 indicating by what CODING is specified. Note that the validity |
1686 of CODING is not checked; it's callers responsibility to check | 1685 of CODING is not checked; it's callers responsibility to check it. |
1687 it. | |
1688 | 1686 |
1689 If nothing is specified, the return value is nil." | 1687 If nothing is specified, the return value is nil." |
1690 (or (let ((coding-system (auto-coding-alist-lookup filename))) | 1688 (or (let ((coding-system (auto-coding-alist-lookup filename))) |
1691 (if coding-system | 1689 (if coding-system |
1692 (cons coding-system 'auto-coding-alist))) | 1690 (cons coding-system 'auto-coding-alist))) |
1703 coding-system head-found tail-found pos char-trans) | 1701 coding-system head-found tail-found pos char-trans) |
1704 ;; Try a short cut by searching for the string "coding:" | 1702 ;; Try a short cut by searching for the string "coding:" |
1705 ;; and for "unibyte:" at the head and tail of SIZE bytes. | 1703 ;; and for "unibyte:" at the head and tail of SIZE bytes. |
1706 (setq head-found (or (search-forward "coding:" head-end t) | 1704 (setq head-found (or (search-forward "coding:" head-end t) |
1707 (search-forward "unibyte:" head-end t) | 1705 (search-forward "unibyte:" head-end t) |
1708 (search-forward "enable-character-translation:" | 1706 (search-forward "enable-character-translation:" |
1709 head-end t))) | 1707 head-end t))) |
1710 (if (and head-found (> head-found tail-start)) | 1708 (if (and head-found (> head-found tail-start)) |
1711 ;; Head and tail are overlapped. | 1709 ;; Head and tail are overlapped. |
1712 (setq tail-found head-found) | 1710 (setq tail-found head-found) |
1713 (goto-char tail-start) | 1711 (goto-char tail-start) |
1877 ;; part of producing the buffer's initial contents. | 1875 ;; part of producing the buffer's initial contents. |
1878 (let ((buffer-undo-list t)) | 1876 (let ((buffer-undo-list t)) |
1879 (set-buffer-multibyte nil)) | 1877 (set-buffer-multibyte nil)) |
1880 (set-buffer-multibyte nil)) | 1878 (set-buffer-multibyte nil)) |
1881 (setq inserted (- pos-marker (point))))) | 1879 (setq inserted (- pos-marker (point))))) |
1882 (set-buffer-modified-p modified-p)))) | 1880 (restore-buffer-modified-p modified-p)))) |
1883 inserted) | 1881 inserted) |
1884 | 1882 |
1885 ;; The coding-spec and eol-type of coding-system returned is decided | 1883 ;; The coding-spec and eol-type of coding-system returned is decided |
1886 ;; independently in the following order. | 1884 ;; independently in the following order. |
1887 ;; 1. That of buffer-file-coding-system locally bound. | 1885 ;; 1. That of buffer-file-coding-system locally bound. |
2229 (,old-buffer (current-buffer))) | 2227 (,old-buffer (current-buffer))) |
2230 (unwind-protect | 2228 (unwind-protect |
2231 (progn | 2229 (progn |
2232 (set-category-table ,table) | 2230 (set-category-table ,table) |
2233 ,@body) | 2231 ,@body) |
2234 (save-current-buffer | 2232 (with-current-buffer ,old-buffer |
2235 (set-buffer ,old-buffer) | |
2236 (set-category-table ,old-table)))))) | 2233 (set-category-table ,old-table)))))) |
2237 | 2234 |
2238 (defun define-translation-hash-table (symbol table) | 2235 (defun define-translation-hash-table (symbol table) |
2239 "Define SYMBOL as the name of the hash translation TABLE for use in CCL. | 2236 "Define SYMBOL as the name of the hash translation TABLE for use in CCL. |
2240 | 2237 |