From b28ad0e9f74646b1126af096a41af20d3e01ad68 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 2 Sep 2015 14:43:03 -0700 Subject: [PATCH] Fix describe-char bug with glyphs on terminals MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * lisp/descr-text.el (describe-char): Terminals can have glyphs in buffers too, so don’t treat them differently from graphic displays. Without this fix, describe-char would throw an error on a terminal if given a glyph with a non-default face. --- lisp/descr-text.el | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 237cc00a36f..f81b08477bb 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -724,25 +724,17 @@ relevant to POS." (when disp-vector (insert "\nThe display table entry is displayed by ") - (if (display-graphic-p (selected-frame)) - (progn - (insert "these fonts (glyph codes):\n") - (dotimes (i (length disp-vector)) - (insert (glyph-char (car (aref disp-vector i))) ?: - (propertize " " 'display '(space :align-to 5)) - (or (cdr (aref disp-vector i)) "-- no font --") - "\n") - (let ((face (glyph-face (car (aref disp-vector i))))) - (when face - (insert (propertize " " 'display '(space :align-to 5)) - "face: ") - (insert (format-message "‘%s’\n" face)))))) - (insert "these terminal codes:\n") - (dotimes (i (length disp-vector)) - (insert (car (aref disp-vector i)) - (propertize " " 'display '(space :align-to 5)) - (or (cdr (aref disp-vector i)) "-- not encodable --") - "\n")))) + (insert "these fonts (glyph codes):\n") + (dotimes (i (length disp-vector)) + (insert (glyph-char (car (aref disp-vector i))) ?: + (propertize " " 'display '(space :align-to 5)) + (or (cdr (aref disp-vector i)) "-- no font --") + "\n") + (let ((face (glyph-face (car (aref disp-vector i))))) + (when face + (insert (propertize " " 'display '(space :align-to 5)) + "face: ") + (insert (format-message "‘%s’\n" face)))))) (when composition (insert "\nComposed") -- 2.39.2