summaryrefslogtreecommitdiff
path: root/lisp/finder.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-06-13 01:36:48 +0000
committerRichard M. Stallman <rms@gnu.org>1993-06-13 01:36:48 +0000
commitfb03cef3c12d28be9f1d6baa448d174e0c1b6214 (patch)
tree8e29c8ab331fa4179762967ac53c7d006f6139a6 /lisp/finder.el
parent346947298cce93a2a6eb068fac8d31cb5350536a (diff)
downloademacs-fb03cef3c12d28be9f1d6baa448d174e0c1b6214.tar.gz
(finder-find-library): New function.
(finder-commentary): Use it.
Diffstat (limited to 'lisp/finder.el')
-rw-r--r--lisp/finder.el16
1 files changed, 15 insertions, 1 deletions
diff --git a/lisp/finder.el b/lisp/finder.el
index 41e67723dde..44df466d7c6 100644
--- a/lisp/finder.el
+++ b/lisp/finder.el
@@ -187,9 +187,23 @@ arguments compiles from `load-path'."
(shrink-window-if-larger-than-buffer)
(finder-summary)))
+;; Search for a file named FILE the same way `load' would search.
+(defun finder-find-library (file)
+ (if (file-name-absolute-p file)
+ file
+ (let ((dirs load-path)
+ found)
+ (while (and dirs (not found))
+ (if (file-exists-p (expand-file-name (concat file ".el") (car dirs)))
+ (setq found (expand-file-name file (car dirs)))
+ (if (file-exists-p (expand-file-name file (car dirs)))
+ (setq found (expand-file-name file (car dirs)))))
+ (setq dirs (cdr dirs)))
+ found)))
+
(defun finder-commentary (file)
(interactive)
- (let* ((str (lm-commentary file)))
+ (let* ((str (lm-commentary (finder-find-library file))))
(if (null str)
(error "Can't find any Commentary section."))
(pop-to-buffer "*Finder*")