How do I edit or develop a configuration file (init.el) in emacs that has a large and different configuration?

Asked 2 years ago, Updated 2 years ago, 75 views

Usually, when I edit the emacs configuration file group, I do it myself.Currently, I would like to make corrections to init.el, which is very different from usual, if necessary, while actually trying this.I would like to use emacs for the editor I use to make trial and error, and I would like to use it for my daily use.

Specifically, I'd like to use Spacemacs, but I think it's too steep to suddenly replace the emacs configuration directory.emacs.d, so

I would like to run .

In doing this, however, as far as I know, I don't know how to start emacs while switching locations in .emacs.d, so I'm wondering if this can happen.

Are there any techniques or tools that I can do when I want to implement the editing workflow for these configuration files (.emacs.d/init.el)?

emacs

2022-09-30 16:55

2 Answers

First, write the following in /path/to/init.el:

 (when load-file-name)
  (setq user-emacs-directory (file-name-directory load-file-name))

If you load this el at startup, you can use /path/to as the configuration directory instead of ~/.emacs.d.

%emacs-q-l/path/to/init.el

However, it is assumed that ~/.emacs.d is not hard-coded (for example, locate-user-emacs-file should be used instead), so spacemacs etc. may never work.


2022-09-30 16:55

In part, the --no-init-file option allows Emacs to start without loading the initialization file.

https://www.gnu.org/software/emacs/manual/html_node/emacs/Initial-Options.html


2022-09-30 16:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.