1
votes

I'm running my own emacs config that resides in non-default place. So I use -Q -l startup options. I've defined place for saving customization and set custom-file variable accordingly.

Unfortunately emacs refuses to save my custom options motivating it with possible harm to original options. But I know what I do, and I what to have separate custom file filled with current session variables?

How can I overcome emacs restrictions?

emacs manual says:

If Emacs was invoked with the -q or --no-init-file options (see Initial Options), it will not let you save your customizations in your initialization file. This is because saving customizations from such a session would wipe out all the other customizations you might have on your initialization file.

1

1 Answers

-1
votes

Don't use -Q. That implies -q, and I trust that if your config resides elsewhere, you do not also have any of the default init filenames for Emacs to find and use.

Instead, use the combination of options that you actually need. Refer to:

C-hig (emacs) Initial Options RET

`-Q'
`--quick'
     Start emacs with minimum customizations.  This is similar to using
     `-q', `--no-site-file', `--no-site-lisp', and `--no-splash'
     together.  This also stops Emacs from processing X resources by
     setting `inhibit-x-resources' to `t' (*note Resources::).

Edit:

I'm really not sure I understand why you need to retain your default init files when you claim that you don't want to use them. It would help if you clarified why --no-init-file is critical? Are you trying to provide a secondary configuration of Emacs which does not conflict with how people usually run it?

You might work around it by setting the HOME environment variable in your start-up script.
See C-hig (emacs) Find Init RET

Also see the init-file-user variable and, for the gory details, the command-line function.

(Perhaps setting the likes of init-file-user, user-init-file, & custom-file with --eval might work.)