diff options
| author | Lars Ingebrigtsen | 2020-09-14 13:26:17 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2020-09-14 13:26:17 +0200 |
| commit | 7629aa74091d43370da751d86b0584ba3516ea75 (patch) | |
| tree | 6b825417437e820ee39b234610c82af4c33098c9 | |
| parent | 7cc161433832e6a518701d2b47fef7b298dc4a0a (diff) | |
| download | emacs-7629aa74091d43370da751d86b0584ba3516ea75.tar.gz emacs-7629aa74091d43370da751d86b0584ba3516ea75.zip | |
Revert "Fix completion in `read-library-name'"
This reverts commit ed44217d3245ddc8f2cf75c9499d5bb37848cfd7.
This commit broke the use case of `M-x load-library RET o/or TAB' to
expand to org/org.
| -rw-r--r-- | lisp/emacs-lisp/find-func.el | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 9e252d8c529..f3f3944a7f8 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el | |||
| @@ -286,20 +286,10 @@ Interactively, prompt for LIBRARY using the one at or near point." | |||
| 286 | A library name is the filename of an Emacs Lisp library located | 286 | A library name is the filename of an Emacs Lisp library located |
| 287 | in a directory under `load-path' (or `find-function-source-path', | 287 | in a directory under `load-path' (or `find-function-source-path', |
| 288 | if non-nil)." | 288 | if non-nil)." |
| 289 | (let* ((suffix-regexp (mapconcat | 289 | (let* ((dirs (or find-function-source-path load-path)) |
| 290 | (lambda (suffix) | 290 | (suffixes (find-library-suffixes)) |
| 291 | (concat (regexp-quote suffix) "\\'")) | 291 | (table (apply-partially 'locate-file-completion-table |
| 292 | (find-library-suffixes) | 292 | dirs suffixes)) |
| 293 | "\\|")) | ||
| 294 | (table (cl-loop for dir in (or find-function-source-path load-path) | ||
| 295 | for dir-or-default = (or dir default-directory) | ||
| 296 | when (file-readable-p dir-or-default) | ||
| 297 | append (mapcar | ||
| 298 | (lambda (file) | ||
| 299 | (replace-regexp-in-string suffix-regexp | ||
| 300 | "" file)) | ||
| 301 | (directory-files dir-or-default nil | ||
| 302 | suffix-regexp)))) | ||
| 303 | (def (if (eq (function-called-at-point) 'require) | 293 | (def (if (eq (function-called-at-point) 'require) |
| 304 | ;; `function-called-at-point' may return 'require | 294 | ;; `function-called-at-point' may return 'require |
| 305 | ;; with `point' anywhere on this line. So wrap the | 295 | ;; with `point' anywhere on this line. So wrap the |