summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2019-12-13 10:33:42 +0900
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2019-12-13 10:48:28 +0900
commite34e02707d6bd38c79ce7bec776fcdc528548a0d (patch)
tree2783c4b95ca037b4180303efdda5f59e4c4f5db3 /guix
parentd057c52f951d92460a987770fef0881a300c07cf (diff)
downloadguix-patches-e34e02707d6bd38c79ce7bec776fcdc528548a0d.tar
guix-patches-e34e02707d6bd38c79ce7bec776fcdc528548a0d.tar.gz
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 <jlicht@fsfe.org>
Diffstat (limited to 'guix')
-rw-r--r--guix/build/emacs-build-system.scm14
1 files changed, 12 insertions, 2 deletions
diff --git a/guix/build/emacs-build-system.scm b/guix/build/emacs-build-system.scm
index 52c1ea177e..09de244993 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)))