diff lisp/lib-complete.el @ 531:0493e9f3c27f

[xemacs-hg @ 2001-05-12 11:16:12 by ben] event-msw.c: eliminate cygwin warnings. dired.c, syswindows.h, win32.c: find the Net* functions the hard way to avoid errors on win 9x. find-paths.el: fix error with null EXCLUDE-REGEXP. font-lock.el: fix problem reported by hrvoje with buffers starting with a space. lib-complete.el: add a variable to control where `find-library' looks, analogous to `find-function-source-path'. etags.c: new version from Francesco. Makefile.in.in: i'm getting real tired of incomplete commits. is this getting worse or something?
author ben
date Sat, 12 May 2001 11:16:25 +0000
parents 7039e6323819
children 943eaba38521
line wrap: on
line diff
--- a/lisp/lib-complete.el	Fri May 11 05:49:46 2001 +0000
+++ b/lisp/lib-complete.el	Sat May 12 11:16:25 2001 +0000
@@ -295,6 +295,21 @@
 
 ;;=== find-library with completion (Author: Bob Weiner) ===================
 
+(defcustom find-library-source-path nil
+  "The default list of directories where find-library searches.
+
+If this variable is `nil' then find-library searches `load-path' by
+default.
+
+A good way to set this variable is like this:
+
+\(setq find-library-source-path
+  (paths-find-recursive-load-path
+    (list lisp-directory \"/src/xemacs/xemacs-packages-src/\")))
+"
+  :type '(repeat directory)
+  :group 'find-function)
+
 (defun find-library (library &optional codesys display-function)
   "Find and display in the current window the source for the Elisp LIBRARY.
 LIBRARY should be a name without any path information and may include or omit
@@ -302,14 +317,17 @@
 specifies the coding system to use when decoding the file.  Interactively,
 with a prefix argument, this prompts for the coding system.  Optional third
 argument DISPLAY-FUNCTION must take two arguments, the filename to display
-and CODESYS.  The default for DISPLAY-FUNCTION is `find-file'."
+and CODESYS.  The default for DISPLAY-FUNCTION is `find-file'.
+
+This function searches `find-library-source-path' to find the library;
+if this is nil (the default), then `load-path' is searched."
   (interactive 
    (list (read-library-name "Find library: ")
 	 (if current-prefix-arg
 	     (read-coding-system "Coding System: "))))
   (let ((path (if (or (null library) (equal library ""))
 		   nil
-		(locate-file library load-path
+		(locate-file library (or find-library-source-path load-path)
 			     ;; decompression doesn't work with Mule -slb
 			     (if (featurep 'mule)
 				 ":.el:.elc"