Show
Ignore:
Timestamp:
07/29/06 07:48:34 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/custom.el

    r4085 r4131  
    559559      (put symbol 'custom-loads (cons (purecopy load) loads))))) 
    560560 
    561 (defun custom-autoload (symbol load) 
    562   "Mark SYMBOL as autoloaded custom variable and add dependency LOAD." 
    563   (put symbol 'custom-autoload t) 
     561(defun custom-autoload (symbol load &optional noset) 
     562  "Mark SYMBOL as autoloaded custom variable and add dependency LOAD. 
     563If NOSET is non-nil, don't bother autoloading LOAD when setting the variable." 
     564  (put symbol 'custom-autoload (if noset 'noset t)) 
    564565  (custom-add-load symbol load)) 
    565566 
     
    700701         (old (or (get symbol 'saved-value) (get symbol 'standard-value)))) 
    701702    ;; Mark default value as set iff different from old value. 
    702     (if (or (null old) 
    703            (not (equal value (condition-case nil 
    704                                  (eval (car old)) 
    705                                (error nil))))) 
     703    (if (not (and old 
     704                  (equal value (condition-case nil 
     705                                   (eval (car old)) 
     706                                 (error nil))))) 
    706707        (progn (put symbol 'customized-value (list (custom-quote value))) 
    707708               (custom-push-theme 'theme-value symbol 'user 'set 
     
    828829                     (boundp symbol)) 
    829830                (let ((sv (get symbol 'standard-value))) 
    830                   (when (and (null sv) (custom-variable-p symbol)) 
    831                     (custom-load-symbol symbol) 
    832                     (setq sv (get symbol 'standard-value))) 
    833                   (if (or (null sv) 
    834                           (not (equal (eval (car (get symbol 'standard-value))) 
    835                                       (symbol-value symbol)))) 
    836                       (setq old (list (list 'changed (symbol-value symbol)))))) 
     831                  (unless (and sv 
     832                               (equal (eval (car sv)) (symbol-value symbol))) 
     833                    (setq old (list (list 'changed (symbol-value symbol)))))) 
    837834              (if (and (facep symbol) 
    838835                       (not (face-spec-match-p symbol (get symbol 'face-defface-spec)))) 
     
    908905              (put symbol 'custom-requests requests) 
    909906              (mapc 'require requests)) 
     907            (unless (or (get symbol 'standard-value) 
     908                        (memq (get symbol 'custom-autoload) '(nil noset))) 
     909              ;; This symbol needs to be autoloaded, even just for a `set'. 
     910              (custom-load-symbol symbol)) 
    910911            (setq set (or (get symbol 'custom-set) 'custom-set-default)) 
    911912            (put symbol 'saved-value (list value)) 
     
    927928            (and (or now (default-boundp symbol)) 
    928929                 (put symbol 'variable-comment comment))) 
     930        ;; I believe this is dead-code, because the `sort' code above would 
     931        ;; have burped before we could get here.  --Stef 
    929932        ;; Old format, a plist of SYMBOL VALUE pairs. 
    930933        (message "Warning: old format `custom-set-variables'")