emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/disp-table.el,v


From: Kim F. Storm
Subject: [Emacs-diffs] Changes to emacs/lisp/disp-table.el,v
Date: Wed, 14 Feb 2007 11:28:41 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kim F. Storm <kfstorm>  07/02/14 11:28:40

Index: disp-table.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/disp-table.el,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- disp-table.el       21 Jan 2007 03:53:12 -0000      1.64
+++ disp-table.el       14 Feb 2007 11:28:40 -0000      1.65
@@ -172,7 +172,7 @@
   (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 @@
   (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.
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]