- (let ((font (if (fboundp 'x-select-font)
- (x-select-font)
- (mouse-select-font)))
- spec)
- (when font
- ;; Be careful here: when set-face-attribute is called for the
- ;; :font attribute, Emacs tries to guess the best matching font
- ;; by examining the other face attributes (Bug#2476).
- (set-face-attribute 'default (selected-frame)
- :width 'normal
- :weight 'normal
- :slant 'normal
- :font font)
- (let ((font-object (face-attribute 'default :font)))
- (dolist (f (frame-list))
- (and (not (eq f (selected-frame)))
- (display-graphic-p f)
- (set-face-attribute 'default f :font font-object)))
- (set-face-attribute 'default t :font font-object))
- (setq spec (list (list t (face-attr-construct 'default))))
- (put 'default 'customized-face spec)
- (custom-push-theme 'theme-face 'default 'user 'set spec)
- (put 'default 'face-modified nil))))