mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-17 01:34:21 +00:00
Fix completion in `read-library-name'
* lisp/emacs-lisp/find-func.el (read-library-name): Only list .el/.el.gz files when completing (bug#36945).
This commit is contained in:
parent
d9e4d52a10
commit
ed44217d32
1 changed files with 13 additions and 4 deletions
|
|
@ -285,10 +285,19 @@ Interactively, prompt for LIBRARY using the one at or near point."
|
|||
A library name is the filename of an Emacs Lisp library located
|
||||
in a directory under `load-path' (or `find-function-source-path',
|
||||
if non-nil)."
|
||||
(let* ((dirs (or find-function-source-path load-path))
|
||||
(suffixes (find-library-suffixes))
|
||||
(table (apply-partially 'locate-file-completion-table
|
||||
dirs suffixes))
|
||||
(let* ((suffix-regexp (mapconcat
|
||||
(lambda (suffix)
|
||||
(concat (regexp-quote suffix) "\\'"))
|
||||
(find-library-suffixes)
|
||||
"\\|"))
|
||||
(table (cl-loop for dir in (or find-function-source-path load-path)
|
||||
when (file-readable-p dir)
|
||||
append (mapcar
|
||||
(lambda (file)
|
||||
(replace-regexp-in-string suffix-regexp
|
||||
"" file))
|
||||
(directory-files dir nil
|
||||
suffix-regexp))))
|
||||
(def (if (eq (function-called-at-point) 'require)
|
||||
;; `function-called-at-point' may return 'require
|
||||
;; with `point' anywhere on this line. So wrap the
|
||||
|
|
|
|||
Loading…
Reference in a new issue