]> code.delx.au - gnu-emacs/blobdiff - lisp/descr-text.el
Update GPL version for Emacs images.
[gnu-emacs] / lisp / descr-text.el
index 8fb28930fbf84c0758b934940a40e4d5037a78ad..d14aba7ae6f40b31dc304867b5fe93c62622f5c5 100644 (file)
@@ -1,7 +1,7 @@
 ;;; descr-text.el --- describe text mode
 
 ;; Copyright (C) 1994, 1995, 1996, 2001, 2002, 2003, 2004,
-;;   2005, 2006 Free Software Foundation, Inc.
+;;   2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Boris Goldowsky <boris@gnu.org>
 ;; Maintainer: FSF
@@ -11,7 +11,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -212,11 +212,10 @@ The list is null if CHAR isn't found in `describe-char-unicodedata-file'."
   (when describe-char-unicodedata-file
     (unless (file-exists-p describe-char-unicodedata-file)
       (error "`unicodedata-file' %s not found" describe-char-unicodedata-file))
-    (with-current-buffer
-       ;; Find file in fundamental mode to avoid, e.g. flyspell turned
-       ;; on for .txt.  Don't use RAWFILE arg in case of DOS line endings.
-       (let ((auto-mode-alist))
-         (find-file-noselect describe-char-unicodedata-file))
+    (with-current-buffer (get-buffer-create " *Unicode Data*")
+      (when (zerop (buffer-size))
+       ;; Don't use -literally in case of DOS line endings.
+       (insert-file-contents describe-char-unicodedata-file))
       (goto-char (point-min))
       (let ((hex (format "%04X" char))
            found first last)
@@ -529,11 +528,11 @@ as well as widgets, buttons, overlays, and text properties."
                  (setq char (aref disp-vector i))
                  (aset disp-vector i
                        (cons char (describe-char-display
-                                   pos (logand char #x7ffff)))))
+                                   pos (glyph-char char)))))
                (format "by display table entry [%s] (see below)"
                        (mapconcat
                         #'(lambda (x)
-                            (format "?%c" (logand (car x) #x7ffff)))
+                            (format "?%c" (glyph-char (car x))))
                         disp-vector " ")))
               (composition
                (let ((from (car composition))
@@ -628,25 +627,19 @@ as well as widgets, buttons, overlays, and text properties."
              (progn
                (insert "these fonts (glyph codes):\n")
                (dotimes (i (length disp-vector))
-                 (insert (logand (car (aref disp-vector i)) #x7ffff) ?:
+                 (insert (glyph-char (car (aref disp-vector i))) ?:
                          (propertize " " 'display '(space :align-to 5))
                          (if (cdr (aref disp-vector i))
                              (format "%s (#x%02X)" (cadr (aref disp-vector i))
                                      (cddr (aref disp-vector i)))
                            "-- no font --")
                          "\n")
-                 (when (> (car (aref disp-vector i)) #x7ffff)
-                   (let* ((face-id (lsh (car (aref disp-vector i)) -19))
-                          (face (car (delq nil (mapcar
-                                                (lambda (face)
-                                                  (and (eq (face-id face)
-                                                           face-id) face))
-                                                (face-list))))))
-                     (when face
-                       (insert (propertize " " 'display '(space :align-to 5))
-                               "face: ")
-                       (insert (concat "`" (symbol-name face) "'"))
-                       (insert "\n"))))))
+                 (let ((face (glyph-face (car (aref disp-vector i)))))
+                   (when face
+                     (insert (propertize " " 'display '(space :align-to 5))
+                             "face: ")
+                     (insert (concat "`" (symbol-name face) "'"))
+                     (insert "\n")))))
            (insert "these terminal codes:\n")
            (dotimes (i (length disp-vector))
              (insert (car (aref disp-vector i))