/[emacs]/emacs/lisp/custom.el
ViewVC logotype

Diff of /emacs/lisp/custom.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.51 by miles, Fri Apr 19 07:42:31 2002 UTC revision 1.52 by rms, Sun Apr 28 03:23:52 2002 UTC
# Line 457  LOAD should be either a library file nam Line 457  LOAD should be either a library file nam
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

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26