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: Re: Font setting for runemacs and frame Date: Fri, 15 Feb 2019 18:01:24 +0800 Message-ID: <27157.3423453205$1550224965@news.gmane.org> References: <83lg2louan.fsf@gnu.org> <838sykpd8a.fsf@gnu.org> <83lg2io1hi.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="225021"; 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: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 15 11:02:40 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 1guaKO-000wMT-6y for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Feb 2019 11:02:40 +0100 Original-Received: from localhost ([127.0.0.1]:35735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaKM-0006nL-TI for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Feb 2019 05:02:39 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaJo-0006ml-4D for help-gnu-emacs@gnu.org; Fri, 15 Feb 2019 05:02:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaJg-0000HQ-KC for help-gnu-emacs@gnu.org; Fri, 15 Feb 2019 05:02:00 -0500 Original-Received: from smtpbgau2.qq.com ([54.206.34.216]:33158) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaJP-0008Rk-JL for help-gnu-emacs@gnu.org; Fri, 15 Feb 2019 05:01:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1550224887; bh=uYOMblOR0eCUl3ZvC8RYB0bexndFBcBmHHBUURoySjE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID:MIME-Version:Content-Type; b=kgmzjcbdY+sApfqFuUTwu0BEkD2iEEECWDTOht+HPBz6eMj/nu4fbNDFEyFpyWKcd 7JsGVIFNOzHWLzIvQTREq88QFtH6c6+H7fyIAK/fypdNnNAYvFcNpPya2XoNiJwZgD apuQjzQJTgDxbaVgfcJWaIaTvBROo+2bldKgkn1s= X-QQ-mid: esmtp4t1550224886tx631w8jd Original-Received: from rshmx11052 (unknown [211.144.221.1]) by esmtp4.qq.com (ESMTP) with id ; Fri, 15 Feb 2019 18:01:25 +0800 (CST) X-QQ-SSF: 01000000000000F0F4200F00000000G X-QQ-FEAT: R/yWRekfFcouMxMIenE7H4PKH3QZ0HvcfSsEF/PhoKAfp+lF8oFWFCYAxVZSj wuNZxh3AX+oDGdEEJtSHlNdOPyVqsQc6Jms8jEX+LNKu9E/EoTOVkIQFcxxlLmiK3i1CWdX ARvNS/Uay54kBNn4LMCd6nDlXHzemIQBzI2f3P9MwkiE5c2Sdv+9rWaxTh6mq5HcOyd7/LA +JQhR5UU/71NBscvC4GMcy6M4x4kCzFQrJ10RnjPMFDje5wsTw8XP1EnKapD1pXoXtMVlqU BaxCOufa8kaCk7hh3nh5ZdU2Hkh20Rp5OFuuUZoMxIsQBy X-QQ-GoodBg: 0 In-Reply-To: <83lg2io1hi.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 14 Feb 2019 17:04:25 +0200") X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:qq.com:bgforeign:bgforeign2 X-QQ-Bgrelay: 1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 54.206.34.216 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:119416 Archived-At: Eli Zaretskii writes: >> From: Shuguang Sun >> Cc: help-gnu-emacs@gnu.org >> Date: Wed, 13 Feb 2019 13:08:06 +0800 >> >> (cl-pushnew '(w32 (font . "Consolas-16")) >> window-system-default-frame-alist) >> >> or >> >> (add-to-list 'default-frame-alist '(font . "Consolas-16")) >> >> To set the default font as Consolas-16 in w32 system. > > This will only work for frames other than the first frame. > >> To specify font for fontset, cjk etc., I use the code below and actually >> make it a function and call it in after-make-frame-functions (new frame >> in daemon mode) or call it after-init-hook (intended for runemacs with >> `if (not (daemonp))`). >> >> (dolist (charset '(kana han cjk-misc bopomofo chinese-gbk gb18030)) >> (set-fontset-font nil charset >> (font-spec :family "Microsoft Yahei") >> nil 'prepend)) > > Why do you need to call this in a hook? Why not just at top level of > your .emacs file? > Sorry for wrong information in last message. Actually the font setting code above doesn't work in daemon. runemacs --daemon OR ./emacsclientw.exe --alternate-editor= -n -e "(raise-frame )" & Then a popup window with: ``` A fatal error has occurred! .... (type "gdb -p " and "continue" inside GDB before clicking YES.) ``` The GDB information: ``` # gdb -p 157284 GNU gdb (GDB) 7.12.1 Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-msys". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word". Traceback (most recent call last): File "", line 3, in ImportError: No module named libstdcxx.v6.printers /etc/gdbinit:6: Error in sourced command file: Error while executing Python code. Attaching to process 157284 [New Thread 157284.0x26ed8] [New Thread 157284.0x3374] [New Thread 157284.0x702c] Reading symbols from /c/Users/suns18/emacs/bin/emacsclientw...done. (gdb) continue Continuing. [Thread 157284.0x702c exited with code 0] Thread 1 received signal SIGINT, Interrupt. [Switching to Thread 157284.0x26ed8] 0x000000010041440f in ?? () (gdb) Continuing. [Inferior 1 (process 157284) exited with code 02] (gdb) (gdb) q [1]+ Interrupt ./emacsclientw.exe --alternate-editor= -n -e "(raise-frame )" ``` Backtrace: 000000040018a4e4 00000004000a86f1 00000004000c0316 00000004000c0f94 00000004001def84 00007ffb7240639e 00007ffb72419ff5 00007ffb723a51c0 00007ffb72419076 00000004001bfd4f 00000004001bfdce 0000000400122af3 00000004001213ba 0000000400157318 0000000400123cec 0000000400121338 0000000400157318 0000000400159bb6 000000040012379d 00000004001478af 00000004001480df 0000000400122af3 00000004001213ba 0000000400157318 0000000400123cec 0000000400121338 0000000400157318 0000000400123cec 0000000400121338 0000000400157318 0000000400123cec 00000004001231ba 00000004001234eb 0000000400125253 0000000400120585 00000004000a9945 00000004001204f3 00000004000a8c82 00000004000adf58 00000004000ae29d 00000004001ef085 000000040000139d 0000000400001503 00007ffb7008277c 00007ffb723c0c49 >> However with the setting of window-system-default-frame-alist or >> default-frame-alist above, it takes no effect until I make a new frame >> (after-make-frame-functions). > > This is documented behavior: to modify the looks ofg the first frame, > you need to set initial-frame-alist in addition to > default-frame-alist. > > -- Best Regards Shuguang Sun