Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit b997bce9 authored by Ryan C. Thompson's avatar Ryan C. Thompson

Merge branch 'load-path-nil'

parents 52f5d68e 3ab59b16
......@@ -164,7 +164,9 @@ entry."
"Return the list of absolute directory names to be added to
`load-path' by the named PACKAGE."
(let* ((source (el-get-package-def package))
(el-path (el-get-flatten (or (plist-get source :load-path) ".")))
(el-path (if (plist-member source :load-path)
(el-get-flatten (plist-get source :load-path))
'(".")))
(pkg-dir (el-get-package-directory package)))
(mapcar (lambda (p) (expand-file-name p pkg-dir)) el-path)))
......
;; https://github.com/dimitri/el-get/issues/632
;;
;; Do not add package directory to load-path if :load-path property is nil
(require 'cl)
(let* ((debug-on-error t)
(el-get-verbose t)
;; Just need to install something
(pkg1 'zenburn-theme)
(pkg2 'color-theme)
(el-get-sources
(list `(:name ,pkg1 :load-path nil)
`(:name ,pkg2))))
(el-get 'sync pkg1 pkg2)
(assert (el-get-package-is-installed pkg1))
(assert (el-get-package-is-installed pkg2))
(assert (plist-member (el-get-package-def pkg1) :load-path))
(assert (not (plist-member (el-get-package-def pkg2) :load-path)))
(let ((normalized-load-path
(mapcar #'file-name-as-directory
(mapcar #'expand-file-name load-path)))
(pkg-in-load-path
(lambda (pkg)
(member (file-name-as-directory (el-get-package-directory pkg))
normalized-load-path))))
(assert (not (funcall pkg-in-load-path pkg1))
nil "Package directory of %s should not be in `load-path'"
pkg1)
(assert (funcall pkg-in-load-path pkg2)
nil "Package directory of %s should be in `load-path'"
pkg2)))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment