457 |
(unless (member load loads) |
(unless (member load loads) |
458 |
(put symbol 'custom-loads (cons (purecopy load) loads))))) |
(put symbol 'custom-loads (cons (purecopy load) loads))))) |
459 |
|
|
460 |
|
;;; Loading files needed to customize a symbol. |
461 |
|
;;; This is in custom.el because menu-bar.el needs it for toggle cmds. |
462 |
|
|
463 |
|
(defvar custom-load-recursion nil |
464 |
|
"Hack to avoid recursive dependencies.") |
465 |
|
|
466 |
|
(defun custom-load-symbol (symbol) |
467 |
|
"Load all dependencies for SYMBOL." |
468 |
|
(unless custom-load-recursion |
469 |
|
(let ((custom-load-recursion t) |
470 |
|
(loads (get symbol 'custom-loads)) |
471 |
|
load) |
472 |
|
(while loads |
473 |
|
(setq load (car loads) |
474 |
|
loads (cdr loads)) |
475 |
|
(cond ((symbolp load) |
476 |
|
(condition-case nil |
477 |
|
(require load) |
478 |
|
(error nil))) |
479 |
|
;; Don't reload a file already loaded. |
480 |
|
((and (boundp 'preloaded-file-list) |
481 |
|
(member load preloaded-file-list))) |
482 |
|
((assoc load load-history)) |
483 |
|
;; This was just (assoc (locate-library load) load-history) |
484 |
|
;; but has been optimized not to load locate-library |
485 |
|
;; if not necessary. |
486 |
|
((let (found (regexp (regexp-quote load))) |
487 |
|
(dolist (loaded load-history) |
488 |
|
(and (string-match regexp (car loaded)) |
489 |
|
(eq (locate-library load) (car loaded)) |
490 |
|
(setq found t))) |
491 |
|
found)) |
492 |
|
;; Without this, we would load cus-edit recursively. |
493 |
|
;; We are still loading it when we call this, |
494 |
|
;; and it is not in load-history yet. |
495 |
|
((equal load "cus-edit")) |
496 |
|
(t |
497 |
|
(condition-case nil |
498 |
|
(load-library load) |
499 |
|
(error nil)))))))) |
500 |
|
|
501 |
;;; Initializing. |
;;; Initializing. |
502 |
|
|
503 |
(defvar custom-local-buffer nil |
(defvar custom-local-buffer nil |