guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: emacs-build-system: Ensure the core libraries appear last in the


From: guix-commits
Subject: 01/01: emacs-build-system: Ensure the core libraries appear last in the load path.
Date: Thu, 12 Dec 2019 21:07:44 -0500 (EST)

apteryx pushed a commit to branch master
in repository guix.

commit e34e02707d6bd38c79ce7bec776fcdc528548a0d
Author: Maxim Cournoyer <address@hidden>
Date:   Fri Dec 13 10:33:42 2019 +0900

    emacs-build-system: Ensure the core libraries appear last in the load path.
    
    Fixes bug #38568 (see: https://bugs.gnu.org/38568).
    
    * guix/build/emacs-build-system.scm (add-source-to-load-path): Ensure the 
core
    libraries appear last in the load path.
    
    Reported-by: Jelle Licht <address@hidden>
---
 guix/build/emacs-build-system.scm | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/guix/build/emacs-build-system.scm 
b/guix/build/emacs-build-system.scm
index 52c1ea1..09de244 100644
--- a/guix/build/emacs-build-system.scm
+++ b/guix/build/emacs-build-system.scm
@@ -76,8 +76,18 @@ archive, a directory, or an Emacs Lisp file."
 (define* (add-source-to-load-path #:key dummy #:allow-other-keys)
   "Augment the EMACSLOADPATH environment variable with the source directory."
   (let* ((source-directory (getcwd))
-         (emacs-load-path-value (string-append source-directory ":"
-                                               (getenv "EMACSLOADPATH"))))
+         (emacs-load-path (string-split (getenv "EMACSLOADPATH") #\:))
+         ;; XXX: Make sure the Emacs core libraries appear at the end of
+         ;; EMACSLOADPATH, to avoid shadowing any other libraries depended
+         ;; upon.
+         (emacs-load-path-non-core (filter (cut string-contains <>
+                                                "/share/emacs/site-lisp")
+                                           emacs-load-path))
+         (emacs-load-path-value (string-append
+                                 (string-join (cons source-directory
+                                                    emacs-load-path-non-core)
+                                              ":")
+                                 ":")))
     (setenv "EMACSLOADPATH" emacs-load-path-value)
     (format #t "source directory ~s prepended to the `EMACSLOADPATH' \
 environment variable\n" source-directory)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]