Mercurial > emacs
comparison lisp/international/latin1-disp.el @ 91968:28f7a9f11ad1
(latin1-display): Don't use
ucs-mule-8859-to-mule-unicode. Fix the way of resettting
standard-display-table.
(latin1-display-identities): Adjusted for the change of what is
returned by (get-language-info charset 'charset).
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Wed, 20 Feb 2008 04:43:26 +0000 |
parents | 4bfcd8ee1104 |
children | c450cdd35ee3 |
comparison
equal
deleted
inserted
replaced
91967:39b7a7b122f8 | 91968:28f7a9f11ad1 |
---|---|
99 (defun latin1-display (&rest sets) | 99 (defun latin1-display (&rest sets) |
100 "Set up Latin-1/ASCII display for the arguments character SETS. | 100 "Set up Latin-1/ASCII display for the arguments character SETS. |
101 See option `latin1-display' for the method. The members of the list | 101 See option `latin1-display' for the method. The members of the list |
102 must be in `latin1-display-sets'. With no arguments, reset the | 102 must be in `latin1-display-sets'. With no arguments, reset the |
103 display for all of `latin1-display-sets'. See also | 103 display for all of `latin1-display-sets'. See also |
104 `latin1-display-setup'. As well as iso-8859 characters, this treats | 104 `latin1-display-setup'." |
105 some characters in the `mule-unicode-...' charsets if you don't have | |
106 a Unicode font with which to display them." | |
107 (if sets | 105 (if sets |
108 (progn | 106 (progn |
109 (mapc #'latin1-display-setup sets) | 107 (mapc #'latin1-display-setup sets) |
110 (unless (char-displayable-p | 108 (unless (char-displayable-p |
111 (make-char 'mule-unicode-0100-24ff 32 33)) | 109 (make-char 'mule-unicode-0100-24ff 32 33)) |
112 ;; It doesn't look as though we have a Unicode font. | |
113 (map-char-table | |
114 (lambda (c uc) | |
115 (when (and (characterp c) | |
116 (characterp uc) | |
117 (not (aref standard-display-table uc))) | |
118 (aset standard-display-table uc | |
119 (or (aref standard-display-table c) | |
120 (vector c))))) | |
121 ucs-mule-8859-to-mule-unicode) | |
122 ;; Extra stuff for windows-1252, in particular. | 110 ;; Extra stuff for windows-1252, in particular. |
123 (mapc | 111 (mapc |
124 (lambda (l) | 112 (lambda (l) |
125 (apply 'latin1-display-char l)) | 113 (apply 'latin1-display-char l)) |
126 '((?\$,1rz(B ",") ;; SINGLE LOW-9 QUOTATION MARK | 114 '((?\$,1rz(B ",") ;; SINGLE LOW-9 QUOTATION MARK |
136 (?\$,1s:(B ">") ;; SINGLE RIGHT-POINTING ANGLE QUOTATION MARK | 124 (?\$,1s:(B ">") ;; SINGLE RIGHT-POINTING ANGLE QUOTATION MARK |
137 (?$,1s"(B ",A7(B") | 125 (?$,1s"(B ",A7(B") |
138 ))) | 126 ))) |
139 (setq latin1-display t)) | 127 (setq latin1-display t)) |
140 (mapc #'latin1-display-reset latin1-display-sets) | 128 (mapc #'latin1-display-reset latin1-display-sets) |
141 (aset standard-display-table | 129 (set-char-table-range standard-display-table '(#x0100 #x33FF) nil) |
142 (make-char 'mule-unicode-0100-24ff) nil) | 130 (set-char-table-range standard-display-table '(#xE000 #xFFFF) nil) |
143 (aset standard-display-table | |
144 (make-char 'mule-unicode-2500-33ff) nil) | |
145 (aset standard-display-table | |
146 (make-char 'mule-unicode-e000-ffff) nil) | |
147 (setq latin1-display nil) | 131 (setq latin1-display nil) |
148 (redraw-display))) | 132 (redraw-display))) |
149 | 133 |
150 (defcustom latin1-display-mnemonic nil | 134 (defcustom latin1-display-mnemonic nil |
151 "Non-nil means to display potentially more mnemonic sequences. | 135 "Non-nil means to display potentially more mnemonic sequences. |
189 (if (eq charset 'cyrillic) | 173 (if (eq charset 'cyrillic) |
190 (setq charset 'cyrillic-iso)) | 174 (setq charset 'cyrillic-iso)) |
191 (let ((i 32) | 175 (let ((i 32) |
192 (set (car (remq 'ascii (get-language-info charset 'charset))))) | 176 (set (car (remq 'ascii (get-language-info charset 'charset))))) |
193 (while (<= i 127) | 177 (while (<= i 127) |
194 (aset standard-display-table | 178 (let ((ch (decode-char set (+ i 128)))) |
195 (make-char set i) | 179 (if ch |
196 (vector (make-char 'latin-iso8859-1 i))) | 180 (aset standard-display-table ch |
181 (vector (make-char 'latin-iso8859-1 i))))) | |
197 (setq i (1+ i))))) | 182 (setq i (1+ i))))) |
198 | 183 |
199 (defun latin1-display-reset (language) | 184 (defun latin1-display-reset (language) |
200 "Set up the default display for each character of LANGUAGE's charset. | 185 "Set up the default display for each character of LANGUAGE's charset. |
201 LANGUAGE is a symbol naming a language environment using an ISO8859 | 186 LANGUAGE is a symbol naming a language environment using an ISO8859 |