From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Shuguang Sun Newsgroups: gmane.emacs.help Subject: Font setting for runemacs and frame Date: Tue, 12 Feb 2019 18:03:44 +0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="84501"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) Cc: help-gnu-emacs@gnu.org To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 12 12:15:34 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtW2H-000Ltd-9w for geh-help-gnu-emacs@m.gmane.org; Tue, 12 Feb 2019 12:15:33 +0100 Original-Received: from localhost ([127.0.0.1]:37524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtW2G-0007Dl-5C for geh-help-gnu-emacs@m.gmane.org; Tue, 12 Feb 2019 06:15:32 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtW1q-0007Bp-V4 for help-gnu-emacs@gnu.org; Tue, 12 Feb 2019 06:15:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtW1p-0001b5-5Z for help-gnu-emacs@gnu.org; Tue, 12 Feb 2019 06:15:06 -0500 Original-Received: from [195.159.176.226] (port=60218 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gtW1o-0001XO-Tv for help-gnu-emacs@gnu.org; Tue, 12 Feb 2019 06:15:05 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1gtW1m-000LO1-IC for help-gnu-emacs@gnu.org; Tue, 12 Feb 2019 12:15:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:PsTR3eW/ocdQJyduwGYXzfaKH4Y= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:119375 Archived-At: Hi, I have some font setting in my dot emacs, however, it doesn't work unless after some frame action. My font setting ``` (cl-pushnew '(w32 (font . "Consolas-16") (fullscreen . maximized)) window-system-default-frame-alist) (defun frame-setting (&optional frame) (when (display-graphic-p) (message "display-graphic-p")) (message "frame-setting call") (let ((frame (or frame (selected-frame)))) (message "frame: %s" frame) (if (string-equal system-type "windows-nt") (dolist (charset '(kana han cjk-misc bopomofo chinese-gbk gb18030)) (set-fontset-font nil charset (font-spec :family "Microsoft Yahei") frame 'prepend))))) ;; set the font after make frame (add-hook 'after-make-frame-functions #'frame-setting) ``` And some hooks in after-init-hook ``` (if (not (daemonp)) (progn (message "frame-setting in non-daemon") (frame-setting))) ``` The function-setting actually is called. In case of ``` emacsclientw.exe --alternate-editor= -n -e "(raise-frame )" ``` it messages: frame-setting call However the font setting make no effect in case of simply run runemacs.exe, it messages: frame-setting in non-daemon display-graphic-p frame-setting call frame: # Is it due to the window-system-default-frame-alist which might flush all the font setting? -- Best Regards Shuguang Sun