]> git.eshelyaron.com Git - emacs.git/commitdiff
* descr-text.el (describe-char): Don't overwrite local variable char
authorJuanma Barranquero <lekktu@gmail.com>
Fri, 25 Jul 2008 12:01:59 +0000 (12:01 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Fri, 25 Jul 2008 12:01:59 +0000 (12:01 +0000)
  when describing characters with display-table entries.  Display font
  backend when describing composed characters.  Simplify: use `let'
  instead of `let*', and `or x y' instead of `if x x y'.

lisp/ChangeLog
lisp/descr-text.el

index 3775d4fc478d8c897c4283ff70d0178a7cf9989a..89e61bbd0848df2ad23216104633f378070a7cf6 100644 (file)
@@ -1,3 +1,10 @@
+2008-07-25  Juanma Barranquero  <lekktu@gmail.com>
+
+       * descr-text.el (describe-char): Don't overwrite local variable char
+       when describing characters with display-table entries.  Display font
+       backend when describing composed characters.  Simplify: use `let'
+       instead of `let*', and `or x y' instead of `if x x y'.
+
 2008-07-25  Chong Yidong  <cyd@stupidchicken.com>
 
        * image-mode.el (image-minor-mode): Set up winprops.
index e14e1edbebb66aa7fa1701833e06465625bda930..42d7c7e60d5d3d66ddc4c937b85596045fe0844e 100644 (file)
@@ -335,7 +335,7 @@ This function is semi-obsolete.  Use `get-char-code-property'."
       (let ((char-font-info (internal-char-font pos char)))
        (if char-font-info
            (let ((type (font-get (car char-font-info) :type))
-                 (name (font-xlfd-name  (car char-font-info)))
+                 (name (font-xlfd-name (car char-font-info)))
                  (code (cdr char-font-info)))
               (if (integerp code)
                   (format "%s:%s (#x%02X)" type name code)
@@ -461,10 +461,10 @@ as well as widgets, buttons, overlays, and text properties."
               (disp-vector
                (setq disp-vector (copy-sequence disp-vector))
                (dotimes (i (length disp-vector))
-                 (setq char (aref disp-vector i))
                  (aset disp-vector i
-                       (cons char (describe-char-display
-                                   pos (glyph-char char)))))
+                       (cons (aref disp-vector i)
+                             (describe-char-display
+                              pos (glyph-char (aref disp-vector i))))))
                (format "by display table entry [%s] (see below)"
                        (mapconcat
                         #'(lambda (x)
@@ -544,7 +544,7 @@ as well as widgets, buttons, overlays, and text properties."
          (save-excursion
            (goto-char (point-min))
            (re-search-forward "character:[ \t\n]+")
-           (let* ((end (+ (point) (length char-description))))
+           (let ((end (+ (point) (length char-description))))
              (mapc #'(lambda (props)
                        (let ((o (make-overlay (point) end)))
                          (while props
@@ -561,9 +561,7 @@ as well as widgets, buttons, overlays, and text properties."
                (dotimes (i (length disp-vector))
                  (insert (glyph-char (car (aref disp-vector i))) ?:
                          (propertize " " 'display '(space :align-to 5))
-                         (if (cdr (aref disp-vector i))
-                             (cdr (aref disp-vector i))
-                           "-- no font --")
+                         (or (cdr (aref disp-vector i)) "-- no font --")
                          "\n")
                  (let ((face (glyph-face (car (aref disp-vector i)))))
                    (when face
@@ -600,16 +598,17 @@ as well as widgets, buttons, overlays, and text properties."
                        "\"")))
          (if (and (vectorp (nth 2 composition))
                   (vectorp (aref (nth 2 composition) 0)))
-             (progn
+             (let ((font (aref (aref (nth 2 composition) 0) 0)))
                (insert " using this font:\n  "
-                       (aref (query-font (aref (aref (nth 2 composition) 0) 0))
-                             0)
+                       (symbol-name (font-get font :type))
+                       ?:
+                       (aref (query-font font) 0)
                        "\nby these glyphs:\n")
                (mapc (lambda (x) (insert (format "  %S\n" x)))
                      (nth 2 composition)))
            (insert " by the rule:\n\t(")
            (let ((first t))
-             (mapc (lambda (x) 
+             (mapc (lambda (x)
                      (if first (setq first nil)
                        (insert " "))
                      (if (consp x) (insert (format "%S" x))
@@ -623,7 +622,7 @@ as well as widgets, buttons, overlays, and text properties."
                  (insert "these fonts (glyph codes):")
                  (dolist (elt component-chars)
                    (if (/= (car elt) ?\t)
-                       (insert "\n " 
+                       (insert "\n "
                                (describe-char-padded-string (car elt))
                                ?:
                                (propertize " " 'display '(space :align-to 5))