From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tommaso Rossi via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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 11:31:59 +0000 Message-ID: <4ARS8y26LgnIVnPW_ysunddEPANdGQpVnlgpOiqx-uZiyGEf2YJYW05X-TgY8TSgkbmha7vFOr2MG4BJPfykTpAmLQveDluPGqKk1-NVWfw=@protonmail.com> References: <83bkokeqd4.fsf@gnu.org> Reply-To: Tommaso Rossi Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30843"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59795-done@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 03 21:33:59 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 1p1ZCx-0007p2-8f for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Dec 2022 21:33:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1ZC8-00009i-0s; Sat, 03 Dec 2022 15:33:08 -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 1p1ZC4-00006t-KU for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 15:33:06 -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 1p1ZC4-0002PO-Ci for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 15:33:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p1ZC4-0000x5-8o for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 15:33:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tommaso Rossi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Dec 2022 20:33:04 +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-done@debbugs.gnu.org id=D59795.16700995773619 (code D ref 59795); Sat, 03 Dec 2022 20:33:04 +0000 Original-Received: (at 59795-done) by debbugs.gnu.org; 3 Dec 2022 20:32:57 +0000 Original-Received: from localhost ([127.0.0.1]:53194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1ZBw-0000wD-U7 for submit@debbugs.gnu.org; Sat, 03 Dec 2022 15:32:57 -0500 Original-Received: from mail-4316.protonmail.ch ([185.70.43.16]:43023) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1Qka-0008RQ-Qo for 59795-done@debbugs.gnu.org; Sat, 03 Dec 2022 06:32:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1670067123; x=1670326323; bh=M+heNI8/GmsazHu9PKyyffMPAnE0L3VTomCpLl2Smy8=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Xpz90ILNeC1/6+hhSDiZFJtlUXeAfGePZVoGvQqyQQE7rKm6QkWLBDo8VNrYnBPUp TWIGyrOU5IfLuacDqR0PGFaJwwnNrg7A0nK95Id2TF6BVBACS+sBUe07cMT6TSQUTb WzqQyxGrUpLLiF7xcWUIySGUbMWL22NXEUzevoz3RcZuKUBXsyXqo3u8awDmYgG6FN IKKYjuwod2GfCUK6P0GoAobZ/gWmtk4hXfh+yT6SYjsFccgSdyfttGg3er6EG0MWIS eAr/Ej5A0gk/xdjHrIeU9Y05WbiYYfZEEjLDm4epLfIIpcxrItXW/e1YFZZwxJOBXs ZutWxDoL3P3xg== In-Reply-To: <83bkokeqd4.fsf@gnu.org> Feedback-ID: 23860176:user:proton X-Mailman-Approved-At: Sat, 03 Dec 2022 15:32:51 -0500 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:249879 Archived-At: Thanks for your reply. I think I didn't explained the problem very well, sorry for my english. It is right that the init directory is interpreted relative to the=20 directory where Emacs is started, what feels a bit strange is that when you change directory inside Emacs, the init directory becomes=20 relative to the current directory for the function=20 locate-user-emacs-file. I realized that when I found folders=20 named as my init directory spawned everywhere in my filesystem, for example containing Transient (Magit) history or other files that should=20 be in the real init directory. In Emacs Lisp code, it becomes difficult to locate the real init=20 directory, because the user-emacs-directory is not absolute: if some=20 library or package uses the locate-user-emacs-file function, like=20 Transient, than this "init directory spawned everywhere" problem will=20 raise. Thanks, Tommaso ------- Original Message ------- On Saturday, December 3rd, 2022 at 11:25, Eli Zaretskii wrot= e: > > Date: Fri, 02 Dec 2022 12:47:43 +0000 > > From: Tommaso Rossi via "Bug reports for GNU Emacs, > > the Swiss army knife of text editors" bug-gnu-emacs@gnu.org > >=20 > > When launching emacs with --init-directory option set to a relative pat= h, I noticed that locate-user-emacs-file > > refers to a relative path. > > This means that every library that uses that function spawns files in v= isited directories instead that in the > > init-directory. > >=20 > > 1) Open shell in home (~) > > 2) emacs -Q --init-directory .my-emacs.d > > 3) C-x C-f ~/other-directory RET > > 4) M-: (locate-user-emacs-file "some-file") RET > >=20 > > result: ~/other-directory/.my-emacs.d/some-file > > expected: ~/.my-emacs.d/some-file > >=20 > > It happens both starting with -Q or not. > > The problem does not happen when an absolute path is passed as --init-d= irectory option argument. > >=20 > > Perhaps the user-emacs-directory should be parsed as absolute path at s= tartup? >=20 >=20 > I made --init-directory=3DDIR be interpreted relative to the directory wh= ere > Emacs is started. >=20 > Thanks.