aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorDave Love1999-01-29 18:27:10 +0000
committerDave Love1999-01-29 18:27:10 +0000
commit2d212d873560d74d59e50bbdcb6886f66a90f118 (patch)
treea4d1ed856cb0dc996735a040e294a964414cd550 /lisp
parent1f0402c393a593d4e8285ee54d1d38ab0643ce4e (diff)
downloademacs-2d212d873560d74d59e50bbdcb6886f66a90f118.tar.gz
emacs-2d212d873560d74d59e50bbdcb6886f66a90f118.zip
(finder-commentary): Fix interactive spec. Try
appending .el to file name. (finder-find-library, finder-commentary): Doc fixes.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/finder.el26
1 files changed, 14 insertions, 12 deletions
diff --git a/lisp/finder.el b/lisp/finder.el
index 07d79f84220..a0216c415b6 100644
--- a/lisp/finder.el
+++ b/lisp/finder.el
@@ -1,6 +1,6 @@
1;;; finder.el --- topic & keyword-based code finder 1;;; finder.el --- topic & keyword-based code finder
2 2
3;; Copyright (C) 1992, 1997, 1998 Free Software Foundation, Inc. 3;; Copyright (C) 1992, 1997, 1998, 1999 Free Software Foundation, Inc.
4 4
5;; Author: Eric S. Raymond <esr@snark.thyrsus.com> 5;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
6;; Created: 16 Jun 1992 6;; Created: 16 Jun 1992
@@ -103,8 +103,8 @@
103 103
104(defun finder-compile-keywords (&rest dirs) 104(defun finder-compile-keywords (&rest dirs)
105 "Regenerate the keywords association list into the file `finder-inf.el'. 105 "Regenerate the keywords association list into the file `finder-inf.el'.
106Optional arguments are a list of Emacs Lisp directories to compile from; no 106Optional arguments DIRS are a list of Emacs Lisp directories to compile from;
107arguments compiles from `load-path'." 107no arguments compiles from `load-path'."
108 (save-excursion 108 (save-excursion
109 (let ((processed nil)) 109 (let ((processed nil))
110 (find-file "finder-inf.el") 110 (find-file "finder-inf.el")
@@ -120,7 +120,7 @@ arguments compiles from `load-path'."
120 (when (file-exists-p (directory-file-name d)) 120 (when (file-exists-p (directory-file-name d))
121 (message "Directory %s" d) 121 (message "Directory %s" d)
122 (mapcar 122 (mapcar
123 (lambda (f) 123 (lambda (f)
124 (if (and (or (string-match "^[^=].*\\.el$" f) 124 (if (and (or (string-match "^[^=].*\\.el$" f)
125 ;; Allow compressed files also. Fixme: 125 ;; Allow compressed files also. Fixme:
126 ;; generalize this, especially for 126 ;; generalize this, especially for
@@ -143,7 +143,7 @@ arguments compiles from `load-path'."
143 (insert 143 (insert
144 (format " (\"%s\"\n " 144 (format " (\"%s\"\n "
145 (if (string-match "\\.\\(gz\\|Z\\)$" f) 145 (if (string-match "\\.\\(gz\\|Z\\)$" f)
146 (file-name-sans-extension f) 146 (file-name-sans-extension f)
147 f))) 147 f)))
148 (prin1 summary (current-buffer)) 148 (prin1 summary (current-buffer))
149 (insert 149 (insert
@@ -229,9 +229,9 @@ arguments compiles from `load-path'."
229 (shrink-window-if-larger-than-buffer) 229 (shrink-window-if-larger-than-buffer)
230 (finder-summary))) 230 (finder-summary)))
231 231
232;; Search for a file named FILE on `load-path', also trying compressed
233;; versions if jka-compr is in use.
234(defun finder-find-library (library) 232(defun finder-find-library (library)
233 "Search for file LIBRARY on `load-path'.
234Try compressed versions if jka-compr is in use."
235 (or (locate-library library t) 235 (or (locate-library library t)
236 (if (rassq 'jka-compr-handler file-name-handler-alist) 236 (if (rassq 'jka-compr-handler file-name-handler-alist)
237 (or (locate-library (concat library ".gz") t) 237 (or (locate-library (concat library ".gz") t)
@@ -240,9 +240,12 @@ arguments compiles from `load-path'."
240 (locate-library (concat library "z")))))) 240 (locate-library (concat library "z"))))))
241 241
242(defun finder-commentary (file) 242(defun finder-commentary (file)
243 "Display FILE's commentary section." 243 "Display FILE's commentary section.
244 (interactive) 244FILE should be in a form suitable for passing to `locate-library'."
245 (let* ((str (lm-commentary (finder-find-library file)))) 245 (interactive "sLibrary name: ")
246 (let* ((str (lm-commentary (or (finder-find-library file)
247 (finder-find-library (concat file ".el"))
248 (error "Can't find library %s" file)))))
246 (if (null str) 249 (if (null str)
247 (error "Can't find any Commentary section")) 250 (error "Can't find any Commentary section"))
248 (pop-to-buffer "*Finder*") 251 (pop-to-buffer "*Finder*")
@@ -294,8 +297,7 @@ arguments compiles from `load-path'."
294 "Major mode for browsing package documentation. 297 "Major mode for browsing package documentation.
295\\<finder-mode-map> 298\\<finder-mode-map>
296\\[finder-select] more help for the item on the current line 299\\[finder-select] more help for the item on the current line
297\\[finder-exit] exit Finder mode and kill the Finder buffer. 300\\[finder-exit] exit Finder mode and kill the Finder buffer."
298"
299 (interactive) 301 (interactive)
300 (use-local-map finder-mode-map) 302 (use-local-map finder-mode-map)
301 (set-syntax-table emacs-lisp-mode-syntax-table) 303 (set-syntax-table emacs-lisp-mode-syntax-table)