]> code.delx.au - gnu-emacs/commitdiff
(set-frame-font): Do completion of font-name for interactive use.
authorMiles Bader <miles@gnu.org>
Wed, 30 Aug 2000 12:09:58 +0000 (12:09 +0000)
committerMiles Bader <miles@gnu.org>
Wed, 30 Aug 2000 12:09:58 +0000 (12:09 +0000)
lisp/frame.el

index a33d8c41aafc501305f51d4aa454119e57883510..490c8c1bf3e5b8dc4879e669d101d3cc3ec967b2 100644 (file)
@@ -701,7 +701,14 @@ If FRAME is omitted, describe the currently selected frame."
   "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.