emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/find-func.el, v [EMACS_22


From: Vinicius Jose Latorre
Subject: [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/find-func.el, v [EMACS_22_BASE]
Date: Wed, 31 Oct 2007 12:46:31 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Branch:         EMACS_22_BASE
Changes by:     Vinicius Jose Latorre <viniciusjl>      07/10/31 12:46:30

Index: emacs-lisp/find-func.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/find-func.el,v
retrieving revision 1.80.2.1
retrieving revision 1.80.2.2
diff -u -b -r1.80.2.1 -r1.80.2.2
--- emacs-lisp/find-func.el     25 Jul 2007 04:09:45 -0000      1.80.2.1
+++ emacs-lisp/find-func.el     31 Oct 2007 12:46:29 -0000      1.80.2.2
@@ -194,11 +194,21 @@
 (defun find-library (library)
   "Find the elisp source of LIBRARY."
   (interactive
+   (let* ((path (cons (or find-function-source-path load-path)
+                     (find-library-suffixes)))
+         (def (if (eq (function-called-at-point) 'require)
+                  (save-excursion
+                    (backward-up-list)
+                    (forward-char)
+                    (backward-sexp -2)
+                    (thing-at-point 'symbol))
+                (thing-at-point 'symbol))))
+     (when def
+       (setq def (and (locate-file-completion def path 'test) def)))
    (list
-    (completing-read "Library name: "
-                    'locate-file-completion
-                    (cons (or find-function-source-path load-path)
-                          (find-library-suffixes)))))
+      (completing-read (if def (format "Library name (default %s): " def)
+                        "Library name: ")
+                      'locate-file-completion path nil nil nil def))))
   (let ((buf (find-file-noselect (find-library-name library))))
     (condition-case nil (switch-to-buffer buf) (error (pop-to-buffer buf)))))
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]