From: Kenichi Handa Date: Mon, 27 Oct 2008 02:12:03 +0000 (+0000) Subject: (describe-char): Fix terminal case (where font is nil). X-Git-Tag: emacs-pretest-23.0.90~2169 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a62ac7e3fd6cb81786c06317f453758d0e0956d4;p=emacs.git (describe-char): Fix terminal case (where font is nil). --- diff --git a/lisp/descr-text.el b/lisp/descr-text.el index e585f644cdf..689e4d3df6a 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -606,15 +606,23 @@ as well as widgets, buttons, overlays, and text properties." (nglyphs (lgstring-glyph-len gstring)) (i 0) glyph) - (insert " using this font:\n " - (symbol-name (font-get font :type)) - ?: - (aref (query-font font) 0) - "\nby these glyphs:\n") - (while (and (< i nglyphs) - (setq glyph (lgstring-glyph gstring i))) - (insert (format " %S\n" glyph)) - (setq i (1+ i)))) + (if font + (progn + (insert " using this font:\n " + (symbol-name (font-get font :type)) + ?: + (aref (query-font font) 0) + "\nby these glyphs:\n") + (while (and (< i nglyphs) + (setq glyph (lgstring-glyph gstring i))) + (insert (format " %S\n" glyph)) + (setq i (1+ i)))) + (insert " by these characters:\n") + (while (and (< i nglyphs) + (setq glyph (lgstring-glyph gstring i))) + (insert (format " %c (#x%d)\n" + (lglyph-char glyph) (lglyph-char glyph))) + (setq i (1+ i))))) (insert " by the rule:\n\t(") (let ((first t)) (mapc (lambda (x)