`require-init` in `~/.custom.el` not working
fenguoerbian opened this issue · 5 comments
I use auctex for writing latex in emacs. Currently I'm using (require-init 'init-auctex)
to load my auctex settings (init-auctex.el
is located at ~/.emacs.d/lisp/
.
This works fine until recently I ran a git pull --rabase
to update the config. Now the setings of auctex does not work. I try to rebase onto different commits and find that it's d282b41, the change from
(load (expand-file-name "~/.custom.el") t nil)))
to
(my-run-with-idle-timer 1 (lambda () (load "~/.custom.el" t nil)))))
that seems to make the require-init
not take effect. It baffles me bacause (load-theme 'one-dark t)
in my .custom.el
totally works, but that require-init
not.
I'm not an expert in emacs and I'm asking for your advise about how to make my customization work again. Thanks a lot.
Can't reproduce issue,
Here is my ~/.emacs.d/lisp/init-hello.el
,
(message "hello world")
(provide 'init-hello)
Thanks for the reply. According to your suggestion I find that require-init
did work. It's some add-hook
in my configuration that does not work.
My ~/.emacs.d/lisp/init-auctex.el
(message "before add-hook turn-on-reftex")
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(provide 'init-auctex)
and my ~/.custom.el
(require-init 'init-auctex)
After opening a .tex
file, the message
buffer shows the before add-hook turn-on-reftex
, but M-x describe-mode RET
does not show Reftex
minor mode.
Maybe for some reason, reftex-mode
is not loaded yet, you can always use require
to manually load it anyway.
Will do. Thanks a lot.
Maybe for some reason,
reftex-mode
is not loaded yet, you can always userequire
to manually load it anyway.
Because after the change from
(load (expand-file-name "~/.custom.el") t nil)))
to
(my-run-with-idle-timer 1 (lambda () (load "~/.custom.el" t nil)))))
The code in the add-hook
in custom.el will be executed after the loading of the LaTex mode.
My Reproduction steps:
- Add
(add-hook 'css-mode-hook (lambda () (message "css-hook is running")))
to custom.el - Run
emacs -nw xxx.css
, the hook will not be executed.