# HG changeset patch # User Juanma Barranquero # Date 1216987319 0 # Node ID 8e17e43e57e99b2a142e5a98e1f3ff05d9367d45 # Parent 1b8d15c8653f3c8c3bca5794b114062360c88bc8 * 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'. diff -r 1b8d15c8653f -r 8e17e43e57e9 lisp/ChangeLog --- a/lisp/ChangeLog Fri Jul 25 11:25:43 2008 +0000 +++ b/lisp/ChangeLog Fri Jul 25 12:01:59 2008 +0000 @@ -1,3 +1,10 @@ +2008-07-25 Juanma Barranquero + + * 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 * image-mode.el (image-minor-mode): Set up winprops. diff -r 1b8d15c8653f -r 8e17e43e57e9 lisp/descr-text.el --- a/lisp/descr-text.el Fri Jul 25 11:25:43 2008 +0000 +++ b/lisp/descr-text.el Fri Jul 25 12:01:59 2008 +0000 @@ -335,7 +335,7 @@ (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 @@ (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 @@ (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 @@ (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 @@ "\""))) (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 @@ (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))