diff lisp/lib-complete.el @ 1123:37bdd24225ef

[xemacs-hg @ 2002-11-27 07:15:02 by ben] bug fixes, profiling debugging improvements configure.in: Check for GCC version and only use -Wpacked in v3. .cvsignore: Add .idb, .ilk for MS Windows VC++. cl-macs.el: Document better. cmdloop.el: Removed. Remove nonworking breakpoint-on-error now that debug-on-error works as documented. help.el: Extract out with-displaying-help-buffer into a more general mechanism. lib-complete.el: Support thunks in find-library-source-path. startup.el: Don't catch errors when noninteractive, because that makes stack traces from stack-trace-on-error useless. .cvsignore: Windows shit. alloc.c: Better redisplay-related assert. elhash.c: Comment change. eval.c: Don't generate large warning strings (e.g. backtraces) when they will be discarded. Implement debug-on-error as documented -- it will enter the debugger and crash when an uncaught signal happens noninteractively and we are --debug. Better redisplay-related asserts. frame-msw.c, frame.c, lisp.h, redisplay.c, scrollbar-gtk.c, scrollbar-x.c, signal.c, sysdep.c: Fix up documentation related to QUIT (which CANNOT garbage-collect under any circumstances), and to redisplay critical sections. lread.c: Add load-ignore-out-of-date-elc-files, load-always-display-messages, load-show-full-path-in-messages for more robust package compilation and debugging. profile.c: Overhaul profile code. Change format to include call count and be extensible for further info. Remove call-count-profile-table. Add set-profiling-info. See related profile.el changes (which SHOULD ABSOLUTELY be in the core! Get rid of xemacs-devel and xemacs-base packages *yesterday*!).
author ben
date Wed, 27 Nov 2002 07:15:36 +0000
parents c1e8977783ed
children 308d34e9f07d
line wrap: on
line diff
--- a/lisp/lib-complete.el	Tue Nov 26 22:52:59 2002 +0000
+++ b/lisp/lib-complete.el	Wed Nov 27 07:15:36 2002 +0000
@@ -1,7 +1,8 @@
 ;;; lib-complete.el --- Completion on the lisp search path
 
 ;; Copyright (C) 1997 Free Software Foundation, Inc.
-;; Copyright (C) Mike Williams <mike-w@cs.aukuni.ac.nz> 1991
+;; Copyright (C) 1991 Mike Williams <mike-w@cs.aukuni.ac.nz>.
+;; Copyright (C) 2002 Ben Wing.
 
 ;; Author: Mike Williams <mike-w@cs.aukuni.ac.nz>
 ;; Maintainer: XEmacs Development Team
@@ -31,28 +32,9 @@
 
 ;; This file is dumped with XEmacs.
 
-;; ========================================================================
-;; lib-complete.el --  Completion on a search path
-;; Author          : Mike Williams <mike-w@cs.aukuni.ac.nz>
-;; Created On      : Sat Apr 20 17:47:21 1991
-;; Last Modified By: Heiko M|nkel <muenkel@tnt.uni-hannover.de>
-;; Additional XEmacs integration By: Chuck Thompson <cthomp@cs.uiuc.edu>
-;; Last Modified On: Thu Jul 1 14:23:00 1994
-;; ========================================================================
-;; NOTE: XEmacs must be redumped if this file is changed.
-;;
-;; Copyright (C) Mike Williams <mike-w@cs.aukuni.ac.nz> 1991
-;;
-;; Keywords: utility, lisp
-
 ;; Many thanks to Hallvard Furuseth <hallvard@ifi.uio.no> for his
 ;; helpful suggestions.
 
-;; The function locate-file is removed, because of its incompatibility
-;; with the buildin function of the lemacs 19.10 (Heiko M|nkel).
-
-;; There is now the new function find-library in this package.
-
 ;;; ChangeLog:
 
 ;; 4/26/97: sb Mule-ize.
@@ -295,17 +277,23 @@
 
 ;;=== find-library with completion (Author: Bob Weiner) ===================
 
+;; should be called find-lisp-source-path!
 (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.
 
+If this is set to a function, it will be called the first time this value
+is needed, to compute the actual list, which will then be substituted into
+the variable.
+
 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/\")))
+  #'(lambda ()
+     (paths-find-recursive-load-path
+      (list lisp-directory \"/src/xemacs/xemacs-packages-src/\"))))
 "
   :type '(repeat directory)
   :group 'find-function)
@@ -327,6 +315,11 @@
 	     (read-coding-system "Coding System: "))))
   (let ((path (if (or (null library) (equal library ""))
 		   nil
+		(when (functionp find-library-source-path)
+		  (message "Computing find-library-source-path...")
+		  (setq find-library-source-path
+			(funcall find-library-source-path))
+		  (message "Computing find-library-source-path... done."))
 		(locate-file library (or find-library-source-path load-path)
 			       ":.el:.el.gz:.el.Z:.elc"))))
     (if path (funcall (if (fboundp display-function)