From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christoph via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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 11:05:42 +0200 Message-ID: References: <87cyxhhdhd.fsf@igel.home> Reply-To: Christoph 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="24945"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66534@debbugs.gnu.org To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 14 14:46:54 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 1qre2f-0006JA-Uj for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Oct 2023 14:46:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qre2b-0000Bb-9H; Sat, 14 Oct 2023 08:46:49 -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 1qre2R-0008Un-Fy for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 08:46:45 -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 1qre2Q-0001hW-Ln for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 08:46:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qre2o-0004LT-7N for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 08:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Christoph Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Oct 2023 12:47: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 X-Debbugs-Original-Cc: "Christoph via Bug reports for GNU Emacs, the Swiss army knife of text editors" , 66534@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169728758616658 (code B ref -1); Sat, 14 Oct 2023 12:47:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Oct 2023 12:46:26 +0000 Original-Received: from localhost ([127.0.0.1]:48105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qre2C-0004KI-Hj for submit@debbugs.gnu.org; Sat, 14 Oct 2023 08:46:26 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:58994) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrabK-0008TR-PW for submit@debbugs.gnu.org; Sat, 14 Oct 2023 05:06:27 -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 1qraaq-0007Uq-Js for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 05:05:56 -0400 Original-Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qraap-0002Me-1q for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 05:05:56 -0400 Original-Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-99c1c66876aso451761566b.2 for ; Sat, 14 Oct 2023 02:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20230601; t=1697274353; x=1697879153; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ehFqExKq2LRK23v/E5qLexApUMovVg5wUnJvWwSkYRw=; b=LuKkBKKBn/2Tkr40iQ23baOJhp4hwhW3Lpk6F82wHt7ngd+gW79nuvO6og+Z5bZA6T JG4Cg7WRUuHfpqyDj7pw64Fsz5B5cl4r09F1kuYgt+gOiSOvMVP75rz3C3cps07DTBOV 8Qrm3AyJPFvrJQYnCWVZKNc2O1LHgOMzwekKEixYga4BUeM3wbFuSJqtw/QkMIUZKhlN lXbDOer3u7RuouLtKT8ky+YLKuOXPEA0vwJ41q2TtCoabvVUASNQIG6XrakUh1cNZ1ik YXYoM/nCxC/ankRWUHxKePea06B66IrBwAvaKFju1aBOoWVIxfnRIoNPkKJRgA0Gd5b3 +pGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697274353; x=1697879153; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ehFqExKq2LRK23v/E5qLexApUMovVg5wUnJvWwSkYRw=; b=AulOgWuiy6+B2a3ZuT9QLwXR/ozV5sryUcauFvSa09Cj76T7NGeqLz8HjFQSeoRaLm qNaMe+GinE5NwynOdHBT4+xQzJHxot8evqy87AjsXKE6be2OTCL7aYGY1Zl3D1qG2nj2 /Y6DYSSqnCEttFSHT1usBBwxbYII+EtDf/2XeCzl9IE4lWWNnECyXZ7xtXAhVgmZjGTZ 9MVenaDjLahHxUqwFIRxI2AbRZtAhyGNCdZt/ZViwhyMJTZDOY4iZiy9KzILsZuIuAR2 kP9PfRLHvnAALJI3q5VxoNdcTYt2tF6ad7BTYAbKIojm3KN5Ug1QFes2Ar7m6asRqE4R az+g== X-Gm-Message-State: AOJu0YzBto0G9ep//RN2/asKaYtYVm1boOQqJXC6w+Xl7jrFXVyaDitB i6NI8jOZnc3uqXkNdIbkYn0godz3j8sOORIElFmf3fX/tkuGHQ== X-Google-Smtp-Source: AGHT+IGaffvYBEN3GO2813qD0BIjl1vYkoYb17S9MS7ocrSL1XCjStAq8oTo2kFJTE8xv3yz5qBvK/CstqQOoFZGPmM= X-Received: by 2002:a17:906:6a01:b0:9bd:ac0f:83dc with SMTP id qw1-20020a1709066a0100b009bdac0f83dcmr3489373ejc.54.1697274353448; Sat, 14 Oct 2023 02:05:53 -0700 (PDT) In-Reply-To: <87cyxhhdhd.fsf@igel.home> Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=just.mychris@googlemail.com; helo=mail-ej1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 14 Oct 2023 08:46:21 -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:272416 Archived-At: On Sat, Oct 14, 2023 at 9:25=E2=80=AFAM Andreas Schwab wrote: > > On Okt 13 2023, Christoph via "Bug reports for GNU Emacs, the Swiss army = knife of text editors" wrote: > > > 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. > > That's probably a bug in complete_filename_p. > I am not so sure if complete_filename_p should be able to recognize these kinds of paths, or if `load' should expand the filename before using it. I am not familiar with all supported platforms, but it might be tricky to check if a filename is absolute, without expanding it beforehand. For instance, what about filenames that start with a series of "../". I guess they should be considered to be absolute, if the path goes up to the root. On the other hand, the documentation of `load' does not mention absolute paths at all and states, This function searches the directories on `load-path'. So I can't say what the expected behaviour of load is with paths that aren't expanded, but are absolute. I am hesitant with changing the C code, because I am not very familiar with it and just started to get into it, so I thought it might be more appropriate to change it on the Lisp side, since all the other paths to init files are fully expanded before passing them to load. But yes, as I wrote before, I think this behaviour of load could be considered a bug as well. -- Christoph