49 |
|
|
50 |
;; Ensure `standard-display-table' is set up: |
;; Ensure `standard-display-table' is set up: |
51 |
(require 'disp-table) |
(require 'disp-table) |
|
(require 'ucs-tables) |
|
52 |
|
|
53 |
(defconst latin1-display-sets '(latin-2 latin-3 latin-4 latin-5 latin-8 |
(defconst latin1-display-sets '(latin-2 latin-3 latin-4 latin-5 latin-8 |
54 |
latin-9 arabic cyrillic greek hebrew) |
latin-9 arabic cyrillic greek hebrew) |
65 |
(defcustom latin1-display-format "{%s}" |
(defcustom latin1-display-format "{%s}" |
66 |
"A format string used to display the ASCII sequences. |
"A format string used to display the ASCII sequences. |
67 |
The default encloses the sequence in braces, but you could just use |
The default encloses the sequence in braces, but you could just use |
68 |
\"%s\" to avoid the braces." |
\"%s\" to avoid the braces, maybe with a non-default value of |
69 |
|
`latin1-display-face'." |
70 |
:group 'latin1-display |
:group 'latin1-display |
71 |
:type 'string) |
:type 'string) |
72 |
|
|
152 |
:type 'boolean |
:type 'boolean |
153 |
:group 'latin1-display) |
:group 'latin1-display) |
154 |
|
|
155 |
|
(defcustom latin1-display-face 'default |
156 |
|
"Face to use for displaying substituted ASCII sequences." |
157 |
|
:type 'face |
158 |
|
:version "21.4" |
159 |
|
:group 'latin1-display) |
160 |
|
|
161 |
(defun latin1-display-char (char display &optional alt-display) |
(defun latin1-display-char (char display &optional alt-display) |
162 |
"Make an entry in `standard-display-table' for CHAR using string DISPLAY. |
"Make an entry in `standard-display-table' for CHAR using string DISPLAY. |
163 |
If ALT-DISPLAY is provided, use that instead if |
If ALT-DISPLAY is provided, use that instead if |
172 |
latin1-display-mnemonic) |
latin1-display-mnemonic) |
173 |
(setq display alt-display)) |
(setq display alt-display)) |
174 |
(if (stringp display) |
(if (stringp display) |
175 |
(standard-display-ascii char (format latin1-display-format display)) |
(if (eq 'default latin1-display-face) |
176 |
(aset standard-display-table char display))) |
(standard-display-ascii char (format latin1-display-format display)) |
177 |
|
(aset standard-display-table char |
178 |
|
(vconcat (mapcar (lambda (c) |
179 |
|
(logior c (lsh (face-id latin1-display-face) |
180 |
|
19))) |
181 |
|
display)))) |
182 |
|
(aset standard-display-table char |
183 |
|
(if (eq 'default latin1-display-face) |
184 |
|
display |
185 |
|
(logior display (lsh (face-id latin1-display-face) 19)))))) |
186 |
|
|
187 |
(defun latin1-display-identities (charset) |
(defun latin1-display-identities (charset) |
188 |
"Display each character in CHARSET as the corresponding Latin-1 character. |
"Display each character in CHARSET as the corresponding Latin-1 character. |
796 |
(?,Lx(B "j"))))) |
(?,Lx(B "j"))))) |
797 |
|
|
798 |
(t (error "Unsupported character set: %S" set))) |
(t (error "Unsupported character set: %S" set))) |
799 |
|
|
800 |
(sit-for 0)) |
(sit-for 0)) |
801 |
|
|
802 |
;;;###autoload |
;;;###autoload |