Entries in load-path should not have trailing slashes
The file elisp/geiser.el
contains the following code:
;;;###autoload
(defconst geiser-elisp-dir (file-name-directory load-file-name)
"Directory containing Geiser's Elisp files.")
...
;;;###autoload
(when (not (member geiser-elisp-dir load-path))
(add-to-list 'load-path geiser-elisp-dir))
This is problematic. As the documentation for load-path
states:
Use ‘directory-file-name’ when adding items to this path.
But geiser-elisp-dir
has a trailing slash. This seems like a bug to me. Can it be fixed?
The reason this came up is that I maintain an Emacs package manager, straight.el
. Once straight.el
builds a package, it adds the directory to load-path
, using directory-file-name
as specified by the documentation of load-path
. But since Geiser insists on also adding its own entry to load-path
, and does so with a superfluous trailing slash, we end up with two duplicate entries. Under some configurations, this causes duplicate entries to appear when using M-x find-library
.
Thanks!