help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Font setting for runemacs and frame


From: Shuguang Sun
Subject: Re: Font setting for runemacs and frame
Date: Fri, 15 Feb 2019 18:01:24 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Shuguang Sun <shuguang79@qq.com>
>> 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 <emacs-PID>" 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 <http://gnu.org/licenses/gpl.html>
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:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Traceback (most recent call last):
  File "<string>", line 3, in <module>
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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]