GNU bug report logs - #66534
30.0.50; [PATCH] Expand file-name of ~/.emacs before attempt to load it

Previous Next

Package: emacs;

Reported by: Christoph <just.mychris <at> googlemail.com>

Date: Sat, 14 Oct 2023 01:07:02 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christoph <just.mychris <at> googlemail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50;
 [PATCH] Expand file-name of ~/.emacs before attempt to load it
Date: Fri, 13 Oct 2023 20:41:16 +0200
[Message part 1 (text/plain, inline)]
Hi,

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 am not sure if the behavior of
`load' should also be considered a bug, but since all the other paths
of init files are resolved using `expand-file-name', I guess the same
should be done for the ~/.emacs path as well.

-- Christoph
[0001-Expand-file-name-of-.emacs-before-attempt-to-load-it.patch (text/x-patch, attachment)]

This bug report was last modified 1 year and 236 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.