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#66534: 30.0.50; [PATCH] Expand file-name of ~/.emacs before attempt to load it Date: Sat, 14 Oct 2023 09:54:00 +0300 Message-ID: <83r0lxsnhz.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29510"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66534@debbugs.gnu.org To: Christoph Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 14 08:54:58 2023 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 1qrYY6-0007Tn-3m for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Oct 2023 08:54:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrYXu-0007Hx-7U; Sat, 14 Oct 2023 02:54:46 -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 1qrYXo-0007G5-15 for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 02:54:40 -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 1qrYXm-0004jr-Ts for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 02:54:39 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qrYYA-0003zJ-AN for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 02:55: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: Sat, 14 Oct 2023 06:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66534 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66534-submit@debbugs.gnu.org id=B66534.169726647315279 (code B ref 66534); Sat, 14 Oct 2023 06:55:02 +0000 Original-Received: (at 66534) by debbugs.gnu.org; 14 Oct 2023 06:54:33 +0000 Original-Received: from localhost ([127.0.0.1]:47711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrYXg-0003yN-Qr for submit@debbugs.gnu.org; Sat, 14 Oct 2023 02:54:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrYXd-0003y8-K4 for 66534@debbugs.gnu.org; Sat, 14 Oct 2023 02:54:30 -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 1qrYXA-0004eP-Qc; Sat, 14 Oct 2023 02:54:00 -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=Ceqq5hYp7WRKbUXS80Lmx4AWLke8SHHHCGwLzKwqB8I=; b=WH3PezK2vwJD UhgS62c8cnUuglleQ1vvkwYrVe9dqFsY1P346W20qc5sFhna3p1IqFIAx6wrRUs6+SuwkOB6RYG9o vRTcO3rLRVaz+Rdy4jDNvyVGBFYb/l6jTwiqwpfIlb9yAA72uwNRtNH/fYReSP1S83OYPjibDr5i2 Mz7gTn/pu5JIr7P19mljUQa/S+l0UV/VzPCSTUaPMYgXIig2IbrAdn8cCh52V5iw1YJWxd3ZQt0TT xs1lXa9ysAVul/leN7kbKNQuDIzg90W0UfESnOOG1O0Dul0gPpm38CRASDbUlHTvV2Covw6S+2xow yWmJ3dDSujB7F33M9lIkfw==; In-Reply-To: (bug-gnu-emacs@gnu.org) 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:272377 Archived-At: > Date: Fri, 13 Oct 2023 20:41:16 +0200 > From: Christoph via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > I noticed that during startup, emacs tries to load ~/.emacs (with > different extensions) many times over. You can see this by using > strace and tracing the openat syscall. The problem is, that `load' > does not expand the ~/ in the filename passed to it. So it does not > recognize the file as being absolute and tries to resolve it using > the load-path. > > While resolving the path in the openp function in lread.c, > `expand-file-name' is used with the default directory being the > elements of the load-path. Since for `expand-file-name', ~/.emacs is > an absolute path, it returns the path unchanged, and load tries to > load ~/.emacs many times over. I don't understand what you are saying here. The last sentence is incorrect, as evidenced by the following: (expand-file-name "~/.emacs" "/tmp") => "/home/eliz/.emacs" IOW, "~/.emacs" is indeed treated by Emacs as an absolute file name, but expand-file-name does NOT return "~/.emacs" unchanged. So please explain what exactly is the problem you see here, and in particular what issues that problem causes in your case. Thanks.