emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/international/mule-diag.el,v


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/lisp/international/mule-diag.el,v
Date: Fri, 04 Aug 2006 01:48:10 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kenichi Handa <handa>   06/08/04 01:48:10

Index: mule-diag.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/international/mule-diag.el,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -b -r1.98 -r1.99
--- mule-diag.el        24 Sep 2005 13:43:59 -0000      1.98
+++ mule-diag.el        4 Aug 2006 01:48:10 -0000       1.99
@@ -1039,18 +1039,28 @@
 
 ;;;###autoload
 (defun describe-font (fontname)
-  "Display information about fonts which partially match FONTNAME."
-  (interactive "sFontname (default current choice for ASCII chars): ")
+  "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): ")
   (or (and window-system (fboundp 'fontset-list))
-      (error "No fontsets being used"))
+      (error "No fonts being used"))
+  (let (fontset font-info)
   (when (or (not fontname) (= (length fontname) 0))
-    (setq fontname (cdr (assq 'font (frame-parameters))))
+      (setq fontname (frame-parameter nil 'font))
+      ;; Check if FONTNAME is a fontset.
     (if (query-fontset fontname)
-       (setq fontname
-             (nth 1 (assq 'ascii (aref (fontset-info fontname) 2))))))
-  (let ((font-info (font-info fontname)))
+         (setq fontset fontname
+               fontname (nth 1 (assq 'ascii
+                                     (aref (fontset-info fontname) 2))))))
+    (setq font-info (font-info fontname))
     (if (null font-info)
-       (message "No matching font")
+       (if fontset
+           ;; 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
+           ;; this problem.
+           (message "No information about \"%s\"" fontname)
+         (message "No matching font being used"))
       (with-output-to-temp-buffer "*Help*"
        (describe-font-internal font-info 'verbose)))))
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]