summaryrefslogtreecommitdiff
path: root/lisp/international
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-11-03 16:33:15 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2019-11-03 16:33:15 +0100
commit5c8375bd681a7819e536dda84d63fb950595967d (patch)
treedd06b92d4f99b6c22075ca9c70a76e0bf532abe9 /lisp/international
parentba8a7882de5bbdb39c9c1d74297a9613aa28463f (diff)
downloademacs-5c8375bd681a7819e536dda84d63fb950595967d.tar.gz
emacs-5c8375bd681a7819e536dda84d63fb950595967d.tar.bz2
emacs-5c8375bd681a7819e536dda84d63fb950595967d.zip
describe-font/font-info works with unloaded fonts
* lisp/international/mule-diag.el (describe-font): This function can be used on unloaded fonts, so remove that restriction from the doc string (bug#16815). Also allow completion over all fonts on the system. * src/font.c (Ffont_info): Ditto for the doc string.
Diffstat (limited to 'lisp/international')
-rw-r--r--lisp/international/mule-diag.el18
1 files changed, 12 insertions, 6 deletions
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el
index dcdcafcea77..c4122c92716 100644
--- a/lisp/international/mule-diag.el
+++ b/lisp/international/mule-diag.el
@@ -835,9 +835,16 @@ The IGNORED argument is ignored."
;;;###autoload
(defun describe-font (fontname)
- "Display information about a font whose name is FONTNAME.
-The font must be already used by Emacs."
- (interactive "sFont name (default current choice for ASCII chars): ")
+ "Display information about a font whose name is FONTNAME."
+ (interactive
+ (list (completing-read
+ "Font name (default current choice for ASCII chars): "
+ (and window-system
+ (fboundp 'fontset-list)
+ ;; The final element in `fontset-list' is a default
+ ;; (generic) one, so don't include that.
+ (nconc (butlast (fontset-list))
+ (x-list-fonts "*"))))))
(or (and window-system (fboundp 'fontset-list))
(error "No fonts being used"))
(let ((xref-item (list #'describe-font fontname))
@@ -847,9 +854,8 @@ The font must be already used by Emacs."
(setq font-info (font-info fontname))
(if (null font-info)
(if (fontp fontname 'font-object)
- ;; The font should be surely used. So, there's some
- ;; problem about getting information about it. It is
- ;; better to print the fontname to show which font has
+ ;; If there's some problem with getting information about
+ ;; the font, print the font name to show which font has
;; this problem.
(message "No information about \"%s\"" (font-xlfd-name fontname))
(message "No matching font found"))