GNU bug report logs -
#75817
[PATCH] profiles: emacs-subdirs: Avoid building list with a loop
Previous Next
Full log
Message #14 received at 75817 <at> debbugs.gnu.org (full text, mbox):
If the EMACSNATIVELOADPATH environment variable (by mistake) has duplicated
paths, Emacs fails to load with:
$ emacs
List contains a loop:
("/home/user/.guix-profile/lib/emacs/native-site-lisp"
"/gnu/store/…-emacs-lsp-mode-9.0.0/lib/emacs/native-site-lisp"
"/home/user/.guix-profile/lib/emacs/native-site-lisp"
"/home/user/.guix-profile/lib/emacs/native-site-lisp"
"/gnu/store/…-emacs-lsp-mode-9.0.0/lib/emacs/native-site-lisp" . #2)
$ echo $?
255
A git bisect in Guix to find when the problem was introduced arrived at
commit e9b13294700d ("profiles: emacs-subdirs: Also expand
native-comp-eln-load-path.").
Fix the problem by applying Liliana's suggestion of changing 'nconc' to
'append' in the Elisp code written to subdirs.el.
* guix/profiles.scm (emacs-subdirs): Use 'append' rather than 'nconc'.
Change-Id: If646b806f24666b5247850d30d2819c7482c130b
Fixes: Emacs "List contains a loop" error <https://issues.guix.gnu.org/75709>
Suggested-by: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
---
guix/profiles.scm | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Changes since v1:
Made the following changes suggested by Liliana:
- Added comment to Elisp comment warning about destructive procedures
- Added short bug description to "Fixes" tag.
diff --git a/guix/profiles.scm b/guix/profiles.scm
index 87b9543ac01f..fb4dbc5bd079 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1230,8 +1230,12 @@ (define build
(setq native-comp-eln-load-path
(mapcan (lambda (dir)
(if (equal dir needle)
- (nconc ',native-comp-dirs
- (list dir))
+ ;; Note: needle may be found
+ ;; multiple times, so don't use
+ ;; destructive procedures like
+ ;; nconc.
+ (append ',native-comp-dirs
+ (list dir))
(list dir)))
native-comp-eln-load-path))))
port)
This bug report was last modified 105 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.