summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorDavid Reitter <david.reitter@gmail.com>2020-09-22 13:38:16 +0100
committerAlan Third <alan@idiocy.org>2020-09-22 13:38:16 +0100
commitc5c29a9f0f60321304125a1f3b991ce724d868cc (patch)
tree777a7a8f41b3ae4b47c30b70e35c5c8f330f5dd6 /lisp
parent11a1c8b62fc3e82a6c7085ea70720b1f685662f9 (diff)
downloademacs-c5c29a9f0f60321304125a1f3b991ce724d868cc.tar.gz
emacs-c5c29a9f0f60321304125a1f3b991ce724d868cc.tar.bz2
emacs-c5c29a9f0f60321304125a1f3b991ce724d868cc.zip
Fix font-panel on NS (bug#43480)
* lisp/term/ns-win.el (ns-respond-to-change-font): Set the font using customize.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/term/ns-win.el22
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 6acf6cd1992..dd0a986572d 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -632,15 +632,21 @@ This function has been overloaded in Nextstep.")
(defvar ns-input-fontsize)
(defun ns-respond-to-change-font ()
- "Respond to changeFont: event, expecting `ns-input-font' and\n\
-`ns-input-fontsize' of new font."
+ "Set the font chosen in the font-picker panel.
+Respond to changeFont: event, expecting ns-input-font and
+ns-input-fontsize of new font."
(interactive)
- (modify-frame-parameters (selected-frame)
- (list (cons 'fontsize ns-input-fontsize)))
- (modify-frame-parameters (selected-frame)
- (list (cons 'font ns-input-font)))
- (set-frame-font ns-input-font))
-
+ (let ((face 'default))
+ (set-face-attribute face t
+ :family ns-input-font
+ :height (* 10 ns-input-fontsize))
+ (set-face-attribute face (selected-frame)
+ :family ns-input-font
+ :height (* 10 ns-input-fontsize))
+ (let ((spec (list (list t (face-attr-construct 'default)))))
+ (put face 'customized-face spec)
+ (custom-push-theme 'theme-face face 'user 'set spec)
+ (put face 'face-modified nil))))
;; Default fontset for macOS. This is mainly here to show how a fontset
;; can be set up manually. Ordinarily, fontsets are auto-created whenever