aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/emacs-lisp/find-func.el20
2 files changed, 20 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ebd92a40033..7aa77756e45 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12007-10-31 Sean O'Rourke <sorourke@cs.ucsd.edu>
2
3 * emacs-lisp/find-func.el (find-library): use library at
4 point as default interactive argument.
5
12007-10-31 Juanma Barranquero <lekktu@gmail.com> 62007-10-31 Juanma Barranquero <lekktu@gmail.com>
2 7
3 * emacs-lisp/elp.el (elp-report-limit, elp-restore-all) 8 * emacs-lisp/elp.el (elp-report-limit, elp-restore-all)
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 6a259ffd4f7..ede196721ae 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -194,11 +194,21 @@ TYPE should be nil to find a function, or `defvar' to find a variable."
194(defun find-library (library) 194(defun find-library (library)
195 "Find the elisp source of LIBRARY." 195 "Find the elisp source of LIBRARY."
196 (interactive 196 (interactive
197 (list 197 (let* ((path (cons (or find-function-source-path load-path)
198 (completing-read "Library name: " 198 (find-library-suffixes)))
199 'locate-file-completion 199 (def (if (eq (function-called-at-point) 'require)
200 (cons (or find-function-source-path load-path) 200 (save-excursion
201 (find-library-suffixes))))) 201 (backward-up-list)
202 (forward-char)
203 (backward-sexp -2)
204 (thing-at-point 'symbol))
205 (thing-at-point 'symbol))))
206 (when def
207 (setq def (and (locate-file-completion def path 'test) def)))
208 (list
209 (completing-read (if def (format "Library name (default %s): " def)
210 "Library name: ")
211 'locate-file-completion path nil nil nil def))))
202 (let ((buf (find-file-noselect (find-library-name library)))) 212 (let ((buf (find-file-noselect (find-library-name library))))
203 (condition-case nil (switch-to-buffer buf) (error (pop-to-buffer buf))))) 213 (condition-case nil (switch-to-buffer buf) (error (pop-to-buffer buf)))))
204 214