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#59795: 30.0.50; locate-user-emacs-file refer to relative path with --init-directory is passed as relative path Date: Sat, 03 Dec 2022 14:12:50 +0200 Message-ID: <835yeseldp.fsf@gnu.org> References: <83bkokeqd4.fsf@gnu.org> <4ARS8y26LgnIVnPW_ysunddEPANdGQpVnlgpOiqx-uZiyGEf2YJYW05X-TgY8TSgkbmha7vFOr2MG4BJPfykTpAmLQveDluPGqKk1-NVWfw=@protonmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34985"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59795@debbugs.gnu.org To: Tommaso Rossi Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 03 13:14:17 2022 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 1p1RPM-0008v6-7O for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Dec 2022 13:14:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1RPA-0003Cz-F4; Sat, 03 Dec 2022 07:14:04 -0500 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 1p1RP8-0003Ci-Pb for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 07:14:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p1RP8-0003v6-G7 for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 07:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p1RP8-0000PZ-4B for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 07:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Dec 2022 12:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59795 X-GNU-PR-Package: emacs Original-Received: via spool by 59795-submit@debbugs.gnu.org id=B59795.16700696021565 (code B ref 59795); Sat, 03 Dec 2022 12:14:02 +0000 Original-Received: (at 59795) by debbugs.gnu.org; 3 Dec 2022 12:13:22 +0000 Original-Received: from localhost ([127.0.0.1]:51633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1ROU-0000PB-9d for submit@debbugs.gnu.org; Sat, 03 Dec 2022 07:13:22 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38356) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1ROQ-0000P4-SK for 59795@debbugs.gnu.org; Sat, 03 Dec 2022 07:13:20 -0500 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 1p1ROL-0003rC-BZ; Sat, 03 Dec 2022 07:13:13 -0500 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=RYDYqjpErRithnj0RIC+TOA0DAZON7ung+IdcHNXWtw=; b=DsDdRlmsFaHa 23N7FoPyKdlkcyMrqBJv/y6nDDFbrSICRJcOee8+xxhUN/8L6JmnqtbTxbyjRFBCxKUUk7gWR4cJE ZBi3mhpm7JFuVOR3rD6jQjMO75Eu2NKukaXLgGFXutfHoOsp1QtGBeFAsWhFLjI67zOI6XHsUkQ4K Mfu8ewqncVnCGoqU45ESJYhreXi7EpiGx5JIayFWQ/B8nZdyncB5KW4s2MCaLZJUmDXibKdm2ahpH QA5uPJ7vq1vlgG+LsC5vv1oacvyyGuhKFo73q4fAvnCrS0FKnJR/j/SNdKQbtVm6C20Q5X3ZBtbH7 mimpirIx2PqzjTcYahkw8Q==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p1ROK-0006VS-Kr; Sat, 03 Dec 2022 07:13:12 -0500 In-Reply-To: <4ARS8y26LgnIVnPW_ysunddEPANdGQpVnlgpOiqx-uZiyGEf2YJYW05X-TgY8TSgkbmha7vFOr2MG4BJPfykTpAmLQveDluPGqKk1-NVWfw=@protonmail.com> (message from Tommaso Rossi on Sat, 03 Dec 2022 11:31:59 +0000) 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:249833 Archived-At: > Date: Sat, 03 Dec 2022 11:31:59 +0000 > From: Tommaso Rossi > Cc: 59795-done@debbugs.gnu.org > > Thanks for your reply. > I think I didn't explained the problem very well, sorry for my english. You have nothing to apologize about, I understood you completely. > It is right that the init directory is interpreted relative to the > directory where Emacs is started, what feels a bit strange is that > when you change directory inside Emacs, the init directory becomes > relative to the current directory for the function > locate-user-emacs-file. I realized that when I found folders > named as my init directory spawned everywhere in my filesystem, for > example containing Transient (Magit) history or other files that should > be in the real init directory. > > In Emacs Lisp code, it becomes difficult to locate the real init > directory, because the user-emacs-directory is not absolute: if some > library or package uses the locate-user-emacs-file function, like > Transient, than this "init directory spawned everywhere" problem will > raise. The latest code should produce an absolute file name in user-emacs-directory, which I believe fixes the problem you described. My response just explained how will Emacs produce an absolute file name from a relative one when it processes the --init-directory= option. The fix is in the emacs-29 branch, soon to be merged to master, so you can try the fix if you want.