]> git.eshelyaron.com Git - emacs.git/commitdiff
describe-font/font-info works with unloaded fonts
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 3 Nov 2019 15:33:15 +0000 (16:33 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 3 Nov 2019 15:33:15 +0000 (16:33 +0100)
* 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.

lisp/international/mule-diag.el
src/font.c

index dcdcafcea771d1be98ccd6d97cbc441819b66bac..c4122c92716d30251e677f0f0044b6249611f711 100644 (file)
@@ -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"))
index 7fdadb17c14910eaea1b14e8eedb120c6644032b..156107e5897bf64fff5f9bc343fa23bced270928 100644 (file)
@@ -5127,9 +5127,7 @@ where
         FEATURE is a symbol representing OpenType feature tag.
 
       If the font is not an OpenType font, there are no elements
-      in CAPABILITY except the font format symbol.
-
-If the named font is not yet loaded, return nil.  */)
+      in CAPABILITY except the font format symbol.  */)
   (Lisp_Object name, Lisp_Object frame)
 {
   struct frame *f;