aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Francoise2005-10-28 16:55:48 +0000
committerRomain Francoise2005-10-28 16:55:48 +0000
commit059a552c5c93934197684028e255fbb69ce35f2e (patch)
tree5e5fee0f296643c97886397cc40a90caaad9b8f1
parent107fb6c99543bb33b2ece343c9703c8b36095006 (diff)
downloademacs-059a552c5c93934197684028e255fbb69ce35f2e.tar.gz
emacs-059a552c5c93934197684028e255fbb69ce35f2e.zip
* subr.el (locate-library): Move from help-fns.el.
* help-fns.el (locate-library): Move to subr.el.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/help-fns.el28
-rw-r--r--lisp/subr.el28
3 files changed, 34 insertions, 29 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1e6976349d1..0da6914059f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12005-10-28 Romain Francoise <romain@orebokech.com>
2
3 * subr.el (locate-library): Move from help-fns.el.
4 * help-fns.el (locate-library): Move to subr.el.
5
12005-10-28 Richard M. Stallman <rms@gnu.org> 62005-10-28 Richard M. Stallman <rms@gnu.org>
2 7
3 * net/tramp.el (tramp-completion-mode): defvar moved up. 8 * net/tramp.el (tramp-completion-mode): defvar moved up.
@@ -20,7 +25,7 @@
20 * textmodes/flyspell.el (flyspell-large-region): Pass -t if Tex file. 25 * textmodes/flyspell.el (flyspell-large-region): Pass -t if Tex file.
21 (flyspell-external-point-words): Error if misspelled word is not found. 26 (flyspell-external-point-words): Error if misspelled word is not found.
22 Set flyspell-large-region-beg at end of word. 27 Set flyspell-large-region-beg at end of word.
23 28
242005-10-28 Andreas Schwab <schwab@suse.de> 292005-10-28 Andreas Schwab <schwab@suse.de>
25 30
26 * view.el (View-revert-buffer-scroll-page-forward): Use 31 * view.el (View-revert-buffer-scroll-page-forward): Use
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index b39d92cf3be..cffe313fd6c 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -100,34 +100,6 @@ With ARG, you are asked to choose which language."
100 (setq buffer-undo-list nil) 100 (setq buffer-undo-list nil)
101 (set-buffer-modified-p nil)))) 101 (set-buffer-modified-p nil))))
102 102
103;;;###autoload
104(defun locate-library (library &optional nosuffix path interactive-call)
105 "Show the precise file name of Emacs library LIBRARY.
106This command searches the directories in `load-path' like `\\[load-library]'
107to find the file that `\\[load-library] RET LIBRARY RET' would load.
108Optional second arg NOSUFFIX non-nil means don't add suffixes `load-suffixes'
109to the specified name LIBRARY.
110
111If the optional third arg PATH is specified, that list of directories
112is used instead of `load-path'.
113
114When called from a program, the file name is normaly returned as a
115string. When run interactively, the argument INTERACTIVE-CALL is t,
116and the file name is displayed in the echo area."
117 (interactive (list (completing-read "Locate library: "
118 'locate-file-completion
119 (cons load-path load-suffixes))
120 nil nil
121 t))
122 (let ((file (locate-file library
123 (or path load-path)
124 (append (unless nosuffix load-suffixes) '("")))))
125 (if interactive-call
126 (if file
127 (message "Library is file %s" (abbreviate-file-name file))
128 (message "No library %s in search path" library)))
129 file))
130
131 103
132;; Functions 104;; Functions
133 105
diff --git a/lisp/subr.el b/lisp/subr.el
index 04b36897f39..26a741f91e4 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1309,6 +1309,34 @@ definition only or variable definition only.
1309 (setq files (cdr files))) 1309 (setq files (cdr files)))
1310 file))) 1310 file)))
1311 1311
1312;;;###autoload
1313(defun locate-library (library &optional nosuffix path interactive-call)
1314 "Show the precise file name of Emacs library LIBRARY.
1315This command searches the directories in `load-path' like `\\[load-library]'
1316to find the file that `\\[load-library] RET LIBRARY RET' would load.
1317Optional second arg NOSUFFIX non-nil means don't add suffixes `load-suffixes'
1318to the specified name LIBRARY.
1319
1320If the optional third arg PATH is specified, that list of directories
1321is used instead of `load-path'.
1322
1323When called from a program, the file name is normaly returned as a
1324string. When run interactively, the argument INTERACTIVE-CALL is t,
1325and the file name is displayed in the echo area."
1326 (interactive (list (completing-read "Locate library: "
1327 'locate-file-completion
1328 (cons load-path load-suffixes))
1329 nil nil
1330 t))
1331 (let ((file (locate-file library
1332 (or path load-path)
1333 (append (unless nosuffix load-suffixes) '("")))))
1334 (if interactive-call
1335 (if file
1336 (message "Library is file %s" (abbreviate-file-name file))
1337 (message "No library %s in search path" library)))
1338 file))
1339
1312 1340
1313;;;; Specifying things to do later. 1341;;;; Specifying things to do later.
1314 1342