From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72294: 29.2; Emacs --init-directory=... puts user-init-file elsewhere Date: Thu, 25 Jul 2024 21:56:15 +0300 Message-ID: <868qxp47xs.fsf@gnu.org> References: <5F9F4A78-8D6D-43B9-9304-641D54AF472E@toadstyle.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29943"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72294@debbugs.gnu.org To: Sean Devlin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 25 20:57:09 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sX3eG-0007XQ-Ii for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Jul 2024 20:57:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sX3e6-0002OD-LE; Thu, 25 Jul 2024 14:56:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sX3e3-0002Nq-7C for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2024 14:56:56 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sX3e2-0003FV-TQ for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2024 14:56:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sX3eA-0004Md-DW for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2024 14:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Jul 2024 18:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72294 X-GNU-PR-Package: emacs Original-Received: via spool by 72294-submit@debbugs.gnu.org id=B72294.172193379816731 (code B ref 72294); Thu, 25 Jul 2024 18:57:02 +0000 Original-Received: (at 72294) by debbugs.gnu.org; 25 Jul 2024 18:56:38 +0000 Original-Received: from localhost ([127.0.0.1]:37770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sX3dm-0004Ln-FL for submit@debbugs.gnu.org; Thu, 25 Jul 2024 14:56:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sX3dj-0004LV-PC for 72294@debbugs.gnu.org; Thu, 25 Jul 2024 14:56:36 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sX3dU-0003CR-OV; Thu, 25 Jul 2024 14:56:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=/l3ndjMEclmQSnnK3r28aUo6YLxrbZqjHXUq3F2zRo0=; b=X3IGSK2VWmuU lB57pOj0JX2KzZa7CD5bCb/qpqOlYKYV8t0TYTwcVD9N2Be7yiRQZIEWKIg56pDh0qeQOa9YyDrBm k1DSkY0KFG4XMZ7RDuKBAvHZt7KER73Jjxk5ROJ21MFCQsmyphYkgQGx8fIjRZ/vpsu8sDn7D0mPS w0IheWskzNm8KdpJsn3ccQGwrXWYGvjM4BfkaGBxxxjhHEr99x8MUKccrH6hpVScrqeUMJsHIpRIW sWMZmJUw3+Zdl+vquTjelmkF6higgrYRo8OkTddAA0i+bUDM1DHi3QCjMQz0Iyac6rQ79Qc0+CICJ sx1VlhSAW94cgzmgZn5r8Q==; In-Reply-To: <5F9F4A78-8D6D-43B9-9304-641D54AF472E@toadstyle.org> (message from Sean Devlin on Thu, 25 Jul 2024 12:12:07 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289333 Archived-At: > From: Sean Devlin > 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.