diff options
| author | Juanma Barranquero | 2008-07-25 12:01:59 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2008-07-25 12:01:59 +0000 |
| commit | c57b496bfce774a493e1408766d3471ba06784e2 (patch) | |
| tree | 4ea9a78298ae27b5b0c9182076f906bc9b81fb76 | |
| parent | f31cf550ca95e76bbff474487c68bb36992f96c3 (diff) | |
| download | emacs-c57b496bfce774a493e1408766d3471ba06784e2.tar.gz emacs-c57b496bfce774a493e1408766d3471ba06784e2.zip | |
* 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'.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/descr-text.el | 25 |
2 files changed, 19 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3775d4fc478..89e61bbd084 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2008-07-25 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * descr-text.el (describe-char): Don't overwrite local variable char | ||
| 4 | when describing characters with display-table entries. Display font | ||
| 5 | backend when describing composed characters. Simplify: use `let' | ||
| 6 | instead of `let*', and `or x y' instead of `if x x y'. | ||
| 7 | |||
| 1 | 2008-07-25 Chong Yidong <cyd@stupidchicken.com> | 8 | 2008-07-25 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 9 | ||
| 3 | * image-mode.el (image-minor-mode): Set up winprops. | 10 | * image-mode.el (image-minor-mode): Set up winprops. |
diff --git a/lisp/descr-text.el b/lisp/descr-text.el index e14e1edbebb..42d7c7e60d5 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el | |||
| @@ -335,7 +335,7 @@ This function is semi-obsolete. Use `get-char-code-property'." | |||
| 335 | (let ((char-font-info (internal-char-font pos char))) | 335 | (let ((char-font-info (internal-char-font pos char))) |
| 336 | (if char-font-info | 336 | (if char-font-info |
| 337 | (let ((type (font-get (car char-font-info) :type)) | 337 | (let ((type (font-get (car char-font-info) :type)) |
| 338 | (name (font-xlfd-name (car char-font-info))) | 338 | (name (font-xlfd-name (car char-font-info))) |
| 339 | (code (cdr char-font-info))) | 339 | (code (cdr char-font-info))) |
| 340 | (if (integerp code) | 340 | (if (integerp code) |
| 341 | (format "%s:%s (#x%02X)" type name code) | 341 | (format "%s:%s (#x%02X)" type name code) |
| @@ -461,10 +461,10 @@ as well as widgets, buttons, overlays, and text properties." | |||
| 461 | (disp-vector | 461 | (disp-vector |
| 462 | (setq disp-vector (copy-sequence disp-vector)) | 462 | (setq disp-vector (copy-sequence disp-vector)) |
| 463 | (dotimes (i (length disp-vector)) | 463 | (dotimes (i (length disp-vector)) |
| 464 | (setq char (aref disp-vector i)) | ||
| 465 | (aset disp-vector i | 464 | (aset disp-vector i |
| 466 | (cons char (describe-char-display | 465 | (cons (aref disp-vector i) |
| 467 | pos (glyph-char char))))) | 466 | (describe-char-display |
| 467 | pos (glyph-char (aref disp-vector i)))))) | ||
| 468 | (format "by display table entry [%s] (see below)" | 468 | (format "by display table entry [%s] (see below)" |
| 469 | (mapconcat | 469 | (mapconcat |
| 470 | #'(lambda (x) | 470 | #'(lambda (x) |
| @@ -544,7 +544,7 @@ as well as widgets, buttons, overlays, and text properties." | |||
| 544 | (save-excursion | 544 | (save-excursion |
| 545 | (goto-char (point-min)) | 545 | (goto-char (point-min)) |
| 546 | (re-search-forward "character:[ \t\n]+") | 546 | (re-search-forward "character:[ \t\n]+") |
| 547 | (let* ((end (+ (point) (length char-description)))) | 547 | (let ((end (+ (point) (length char-description)))) |
| 548 | (mapc #'(lambda (props) | 548 | (mapc #'(lambda (props) |
| 549 | (let ((o (make-overlay (point) end))) | 549 | (let ((o (make-overlay (point) end))) |
| 550 | (while props | 550 | (while props |
| @@ -561,9 +561,7 @@ as well as widgets, buttons, overlays, and text properties." | |||
| 561 | (dotimes (i (length disp-vector)) | 561 | (dotimes (i (length disp-vector)) |
| 562 | (insert (glyph-char (car (aref disp-vector i))) ?: | 562 | (insert (glyph-char (car (aref disp-vector i))) ?: |
| 563 | (propertize " " 'display '(space :align-to 5)) | 563 | (propertize " " 'display '(space :align-to 5)) |
| 564 | (if (cdr (aref disp-vector i)) | 564 | (or (cdr (aref disp-vector i)) "-- no font --") |
| 565 | (cdr (aref disp-vector i)) | ||
| 566 | "-- no font --") | ||
| 567 | "\n") | 565 | "\n") |
| 568 | (let ((face (glyph-face (car (aref disp-vector i))))) | 566 | (let ((face (glyph-face (car (aref disp-vector i))))) |
| 569 | (when face | 567 | (when face |
| @@ -600,16 +598,17 @@ as well as widgets, buttons, overlays, and text properties." | |||
| 600 | "\""))) | 598 | "\""))) |
| 601 | (if (and (vectorp (nth 2 composition)) | 599 | (if (and (vectorp (nth 2 composition)) |
| 602 | (vectorp (aref (nth 2 composition) 0))) | 600 | (vectorp (aref (nth 2 composition) 0))) |
| 603 | (progn | 601 | (let ((font (aref (aref (nth 2 composition) 0) 0))) |
| 604 | (insert " using this font:\n " | 602 | (insert " using this font:\n " |
| 605 | (aref (query-font (aref (aref (nth 2 composition) 0) 0)) | 603 | (symbol-name (font-get font :type)) |
| 606 | 0) | 604 | ?: |
| 605 | (aref (query-font font) 0) | ||
| 607 | "\nby these glyphs:\n") | 606 | "\nby these glyphs:\n") |
| 608 | (mapc (lambda (x) (insert (format " %S\n" x))) | 607 | (mapc (lambda (x) (insert (format " %S\n" x))) |
| 609 | (nth 2 composition))) | 608 | (nth 2 composition))) |
| 610 | (insert " by the rule:\n\t(") | 609 | (insert " by the rule:\n\t(") |
| 611 | (let ((first t)) | 610 | (let ((first t)) |
| 612 | (mapc (lambda (x) | 611 | (mapc (lambda (x) |
| 613 | (if first (setq first nil) | 612 | (if first (setq first nil) |
| 614 | (insert " ")) | 613 | (insert " ")) |
| 615 | (if (consp x) (insert (format "%S" x)) | 614 | (if (consp x) (insert (format "%S" x)) |
| @@ -623,7 +622,7 @@ as well as widgets, buttons, overlays, and text properties." | |||
| 623 | (insert "these fonts (glyph codes):") | 622 | (insert "these fonts (glyph codes):") |
| 624 | (dolist (elt component-chars) | 623 | (dolist (elt component-chars) |
| 625 | (if (/= (car elt) ?\t) | 624 | (if (/= (car elt) ?\t) |
| 626 | (insert "\n " | 625 | (insert "\n " |
| 627 | (describe-char-padded-string (car elt)) | 626 | (describe-char-padded-string (car elt)) |
| 628 | ?: | 627 | ?: |
| 629 | (propertize " " 'display '(space :align-to 5)) | 628 | (propertize " " 'display '(space :align-to 5)) |