[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/cus-edit.el
From: |
Per Abrahamsen |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/cus-edit.el |
Date: |
Mon, 11 Feb 2002 11:47:58 -0500 |
Index: emacs/lisp/cus-edit.el
diff -c emacs/lisp/cus-edit.el:1.143 emacs/lisp/cus-edit.el:1.144
*** emacs/lisp/cus-edit.el:1.143 Thu Feb 7 12:32:18 2002
--- emacs/lisp/cus-edit.el Mon Feb 11 11:47:55 2002
***************
*** 748,754 ****
;;;###autoload
(defun customize-set-value (var val &optional comment)
! "Set VARIABLE to VALUE. VALUE is a Lisp object.
If VARIABLE has a `variable-interactive' property, that is used as if
it were the arg to `interactive' (which see) to interactively read the value.
--- 748,754 ----
;;;###autoload
(defun customize-set-value (var val &optional comment)
! "Set VARIABLE to VALUE, and return VALUE. VALUE is a Lisp object.
If VARIABLE has a `variable-interactive' property, that is used as if
it were the arg to `interactive' (which see) to interactively read the value.
***************
*** 761,775 ****
"Set %s to value: "
current-prefix-arg))
- (set var val)
(cond ((string= comment "")
(put var 'variable-comment nil))
(comment
! (put var 'variable-comment comment))))
;;;###autoload
(defun customize-set-variable (variable value &optional comment)
! "Set the default for VARIABLE to VALUE. VALUE is a Lisp object.
If VARIABLE has a `custom-set' property, that is used for setting
VARIABLE, otherwise `set-default' is used.
--- 761,776 ----
"Set %s to value: "
current-prefix-arg))
(cond ((string= comment "")
(put var 'variable-comment nil))
(comment
! (put var 'variable-comment comment)))
! (set var val))
;;;###autoload
(defun customize-set-variable (variable value &optional comment)
! "Set the default for VARIABLE to VALUE, and return VALUE.
! VALUE is a Lisp object.
If VARIABLE has a `custom-set' property, that is used for setting
VARIABLE, otherwise `set-default' is used.
***************
*** 787,792 ****
--- 788,794 ----
(interactive (custom-prompt-variable "Set variable: "
"Set customized value for %s to: "
current-prefix-arg))
+ (custom-load-symbol variable)
(funcall (or (get variable 'custom-set) 'set-default) variable value)
(put variable 'customized-value (list (custom-quote value)))
(cond ((string= comment "")
***************
*** 794,804 ****
(put variable 'customized-variable-comment nil))
(comment
(put variable 'variable-comment comment)
! (put variable 'customized-variable-comment comment))))
;;;###autoload
(defun customize-save-variable (var value &optional comment)
"Set the default for VARIABLE to VALUE, and save it for future sessions.
If VARIABLE has a `custom-set' property, that is used for setting
VARIABLE, otherwise `set-default' is used.
--- 796,809 ----
(put variable 'customized-variable-comment nil))
(comment
(put variable 'variable-comment comment)
! (put variable 'customized-variable-comment comment)))
! value)
;;;###autoload
(defun customize-save-variable (var value &optional comment)
"Set the default for VARIABLE to VALUE, and save it for future sessions.
+ Return VALUE.
+
If VARIABLE has a `custom-set' property, that is used for setting
VARIABLE, otherwise `set-default' is used.
***************
*** 823,829 ****
(comment
(put var 'variable-comment comment)
(put var 'saved-variable-comment comment)))
! (custom-save-all))
;;;###autoload
(defun customize ()
--- 828,835 ----
(comment
(put var 'variable-comment comment)
(put var 'saved-variable-comment comment)))
! (custom-save-all)
! value)
;;;###autoload
(defun customize ()
***************
*** 1815,1820 ****
--- 1821,1827 ----
(defvar custom-load-recursion nil
"Hack to avoid recursive dependencies.")
+ ;;;###autoload
(defun custom-load-symbol (symbol)
"Load all dependencies for SYMBOL."
(unless custom-load-recursion
***************
*** 3750,3771 ****
"Mark SYMBOL for later saving.
If the default value of SYMBOL is different from the standard value,
! set the 'saved-value' property to a list whose car evaluates to the
default value. Otherwise, set it til nil.
! To actually save the value, call 'custom-save-all'.
! Return non-nil iff the 'saved-value' property actually changed."
(let* ((get (or (get symbol 'custom-get) 'default-value))
(value (funcall get symbol))
(saved (get symbol 'saved-value))
(standard (get symbol 'standard-value))
(comment (get symbol 'customized-variable-comment)))
;; Save default value iff different from standard value.
! (if (and standard
! (not (condition-case nil
! (equal value (eval (car standard)))
! (error nil))))
(put symbol 'saved-value (list (custom-quote value)))
(put symbol 'saved-value nil))
;; Clear customized information (set, but not saved).
--- 3757,3778 ----
"Mark SYMBOL for later saving.
If the default value of SYMBOL is different from the standard value,
! set the `saved-value' property to a list whose car evaluates to the
default value. Otherwise, set it til nil.
! To actually save the value, call `custom-save-all'.
! Return non-nil iff the `saved-value' property actually changed."
(let* ((get (or (get symbol 'custom-get) 'default-value))
(value (funcall get symbol))
(saved (get symbol 'saved-value))
(standard (get symbol 'standard-value))
(comment (get symbol 'customized-variable-comment)))
;; Save default value iff different from standard value.
! (if (or (null standard)
! (not (equal value (condition-case nil
! (eval (car standard))
! (error nil)))))
(put symbol 'saved-value (list (custom-quote value)))
(put symbol 'saved-value nil))
;; Clear customized information (set, but not saved).
***************
*** 3774,3779 ****
--- 3781,3810 ----
(when comment
(put symbol 'saved-variable-comment comment))
(not (equal saved (get symbol 'saved-value)))))
+
+ ;;;###autoload
+ (defun customize-mark-as-set (symbol)
+ "Mark current value of SYMBOL as being set from customize.
+
+ If the default value of SYMBOL is different from the saved value if any,
+ or else if it is different from the standard value, set the
+ `customized-value' property to a list whose car evaluates to the
+ default value. Otherwise, set it til nil.
+
+ Return non-nil iff the `customized-value' property actually changed."
+ (let* ((get (or (get symbol 'custom-get) 'default-value))
+ (value (funcall get symbol))
+ (customized (get symbol 'customized-value))
+ (old (or (get symbol 'saved-value) (get symbol 'standard-value))))
+ ;; Mark default value as set iff different from old value.
+ (if (or (null old)
+ (not (equal value (condition-case nil
+ (eval (car old))
+ (error nil)))))
+ (put symbol 'customized-value (list (custom-quote value)))
+ (put symbol 'customized-value nil))
+ ;; Changed?
+ (not (equal customized (get symbol 'customized-value)))))
;;; The Customize Menu.