syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.58k stars 4.9k forks source link

Prevent M-x {enable,disable}-command from modifying ~/.emacs.d/init.el #16263

Closed bcc32 closed 5 months ago

bcc32 commented 5 months ago

This PR advises the built-in function en/disable-command (defined in novice.el) to add code to dotspacemacs/user-config instead of ~/.emacs.d/init.el. For Spacemacs users, modifications in ~/.emacs.d/init.el are potentially inconvenient (may block git checkout) and likely not visible (since they expect their entire config to be contained in ~/.spacemacs).

If you would like, I would also be okay with simplifying this advice to just append to .spacemacs (outside of dotspacemacs/user-config) instead of ~/.emacs.d/init.el, which should still work acceptably.