Mercurial > emacs
comparison lisp/finder.el @ 3708:e2cbba9f0ea3
(finder-find-library): New function.
(finder-commentary): Use it.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 13 Jun 1993 01:36:48 +0000 |
parents | 99d147f614f5 |
children | 3efae588d663 |
comparison
equal
deleted
inserted
replaced
3707:b00953e22dc3 | 3708:e2cbba9f0ea3 |
---|---|
185 (setq buffer-read-only t) | 185 (setq buffer-read-only t) |
186 (set-buffer-modified-p nil) | 186 (set-buffer-modified-p nil) |
187 (shrink-window-if-larger-than-buffer) | 187 (shrink-window-if-larger-than-buffer) |
188 (finder-summary))) | 188 (finder-summary))) |
189 | 189 |
190 ;; Search for a file named FILE the same way `load' would search. | |
191 (defun finder-find-library (file) | |
192 (if (file-name-absolute-p file) | |
193 file | |
194 (let ((dirs load-path) | |
195 found) | |
196 (while (and dirs (not found)) | |
197 (if (file-exists-p (expand-file-name (concat file ".el") (car dirs))) | |
198 (setq found (expand-file-name file (car dirs))) | |
199 (if (file-exists-p (expand-file-name file (car dirs))) | |
200 (setq found (expand-file-name file (car dirs))))) | |
201 (setq dirs (cdr dirs))) | |
202 found))) | |
203 | |
190 (defun finder-commentary (file) | 204 (defun finder-commentary (file) |
191 (interactive) | 205 (interactive) |
192 (let* ((str (lm-commentary file))) | 206 (let* ((str (lm-commentary (finder-find-library file)))) |
193 (if (null str) | 207 (if (null str) |
194 (error "Can't find any Commentary section.")) | 208 (error "Can't find any Commentary section.")) |
195 (pop-to-buffer "*Finder*") | 209 (pop-to-buffer "*Finder*") |
196 (setq buffer-read-only nil) | 210 (setq buffer-read-only nil) |
197 (erase-buffer) | 211 (erase-buffer) |