changeset 31288:84df0ccd61c0

(set-frame-font): Do completion of font-name for interactive use.
author Miles Bader <miles@gnu.org>
date Wed, 30 Aug 2000 12:09:58 +0000
parents c37c79e6a6e7
children 29ff60f3411c
files lisp/frame.el
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/frame.el	Wed Aug 30 11:52:37 2000 +0000
+++ b/lisp/frame.el	Wed Aug 30 12:09:58 2000 +0000
@@ -701,7 +701,14 @@
   "Set the font of the selected frame to FONT-NAME.
 When called interactively, prompt for the name of the font to use.
 To get the frame's current default font, use `frame-parameters'."
-  (interactive "sFont name: ")
+  (interactive 
+   (list
+    (let ((completion-ignore-case t))
+      (completing-read "Font name: "
+		       (mapcar #'list
+			       ;; x-list-fonts will fail with an error
+			       ;; if this frame doesn't support fonts.
+			       (x-list-fonts "*" nil (selected-frame)))))))
   (modify-frame-parameters (selected-frame)
 			   (list (cons 'font font-name)))
   ;; Update faces that want a bold or italic version of the default font.