diff options
Diffstat (limited to 'lisp/cus-edit.el')
| -rw-r--r-- | lisp/cus-edit.el | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 65aa085c0ef..2f037bfe45e 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1832,14 +1832,22 @@ and `face'." ((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) |
