Fix deduplication in add-load-path!

Currently, `add-load-path!` doesn’t check for duplicates in `load-path`, because `cl-pushnew` tests for equality with `eql`. This changes the predicate to `string=`, fixing the bug.
This commit is contained in:
Janfel 2020-08-07 18:28:36 +02:00 committed by GitHub
parent b091a43fc7
commit 3760ceb048
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -328,7 +328,7 @@ The current file is the file from which `add-to-load-path!' is used."
`(let ((default-directory ,(dir!)) `(let ((default-directory ,(dir!))
file-name-handler-alist) file-name-handler-alist)
(dolist (dir (list ,@dirs)) (dolist (dir (list ,@dirs))
(cl-pushnew (expand-file-name dir) load-path)))) (cl-pushnew (expand-file-name dir) load-path :test #'string=))))
(defmacro after! (package &rest body) (defmacro after! (package &rest body)
"Evaluate BODY after PACKAGE have loaded. "Evaluate BODY after PACKAGE have loaded.