meowking's Blog

meowking's Avatar Image
A Linux and Emacs enthusiast who loves anime and cats.

My Chinese gossip account: https://wxw.moe/@meow_king (talking nonsense
BG Image: https://wallhaven.cc/w/p93dx3
← All posts

When debugging my #emacs configuration, I find it is more useful to put (setq debug-on-error t) at the beginning of your init.el rather than using command line argument to start Emacs like emacs --debug-init. The reason behind this is that --debug-init seemingly only affect Emacs between starting Emacs and Emacs finishing loading your configuration, whereas your configuration may also affect Emacs’s behavior directly after loading. For example, you add a function to prog-mode-hook, and inside the function, u use variable buffer-file-name. Then Emacs may not behave well cuz scratch buffer is lisp-interaction-mode which is a derived mode of prog-mode and it is directly loaded after Emacs initialization.

To like or reply, open original post on Emacs.ch