Commit faaf40e4 authored by Miles Bader's avatar Miles Bader
Browse files

(set-frame-font): Do completion of font-name for interactive use.

parent 90c7e9f0
......@@ -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: ")
(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.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment