summaryrefslogtreecommitdiff
path: root/lisp/disp-table.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-02-26 23:03:45 +0000
committerMiles Bader <miles@gnu.org>2007-02-26 23:03:45 +0000
commita73d7753f965734247be482efa125da5235996da (patch)
tree56af26fb1a12a2c93c146aac923947968c4c9d76 /lisp/disp-table.el
parent55a5664de23c07003d4d2584fc065619609500b6 (diff)
parentf6f3d0b9133d06b29523c7bc744130cddc5c8d6b (diff)
downloademacs-a73d7753f965734247be482efa125da5235996da.tar.gz
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 638-652) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 202) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-177
Diffstat (limited to 'lisp/disp-table.el')
-rw-r--r--lisp/disp-table.el26
1 files changed, 25 insertions, 1 deletions
diff --git a/lisp/disp-table.el b/lisp/disp-table.el
index dd884b246db..dbe67dacb39 100644
--- a/lisp/disp-table.el
+++ b/lisp/disp-table.el
@@ -172,7 +172,7 @@ X frame."
(aset standard-display-table c
(vector
(if window-system
- (logior uc (lsh (face-id 'underline) 19))
+ (make-glyph-code uc 'underline)
(create-glyph (concat "\e[4m" (char-to-string uc) "\e[m"))))))
;;;###autoload
@@ -187,6 +187,30 @@ X frame."
(1- (length glyph-table)))
;;;###autoload
+(defun make-glyph-code (char &optional face)
+ "Return a glyph code representing char CHAR with face FACE."
+ ;; Due to limitations on Emacs integer values, faces with
+ ;; face id greater that 4091 are silently ignored.
+ (if (and face (<= (face-id face) #xfff))
+ (logior char (lsh (face-id face) 19))
+ char))
+
+;;;###autoload
+(defun glyph-char (glyph)
+ "Return the character of glyph code GLYPH."
+ (logand glyph #x7ffff))
+
+;;;###autoload
+(defun glyph-face (glyph)
+ "Return the face of glyph code GLYPH, or nil if glyph has default face."
+ (let ((face-id (lsh glyph -19)))
+ (and (> face-id 0)
+ (car (delq nil (mapcar (lambda (face)
+ (and (eq (get face 'face) face-id)
+ face))
+ (face-list)))))))
+
+;;;###autoload
(defun standard-display-european (arg)
"Semi-obsolete way to toggle display of ISO 8859 European characters.