changeset 41606:e694138746d6

(custom-load-symbol): Don't always load locate-library.
author Richard M. Stallman <rms@gnu.org>
date Tue, 27 Nov 2001 05:25:55 +0000
parents faa52db1ed51
children 58e03d744b9f
files lisp/cus-edit.el
diffstat 1 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/cus-edit.el	Tue Nov 27 05:04:13 2001 +0000
+++ b/lisp/cus-edit.el	Tue Nov 27 05:25:55 2001 +0000
@@ -1832,14 +1832,22 @@
 	      ((and (boundp 'preloaded-file-list)
 		    (member load preloaded-file-list)))
 	      ((assoc load load-history))
-	      ((assoc (locate-library load) load-history))
+	      ;; This was just (assoc (locate-library load) load-history)
+	      ;; but has been optimized not to load locate-library
+	      ;; if not necessary.
+	      ((let (found (regexp (regexp-quote load)))
+		 (dolist (loaded load-history)
+		   (and (string-match regexp (car loaded))
+			(eq (locate-library load) (car loaded))
+			(setq found t)))
+		 found))
+	      ;; Without this, we would load cus-edit recursively.
+	      ;; We are still loading it when we call this,
+	      ;; and it is not in load-history yet.
+	      ((equal load "cus-edit"))
 	      (t
 	       (condition-case nil
-		   ;; Without this, we would load cus-edit recursively.
-		   ;; We are still loading it when we call this,
-		   ;; and it is not in load-history yet.
-		   (or (equal load "cus-edit")
-		       (load-library load))
+		   (load-library load)
 		 (error nil))))))))
 
 (defun custom-load-widget (widget)