diff options
| -rw-r--r-- | lisp/finder.el | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/lisp/finder.el b/lisp/finder.el index 56a13c09a37..aba3796c400 100644 --- a/lisp/finder.el +++ b/lisp/finder.el | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | ;;; Code: | 39 | ;;; Code: |
| 40 | 40 | ||
| 41 | (require 'lisp-mnt) | 41 | (require 'lisp-mnt) |
| 42 | (require 'find-func) ;for find-library(-suffixes) | ||
| 42 | ;; Use `load' rather than `require' so that it doesn't get loaded | 43 | ;; Use `load' rather than `require' so that it doesn't get loaded |
| 43 | ;; during byte-compilation (at which point it might be missing). | 44 | ;; during byte-compilation (at which point it might be missing). |
| 44 | (load "finder-inf" nil t) | 45 | (load "finder-inf" nil t) |
| @@ -259,24 +260,17 @@ no arguments compiles from `load-path'." | |||
| 259 | (shrink-window-if-larger-than-buffer) | 260 | (shrink-window-if-larger-than-buffer) |
| 260 | (finder-summary))) | 261 | (finder-summary))) |
| 261 | 262 | ||
| 262 | (defun finder-find-library (library) | ||
| 263 | "Search for file LIBRARY on `load-path'. | ||
| 264 | Try compressed versions if jka-compr is in use." | ||
| 265 | (or (locate-library library t) | ||
| 266 | (if (rassq 'jka-compr-handler file-name-handler-alist) | ||
| 267 | (or (locate-library (concat library ".gz") t) | ||
| 268 | (locate-library (concat library ".Z") t) | ||
| 269 | ;; last resort for MS-DOG et al | ||
| 270 | (locate-library (concat library "z")))))) | ||
| 271 | |||
| 272 | ;;;###autoload | 263 | ;;;###autoload |
| 273 | (defun finder-commentary (file) | 264 | (defun finder-commentary (file) |
| 274 | "Display FILE's commentary section. | 265 | "Display FILE's commentary section. |
| 275 | FILE should be in a form suitable for passing to `locate-library'." | 266 | FILE should be in a form suitable for passing to `locate-library'." |
| 276 | (interactive "sLibrary name: ") | 267 | (interactive |
| 277 | (let* ((str (lm-commentary (or (finder-find-library file) | 268 | (list |
| 278 | (finder-find-library (concat file ".el")) | 269 | (completing-read "Library name: " |
| 279 | (error "Can't find library %s" file))))) | 270 | 'locate-file-completion |
| 271 | (cons (or find-function-source-path load-path) | ||
| 272 | (find-library-suffixes))))) | ||
| 273 | (let* ((str (lm-commentary (find-library-name file)))) | ||
| 280 | (if (null str) | 274 | (if (null str) |
| 281 | (error "Can't find any Commentary section")) | 275 | (error "Can't find any Commentary section")) |
| 282 | (pop-to-buffer "*Finder*") | 276 | (pop-to-buffer "*Finder*") |