From: "François Févotte" <francois.fevotte@ensta.org>
To: 15539@debbugs.gnu.org
Subject: bug#15539: Fwd: bug#15539: [PATCH] Setting user-emacs-directory
Date: Thu, 24 Mar 2016 20:21:31 +0100 [thread overview]
Message-ID: <CAADsv96Q0iOnej+veZ4dD9MgCEZ-V9NHhmdqU6fevaDyBzamrA@mail.gmail.com> (raw)
In-Reply-To: <CAADsv97dLVFXvGXFRv-L+nZN9rsAoLRsWOdbcabz7quK3EozMA@mail.gmail.com>
Dear Emacs developers,
sorry for the late reaction: I thought I was subscribed to this bug, but I
somehow wasn't and only just saw last month's discussions.
I fully understand that putting yet another knob in Emacs implies an added
complexity which is not necessarily desirable. However, I would like to
emphasize that the proposed patch does not "change a well-established
constant". People not wanting to know about this new behavior will never see
any change. And I would expect that any user explicitly setting an
`EMACS_USER_DIRECTORY' environment variable know what they are doing.
Also, below is a list of methods (that I know of) which can help users start
Emacs with an initialization file in a custom location. None of them are
flawless, which justifies IMHO the introduction of a feature like the one
proposed here. But even if you still find that there is no real need for such a
feature (which would be perfectly fine by me), at least this list might help
future users stumbling on this bug report...
* Method 1 (as mentioned by Eli Zaretskii above): set the HOME environment
variable.
This works well, and can even be set on a per-process basis, which is a
desirable feature IMO. This method however has potentially unwelcome side
effects, mainly related to the fact that $HOME is used in a lot of different
contexts, unrelated to the Emacs startup process. In particular:
- All processes launched from within Emacs will inherit this setting. This can
easily be avoided be re-setting HOME to its normal value in
`process-environment' within Emacs.
- All paths beginning with `~/' will be expanded to the "fake" HOME directory,
which can be confusing. One can reset the HOME environment variable from
within Emacs using `setenv' to avoid that. But then problems can arise since
`user-emacs-directory' itself is by default "~/.emacs.d".
* Method 2: set a symbolic link from ~/.emacs.d to somewhere else.
This method is mainly useful to help quickly switch between different profiles
by having the symlink point to one of several possible directories.
It's very easy
to set up (which is why many users seem to do it), but has the main drawback
that multiple Emacs instances running concurrently must all share the same
user directory.
* Method 3: run `emacs -q -l SOMEWHERE/init.el'
The initialization file located SOMEWHERE/init.el can then set things up
correctly like this:
(setq user-init-file (or load-file-name (buffer-file-name)))
(setq user-emacs-directory (file-name-directory user-init-file))
Like the first method above, this one works on a per-process basis and one can
run different instances of Emacs using different user directories.
The main drawback of this approach is that it entirely bypasses the normal
startup process. Things like `emacs-init-time', `after-init-hook',
`initial-major-mode' (list is not exhaustive) don't work as expected.
Again, I you feel like the added complexity is not worth the extra flexibility
for users, that's fine by me. Just ignore my message and leave the bug closed.
Cheers,
François
next parent reply other threads:[~2016-03-24 19:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAADsv97dLVFXvGXFRv-L+nZN9rsAoLRsWOdbcabz7quK3EozMA@mail.gmail.com>
2016-03-24 19:21 ` François Févotte [this message]
2016-03-27 0:37 ` bug#15539: Fwd: bug#15539: [PATCH] Setting user-emacs-directory John Wiegley
2016-03-27 9:46 ` François Févotte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAADsv96Q0iOnej+veZ4dD9MgCEZ-V9NHhmdqU6fevaDyBzamrA@mail.gmail.com \
--to=francois.fevotte@ensta.org \
--cc=15539@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.