emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 2c45091: load-library, locate-library: Use read-library-name


From: Eli Zaretskii
Subject: master 2c45091: load-library, locate-library: Use read-library-name
Date: Fri, 3 Apr 2020 08:00:26 -0400 (EDT)

branch: master
commit 2c4509179110459f42119ce328d72fea65689288
Author: Štěpán Němec <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    load-library, locate-library: Use read-library-name
    
    * 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 | 1 +
 lisp/files.el                | 7 +------
 lisp/subr.el                 | 7 +------
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 167ead3..e35db56 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -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.
 
diff --git a/lisp/files.el b/lisp/files.el
index 55a0958..beafdac 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -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)
diff --git a/lisp/subr.el b/lisp/subr.el
index 70f33ee..70a74fb 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]