1309 |
(setq files (cdr files))) |
(setq files (cdr files))) |
1310 |
file))) |
file))) |
1311 |
|
|
1312 |
|
;;;###autoload |
1313 |
|
(defun locate-library (library &optional nosuffix path interactive-call) |
1314 |
|
"Show the precise file name of Emacs library LIBRARY. |
1315 |
|
This command searches the directories in `load-path' like `\\[load-library]' |
1316 |
|
to find the file that `\\[load-library] RET LIBRARY RET' would load. |
1317 |
|
Optional second arg NOSUFFIX non-nil means don't add suffixes `load-suffixes' |
1318 |
|
to the specified name LIBRARY. |
1319 |
|
|
1320 |
|
If the optional third arg PATH is specified, that list of directories |
1321 |
|
is used instead of `load-path'. |
1322 |
|
|
1323 |
|
When called from a program, the file name is normaly returned as a |
1324 |
|
string. When run interactively, the argument INTERACTIVE-CALL is t, |
1325 |
|
and 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 |
|
|
1340 |
|
|
1341 |
;;;; Specifying things to do later. |
;;;; Specifying things to do later. |
1342 |
|
|