diff options
| -rw-r--r-- | lisp/cus-edit.el | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index eb7fe0472a5..c1b69d5f006 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -3753,60 +3753,6 @@ or (if there were none) at the end of the buffer." | |||
| 3753 | (let ((file-precious-flag t)) | 3753 | (let ((file-precious-flag t)) |
| 3754 | (save-buffer))))) | 3754 | (save-buffer))))) |
| 3755 | 3755 | ||
| 3756 | ;;;###autoload | ||
| 3757 | (defun customize-mark-to-save (symbol) | ||
| 3758 | "Mark SYMBOL for later saving. | ||
| 3759 | |||
| 3760 | If the default value of SYMBOL is different from the standard value, | ||
| 3761 | set the `saved-value' property to a list whose car evaluates to the | ||
| 3762 | default value. Otherwise, set it til nil. | ||
| 3763 | |||
| 3764 | To actually save the value, call `custom-save-all'. | ||
| 3765 | |||
| 3766 | Return non-nil iff the `saved-value' property actually changed." | ||
| 3767 | (let* ((get (or (get symbol 'custom-get) 'default-value)) | ||
| 3768 | (value (funcall get symbol)) | ||
| 3769 | (saved (get symbol 'saved-value)) | ||
| 3770 | (standard (get symbol 'standard-value)) | ||
| 3771 | (comment (get symbol 'customized-variable-comment))) | ||
| 3772 | ;; Save default value iff different from standard value. | ||
| 3773 | (if (or (null standard) | ||
| 3774 | (not (equal value (condition-case nil | ||
| 3775 | (eval (car standard)) | ||
| 3776 | (error nil))))) | ||
| 3777 | (put symbol 'saved-value (list (custom-quote value))) | ||
| 3778 | (put symbol 'saved-value nil)) | ||
| 3779 | ;; Clear customized information (set, but not saved). | ||
| 3780 | (put symbol 'customized-value nil) | ||
| 3781 | ;; Save any comment that might have been set. | ||
| 3782 | (when comment | ||
| 3783 | (put symbol 'saved-variable-comment comment)) | ||
| 3784 | (not (equal saved (get symbol 'saved-value))))) | ||
| 3785 | |||
| 3786 | ;;;###autoload | ||
| 3787 | (defun customize-mark-as-set (symbol) | ||
| 3788 | "Mark current value of SYMBOL as being set from customize. | ||
| 3789 | |||
| 3790 | If the default value of SYMBOL is different from the saved value if any, | ||
| 3791 | or else if it is different from the standard value, set the | ||
| 3792 | `customized-value' property to a list whose car evaluates to the | ||
| 3793 | default value. Otherwise, set it til nil. | ||
| 3794 | |||
| 3795 | Return non-nil iff the `customized-value' property actually changed." | ||
| 3796 | (let* ((get (or (get symbol 'custom-get) 'default-value)) | ||
| 3797 | (value (funcall get symbol)) | ||
| 3798 | (customized (get symbol 'customized-value)) | ||
| 3799 | (old (or (get symbol 'saved-value) (get symbol 'standard-value)))) | ||
| 3800 | ;; Mark default value as set iff different from old value. | ||
| 3801 | (if (or (null old) | ||
| 3802 | (not (equal value (condition-case nil | ||
| 3803 | (eval (car old)) | ||
| 3804 | (error nil))))) | ||
| 3805 | (put symbol 'customized-value (list (custom-quote value))) | ||
| 3806 | (put symbol 'customized-value nil)) | ||
| 3807 | ;; Changed? | ||
| 3808 | (not (equal customized (get symbol 'customized-value))))) | ||
| 3809 | |||
| 3810 | ;;; The Customize Menu. | 3756 | ;;; The Customize Menu. |
| 3811 | 3757 | ||
| 3812 | ;;; Menu support | 3758 | ;;; Menu support |