I'm refactoring a bit in my Emacs set up and have come to the conclusion that I want to use a different init file than the default one. So basically, in my ~/.emacs file, I have this:
(load "/some/directory/init.el")
Up until now, that's been working just fine. However, now I want to redefine an old command that I've used for ages, which opens my init file:
(defun conf ()
"Open a buffer with the user init file."
(interactive)
(find-file user-init-file))
As you can see, this will open ~/.emacs no matter what I do. I want it to open /some/directory/init.el, or wherever the conf
command itself is defined.
How would I do that?
You can use find-function
for this:
(defun conf ()
"Open a buffer with the user init file."
(interactive)
(find-function this-command))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With