GNU bug report logs - #72294
29.2; Emacs --init-directory=... puts user-init-file elsewhere

Previous Next

Package: emacs;

Reported by: Sean Devlin <spd <at> toadstyle.org>

Date: Thu, 25 Jul 2024 16:13:01 UTC

Severity: normal

Found in version 29.2

Done: Daan Ro <daanturo <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 72294 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sean Devlin <spd <at> toadstyle.org>
Cc: 72294 <at> debbugs.gnu.org
Subject: Re: bug#72294: 29.2;
 Emacs --init-directory=... puts user-init-file elsewhere
Date: Thu, 25 Jul 2024 21:56:15 +0300
> From: Sean Devlin <spd <at> toadstyle.org>
> Date: Thu, 25 Jul 2024 12:12:07 -0400
> 
> 1. emacs --init-directory=/tmp/emacs
> 2. M-: user-init-file RET
> 
> The user-init-file is ~/.emacs, despite the flag to use /tmp/emacs as
> the init directory.
> 
> Maybe this is intended behavior, but I found it confusing. The manual
> says this about the flag:
> 
> "Specify the directory to use when looking for the Emacs init files."
> 
> I interpreted this to mean all init files, including the user-init-file.

That option sets user-emacs-directory, it doesn't directly affect
user-init-file.

Emacs by default sets user-emacs-directory to the directory where it
actually finds the init file.  This option overrides that.

> A workaround is to create /tmp/emacs/init.el before starting Emacs:
> 
> 1. mkdir -p /tmp/emacs
> 2. touch /tmp/emacs/init.el
> 3. emacs --init-directory=/tmp/emacs

It isn't a workaround, it's how you should do it.

I don't think this is a bug.  The search for init file and the setting
of user-emacs-directory that follows are complex issues, not easily
explained in a few words.

May I ask why you needed to use this option?  It should not be
generally needed.




This bug report was last modified 301 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.