X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lisp%2Fx-font-menu.el;h=9a1db5ca0fc3d0a75a8a1b65a2699e43bcdd6b0d;hb=b267e52aa03bee2c488c8a78824d96cf2d9a6ccc;hp=40d4c11a84368cdd948b3f2d113f4c444cf755d9;hpb=6883ee56ec887c2c48abe5b06b5e66aa74031910;p=chise%2Fxemacs-chise.git diff --git a/lisp/x-font-menu.el b/lisp/x-font-menu.el index 40d4c11..9a1db5c 100644 --- a/lisp/x-font-menu.el +++ b/lisp/x-font-menu.el @@ -466,9 +466,12 @@ or if you change your font path, you can call this to re-initialize the menus." (from-size (aref font-data 2)) (from-weight (aref font-data 3)) (from-slant (aref font-data 4)) - new-default-face-font) + new-default-face-font + new-props) (unless from-family (signal 'error '("couldn't parse font name for default face"))) + (when weight + (signal 'error '("Setting weight currently not supported"))) (setq new-default-face-font (font-menu-load-font (or family from-family) (or weight from-weight) @@ -488,10 +491,19 @@ or if you change your font path, you can call this to re-initialize the menus." ;; Set the default face's font after hacking the other faces, so that ;; the frame size doesn't change until we are all done. + ;; If we need to be frame local we do the changes ourselves. + (if font-menu-this-frame-only-p ;;; WMP - we need to honor font-menu-this-frame-only-p here! - (set-face-font 'default new-default-face-font - (and font-menu-this-frame-only-p (selected-frame))) - (message "Font %s" (face-font-name 'default)))) + (set-face-font 'default new-default-face-font + (and font-menu-this-frame-only-p (selected-frame))) + ;; OK Let Customize do it. + (when (and family (not (equal family from-family))) + (setq new-props (append (list :family family) new-props))) + (when (and size (not (equal size from-size))) + (setq new-props (append + (list :size (concat (int-to-string (/ size 10)) "pt")) new-props))) + (custom-set-face-update-spec 'default '((type x)) new-props) + (message "Font %s" (face-font-name 'default))))) (defun font-menu-change-face (face