diff options
| author | Kim F. Storm | 2007-02-14 11:28:40 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2007-02-14 11:28:40 +0000 |
| commit | 7dbfbd9191092032c2878b6d0eac28773e2982e5 (patch) | |
| tree | f1f31341690800450917ed655eac930f8be63394 | |
| parent | da55bb9600b988d1ccba72c6272b8df64e218bf2 (diff) | |
| download | emacs-7dbfbd9191092032c2878b6d0eac28773e2982e5.tar.gz emacs-7dbfbd9191092032c2878b6d0eac28773e2982e5.zip | |
(make-glyph-code, glyph-char, glyph-face): New defuns.
(standard-display-underline): Use make-glyph-code.
| -rw-r--r-- | lisp/disp-table.el | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/lisp/disp-table.el b/lisp/disp-table.el index fa98086b0bc..2a4dd01897d 100644 --- a/lisp/disp-table.el +++ b/lisp/disp-table.el | |||
| @@ -172,7 +172,7 @@ X frame." | |||
| 172 | (aset standard-display-table c | 172 | (aset standard-display-table c |
| 173 | (vector | 173 | (vector |
| 174 | (if window-system | 174 | (if window-system |
| 175 | (logior uc (lsh (face-id 'underline) 19)) | 175 | (make-glyph-code uc 'underline) |
| 176 | (create-glyph (concat "\e[4m" (char-to-string uc) "\e[m")))))) | 176 | (create-glyph (concat "\e[4m" (char-to-string uc) "\e[m")))))) |
| 177 | 177 | ||
| 178 | ;;;###autoload | 178 | ;;;###autoload |
| @@ -187,6 +187,30 @@ X frame." | |||
| 187 | (1- (length glyph-table))) | 187 | (1- (length glyph-table))) |
| 188 | 188 | ||
| 189 | ;;;###autoload | 189 | ;;;###autoload |
| 190 | (defun make-glyph-code (char &optional face) | ||
| 191 | "Return a glyph code representing char CHAR with face FACE." | ||
| 192 | ;; Due to limitations on Emacs integer values, faces with | ||
| 193 | ;; face id greater that 4091 are silently ignored. | ||
| 194 | (if (and face (<= (face-id face) #xfff)) | ||
| 195 | (logior char (lsh (face-id face) 19)) | ||
| 196 | char)) | ||
| 197 | |||
| 198 | ;;;###autoload | ||
| 199 | (defun glyph-char (glyph) | ||
| 200 | "Return the character of glyph code GLYPH." | ||
| 201 | (logand glyph #x7ffff)) | ||
| 202 | |||
| 203 | ;;;###autoload | ||
| 204 | (defun glyph-face (glyph) | ||
| 205 | "Return the face of glyph code GLYPH, or nil if glyph has default face." | ||
| 206 | (let ((face-id (lsh glyph -19))) | ||
| 207 | (and (> face-id 0) | ||
| 208 | (car (delq nil (mapcar (lambda (face) | ||
| 209 | (and (eq (get face 'face) face-id) | ||
| 210 | face)) | ||
| 211 | (face-list))))))) | ||
| 212 | |||
| 213 | ;;;###autoload | ||
| 190 | (defun standard-display-european (arg) | 214 | (defun standard-display-european (arg) |
| 191 | "Semi-obsolete way to toggle display of ISO 8859 European characters. | 215 | "Semi-obsolete way to toggle display of ISO 8859 European characters. |
| 192 | 216 | ||