redguardtoo / emacs.d

Fast and robust Emacs setup.
http://blog.binchen.org
GNU General Public License v3.0
2.41k stars 616 forks source link

How auto-reload the .custom.el when Emacs startup? #986

Closed tywhisky closed 2 years ago

tywhisky commented 2 years ago

I was only add a file .custom.el in ~/ and don't change any other config.

.custom.el

(require-package 'font-utils)
(require-package 'usc-utils)
(require-package 'list-utils)
(require-package 'unicode-fonts)

(setq my-enable-startup-color-theme-p t)
(load-theme 'zenburn t)
(add-to-list 'load-path "~/.emacs.d/unicode-fonts/")
(unicode-fonts-setup)
(set-face-attribute 'default (selected-frame) :height 130)

But when Emacs startup, these config have not load, both theme and font. When i open file with C + x C + e, these config can be loaded correctly.

P.S. My system is WIn11, the client is for Windows not the Cygwin, but I have set the system variables correctly. Thank u for any helps.

redguardtoo commented 2 years ago

https://github.com/redguardtoo/emacs.d/blob/3f81e82dca2c3602d4da5db003b4d10250b213ac/init.el#

If you use my setup, it's already there (not in server mode though). Or else, just copy that line.

tywhisky commented 2 years ago

@redguardtoo I actually used your configuration and followed the documentation exactly,but still... I've just tried Emacs for a few days, so maybe this is a silly question of little value, I'll look into it

redguardtoo commented 2 years ago

my-enable-startup-color-theme-p randomly picks up one of my favorite color themes. The color theme is loaded by some idle timers.

So (load-theme 'zenburn t) won't work. You need remove (setq my-enable-startup-color-theme-p t).

I don't know what's the purpose of (add-to-list 'load-path "~/.emacs.d/unicode-fonts/")? (require-package 'unicode-fonts) should install the package into ~/.emacs.d/elpa/, right?

Other code looks ok. I don't use unicode or Chinese, so not sure how to setup those packages.

tywhisky commented 2 years ago

@redguardtoo Thanks for your help, I was in a hurry and now I have solved the problem and can gradually start writing my own configuration.