Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
a130d829
Commit
a130d829
authored
Sep 21, 1996
by
Richard M. Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(locate-library): Print no messages if called from Lisp.
parent
7ebea144
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
31 deletions
+37
-31
lisp/help.el
lisp/help.el
+37
-31
No files found.
lisp/help.el
View file @
a130d829
...
...
@@ -666,7 +666,7 @@ Argument is a command definition, usually a symbol with a function definition."
(
message
"%s is not on any key"
definition
)))
nil
)
(
defun
locate-library
(
library
&optional
nosuffix
path
)
(
defun
locate-library
(
library
&optional
nosuffix
path
interactive-call
)
"Show the precise file name of Emacs library LIBRARY.
This command searches the directories in `load-path' like `M-x load-library'
to find the file that `M-x load-library RET LIBRARY RET' would load.
...
...
@@ -675,35 +675,41 @@ to the specified name LIBRARY.
If the optional third arg PATH is specified, that list of directories
is used instead of `load-path'."
(
interactive
"sLocate library: "
)
(
catch
'answer
(
mapcar
'
(
lambda
(
dir
)
(
mapcar
'
(
lambda
(
suf
)
(
let
((
try
(
expand-file-name
(
concat
library
suf
)
dir
)))
(
and
(
file-readable-p
try
)
(
null
(
file-directory-p
try
))
(
progn
(
message
"Library is file %s"
try
)
(
throw
'answer
try
)))))
(
if
nosuffix
'
(
""
)
(
let
((
basic
'
(
".elc"
".el"
""
))
(
compressed
'
(
".Z"
".gz"
""
)))
;; If autocompression mode is on,
;; consider all combinations of library suffixes
;; and compression suffixes.
(
if
(
rassq
'jka-compr-handler
file-name-handler-alist
)
(
apply
'nconc
(
mapcar
'
(
lambda
(
compelt
)
(
mapcar
'
(
lambda
(
baselt
)
(
concat
baselt
compelt
))
basic
))
compressed
))
basic
)))))
(
or
path
load-path
))
(
message
"No library %s in search path"
library
)
nil
))
(
interactive
(
list
(
read-string
"Locate library: "
)
nil
nil
t
))
(
let
(
result
)
(
catch
'answer
(
mapcar
'
(
lambda
(
dir
)
(
mapcar
'
(
lambda
(
suf
)
(
let
((
try
(
expand-file-name
(
concat
library
suf
)
dir
)))
(
and
(
file-readable-p
try
)
(
null
(
file-directory-p
try
))
(
progn
(
setq
result
try
)
(
throw
'answer
try
)))))
(
if
nosuffix
'
(
""
)
(
let
((
basic
'
(
".elc"
".el"
""
))
(
compressed
'
(
".Z"
".gz"
""
)))
;; If autocompression mode is on,
;; consider all combinations of library suffixes
;; and compression suffixes.
(
if
(
rassq
'jka-compr-handler
file-name-handler-alist
)
(
apply
'nconc
(
mapcar
'
(
lambda
(
compelt
)
(
mapcar
'
(
lambda
(
baselt
)
(
concat
baselt
compelt
))
basic
))
compressed
))
basic
)))))
(
or
path
load-path
)))
(
and
interactive-call
(
if
result
(
message
"Library is file %s"
result
)
(
message
"No library %s in search path"
library
)))
result
))
;;; help.el ends here
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment