1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-25 07:28:20 +00:00

Handle nil load-path element in read-library-name

* lisp/emacs-lisp/find-func.el (read-library-name): Fix handling of
nil 'load-path' element.  (Bug#41998)

Copyright-paperwork-exempt: yes
This commit is contained in:
Tobias Zawada 2020-08-13 18:42:28 +02:00 committed by Stefan Kangas
parent 3e00a78a32
commit 975acf5737

View File

@ -292,12 +292,13 @@ if non-nil)."
(find-library-suffixes)
"\\|"))
(table (cl-loop for dir in (or find-function-source-path load-path)
when (file-readable-p dir)
for dir-or-default = (or dir default-directory)
when (file-readable-p dir-or-default)
append (mapcar
(lambda (file)
(replace-regexp-in-string suffix-regexp
"" file))
(directory-files dir nil
(directory-files dir-or-default nil
suffix-regexp))))
(def (if (eq (function-called-at-point) 'require)
;; `function-called-at-point' may return 'require