]> git.eshelyaron.com Git - emacs.git/commitdiff
load-library, locate-library: Use read-library-name
authorŠtěpán Němec <stepnem@gmail.com>
Sat, 28 Mar 2020 21:16:28 +0000 (22:16 +0100)
committerEli Zaretskii <eliz@gnu.org>
Fri, 3 Apr 2020 11:54:49 +0000 (14:54 +0300)
* lisp/emacs-lisp/find-func.el (read-library-name): Add autoload
cookie.
* lisp/files.el (load-library)
* lisp/subr.el (locate-library): Use 'read-library-name' when called
interactively. (bug#6652 bug#6679)

lisp/emacs-lisp/find-func.el
lisp/files.el
lisp/subr.el

index 167ead3ce02bc9ca5b57fa68c1ad6cbc57933bf8..e35db56550d821ab1a98ef9f9738b7fb5132440e 100644 (file)
@@ -279,6 +279,7 @@ Interactively, prompt for LIBRARY using the one at or near point."
       (switch-to-buffer (find-file-noselect (find-library-name library)))
     (run-hooks 'find-function-after-hook)))
 
+;;;###autoload
 (defun read-library-name ()
   "Read and return a library name, defaulting to the one near point.
 
index 55a0958f5402a75a26cb64fe1eb050a4231fb20a..beafdaca99188dbeff31be24a0d2ce35ec593764 100644 (file)
@@ -1103,12 +1103,7 @@ well as `load-file-rep-suffixes').
 
 See Info node `(emacs)Lisp Libraries' for more details.
 See `load-file' for a different interface to `load'."
-  (interactive
-   (let (completion-ignored-extensions)
-     (list (completing-read "Load library: "
-                            (apply-partially 'locate-file-completion-table
-                                             load-path
-                                             (get-load-suffixes))))))
+  (interactive (list (read-library-name)))
   (load library))
 
 (defun file-remote-p (file &optional identification connected)
index 70f33ee5bdb01fc999991fa02e62e1ce0af108f5..70a74fba6698350c57c4fb40e6524eecaf2887f7 100644 (file)
@@ -2301,12 +2301,7 @@ is used instead of `load-path'.
 When called from a program, the file name is normally returned as a
 string.  When run interactively, the argument INTERACTIVE-CALL is t,
 and the file name is displayed in the echo area."
-  (interactive (list (completing-read "Locate library: "
-                                     (apply-partially
-                                       'locate-file-completion-table
-                                       load-path (get-load-suffixes)))
-                    nil nil
-                    t))
+  (interactive (list (read-library-name) nil nil t))
   (let ((file (locate-file library
                           (or path load-path)
                           (append (unless nosuffix (get-load-suffixes))