aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2006-08-04 01:48:10 +0000
committerKenichi Handa2006-08-04 01:48:10 +0000
commitfca31fbb6681f58052d28cd21f90b1510fe88292 (patch)
treeb974dcd4ec57e35e67d243edd5737447631a325b
parentdc3ca1078f41aaf51d84fe06f9cdf22672b8a85e (diff)
downloademacs-fca31fbb6681f58052d28cd21f90b1510fe88292.tar.gz
emacs-fca31fbb6681f58052d28cd21f90b1510fe88292.zip
(describe-font): Improve docstring
and error message. Use frame-parameter (not frame-parameters).
-rw-r--r--lisp/international/mule-diag.el30
1 files changed, 20 insertions, 10 deletions
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el
index 0a2e5a7c325..57b77249ba8 100644
--- a/lisp/international/mule-diag.el
+++ b/lisp/international/mule-diag.el
@@ -1039,18 +1039,28 @@ but still contains full information about each coding system."
1039 1039
1040;;;###autoload 1040;;;###autoload
1041(defun describe-font (fontname) 1041(defun describe-font (fontname)
1042 "Display information about fonts which partially match FONTNAME." 1042 "Display information about a font whose name is FONTNAME.
1043 (interactive "sFontname (default current choice for ASCII chars): ") 1043The font must be already used by Emacs."
1044 (interactive "sFont name (default current choice for ASCII chars): ")
1044 (or (and window-system (fboundp 'fontset-list)) 1045 (or (and window-system (fboundp 'fontset-list))
1045 (error "No fontsets being used")) 1046 (error "No fonts being used"))
1046 (when (or (not fontname) (= (length fontname) 0)) 1047 (let (fontset font-info)
1047 (setq fontname (cdr (assq 'font (frame-parameters)))) 1048 (when (or (not fontname) (= (length fontname) 0))
1048 (if (query-fontset fontname) 1049 (setq fontname (frame-parameter nil 'font))
1049 (setq fontname 1050 ;; Check if FONTNAME is a fontset.
1050 (nth 1 (assq 'ascii (aref (fontset-info fontname) 2)))))) 1051 (if (query-fontset fontname)
1051 (let ((font-info (font-info fontname))) 1052 (setq fontset fontname
1053 fontname (nth 1 (assq 'ascii
1054 (aref (fontset-info fontname) 2))))))
1055 (setq font-info (font-info fontname))
1052 (if (null font-info) 1056 (if (null font-info)
1053 (message "No matching font") 1057 (if fontset
1058 ;; The font should be surely used. So, there's some
1059 ;; problem about getting information about it. It is
1060 ;; better to print the fontname to show which font has
1061 ;; this problem.
1062 (message "No information about \"%s\"" fontname)
1063 (message "No matching font being used"))
1054 (with-output-to-temp-buffer "*Help*" 1064 (with-output-to-temp-buffer "*Help*"
1055 (describe-font-internal font-info 'verbose))))) 1065 (describe-font-internal font-info 'verbose)))))
1056 1066