aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/cus-edit.el
diff options
context:
space:
mode:
authorChong Yidong <[email protected]>2006-01-02 15:11:14 +0000
committerChong Yidong <[email protected]>2006-01-02 15:11:14 +0000
commitd358aa106d66961f4750337f3a5b3048a44e4069 (patch)
tree8e09f5c41477f0e872d3fc621436646b76c21e21 /lisp/cus-edit.el
parent55262b16df717fe533ea4ad23dac3f02398c9055 (diff)
* custom.el: Move Custom Themes commentary to start of theme code.
(custom-known-themes): Rename `standard' theme to `changed'. (custom-push-theme): Caller no longer specifies what theme to use when doing `reset'---the setting is simply removed from the theme. Delete MODE from `theme-value' and `theme-settings' properties. (custom-declare-theme): Ignore &rest args since we don't use them. (custom-loaded-themes): Delete variable. (custom-theme-load-themes, custom-theme-loaded-p) (custom-theme-value): Delete functions. (custom-declare-theme): Signal error on invalid theme names. (provide-theme): custom-loaded-themes was deleted. (load-theme): Load the file unconditionally. (enable-theme): Call `load-theme' if theme is undefined. (custom-enabled-themes): Only update value for successful loads. (disable-theme): Complete from enabled themes when interactive. (custom-variable-theme-value): Calculate theme value directly. (custom-theme-reset-variables, custom-reset-variables): Mark as XEmacs compatibility functions. We don't actually use these. * cus-edit.el (custom-variable-state-set): Use custom-variable-theme-value instead of custom-theme-value. (custom-face-state-set): Rename `standard' theme to `changed'. (custom-save-variables, custom-save-faces): Delete unneeded references to custom-reset-variables. (custom-save-resets): Delete function. (custom-save-variables, custom-save-faces): MODE argument deleted. (custom-save-variables, custom-save-faces): Ignore theme values. * cus-face.el (custom-theme-reset-faces): Mark as XEmacs compatibility function.
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r--lisp/cus-edit.el67
1 files changed, 16 insertions, 51 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 4c92034eaa..5e9c98c725 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -2578,15 +2578,13 @@ Otherwise, look up symbol in `custom-guess-type-alist'."
(if (condition-case nil
(and (equal comment temp)
(equal value
- (eval (car
- (custom-theme-value
- (caar tmp) tmp)))))
+ (eval
+ (car (custom-variable-theme-value
+ symbol)))))
(error nil))
(cond
- ((eq 'user (caar (get symbol 'theme-value)))
- 'saved)
- ((eq 'standard (caar (get symbol 'theme-value)))
- 'changed)
+ ((eq (caar tmp) 'user) 'saved)
+ ((eq (caar tmp) 'changed) 'changed)
(t 'themed))
'changed))
((setq tmp (get symbol 'standard-value))
@@ -2772,7 +2770,7 @@ becomes the backup value, so you can get it again."
(cond ((or value comment)
(put symbol 'variable-comment comment)
(custom-variable-backup-value widget)
- (custom-push-theme 'theme-value symbol 'user 'set value)
+ (custom-push-theme 'theme-value symbol 'user 'set (car-safe value))
(condition-case nil
(funcall set symbol (eval (car value)))
(error nil)))
@@ -2790,15 +2788,14 @@ This operation eliminates any saved setting for the variable,
restoring it to the state of a variable that has never been customized.
The value that was current before this operation
becomes the backup value, so you can get it again."
- (let* ((symbol (widget-value widget))
- (set (or (get symbol 'custom-set) 'set-default)))
+ (let* ((symbol (widget-value widget)))
(if (get symbol 'standard-value)
(custom-variable-backup-value widget)
(error "No standard setting known for %S" symbol))
(put symbol 'variable-comment nil)
(put symbol 'customized-value nil)
(put symbol 'customized-variable-comment nil)
- (custom-push-theme 'theme-value symbol 'user 'reset nil)
+ (custom-push-theme 'theme-value symbol 'user 'reset)
(custom-theme-recalc-variable symbol)
(when (or (get symbol 'saved-value) (get symbol 'saved-variable-comment))
(put symbol 'saved-value nil)
@@ -3345,7 +3342,7 @@ widget. If FILTER is nil, ACTION is always valid.")
(cond
((eq 'user (caar (get symbol 'theme-face)))
'saved)
- ((eq 'standard (caar (get symbol 'theme-face)))
+ ((eq 'changed (caar (get symbol 'theme-face)))
'changed)
(t 'themed))
'changed))
@@ -3467,7 +3464,7 @@ restoring it to the state of a face that has never been customized."
(error "No standard setting for this face"))
(put symbol 'customized-face nil)
(put symbol 'customized-face-comment nil)
- (custom-push-theme 'theme-face symbol 'user 'reset nil)
+ (custom-push-theme 'theme-face symbol 'user 'reset)
(custom-theme-recalc-face symbol)
(when (or (get symbol 'saved-face) (get symbol 'saved-face-comment))
(put symbol 'saved-face nil)
@@ -4123,16 +4120,15 @@ This function does not save the buffer."
(defun custom-save-variables ()
"Save all customized variables in `custom-file'."
(save-excursion
- (custom-save-delete 'custom-reset-variables)
(custom-save-delete 'custom-set-variables)
- (custom-save-resets 'theme-value 'custom-reset-variables nil)
(let ((standard-output (current-buffer))
(saved-list (make-list 1 0))
sort-fold-case)
;; First create a sorted list of saved variables.
(mapatoms
(lambda (symbol)
- (if (get symbol 'saved-value)
+ (if (and (get symbol 'saved-value)
+ (eq 'user (car (car-safe (get symbol 'theme-value)))))
(nconc saved-list (list symbol)))))
(setq saved-list (sort (cdr saved-list) 'string<))
(unless (bolp)
@@ -4156,9 +4152,7 @@ This function does not save the buffer."
(when (and (symbolp request) (not (featurep request)))
(message "Unknown requested feature: %s" request)
(setq requests (delq request requests))))
- (when (or (and spec
- (eq (nth 0 spec) 'user)
- (eq (nth 1 spec) 'set))
+ (when (or (and spec (eq (car spec) 'user))
comment
(and (null spec) (get symbol 'saved-value)))
(unless (bolp)
@@ -4183,46 +4177,19 @@ This function does not save the buffer."
(unless (looking-at "\n")
(princ "\n")))))
-(defun custom-save-resets (property setter special)
- (let (started-writing ignored-special)
- ;; (custom-save-delete setter) Done by caller
- (let ((standard-output (current-buffer))
- (mapper `(lambda (object)
- (let ((spec (car-safe (get object (quote ,property)))))
- (when (and (not (memq object ignored-special))
- (eq (nth 0 spec) 'user)
- (eq (nth 1 spec) 'reset))
- ;; Do not write reset statements unless necessary.
- (unless started-writing
- (setq started-writing t)
- (unless (bolp)
- (princ "\n"))
- (princ "(")
- (princ (quote ,setter))
- (princ "\n '(")
- (prin1 object)
- (princ " ")
- (prin1 (nth 3 spec))
- (princ ")")))))))
- (mapc mapper special)
- (setq ignored-special special)
- (mapatoms mapper)
- (when started-writing
- (princ ")\n")))))
-
(defun custom-save-faces ()
"Save all customized faces in `custom-file'."
(save-excursion
(custom-save-delete 'custom-reset-faces)
(custom-save-delete 'custom-set-faces)
- (custom-save-resets 'theme-face 'custom-reset-faces '(default))
(let ((standard-output (current-buffer))
(saved-list (make-list 1 0))
sort-fold-case)
;; First create a sorted list of saved faces.
(mapatoms
(lambda (symbol)
- (if (get symbol 'saved-face)
+ (if (and (get symbol 'saved-face)
+ (eq 'user (car (car-safe (get symbol 'theme-face)))))
(nconc saved-list (list symbol)))))
(setq saved-list (sort (cdr saved-list) 'string<))
;; The default face must be first, since it affects the others.
@@ -4242,9 +4209,7 @@ This function does not save the buffer."
(and (not (custom-facep symbol))
(not (get symbol 'force-face))))))
(comment (get symbol 'saved-face-comment)))
- (when (or (and spec
- (eq (nth 0 spec) 'user)
- (eq (nth 1 spec) 'set))
+ (when (or (and spec (eq (nth 0 spec) 'user))
comment
(and (null spec) (get symbol 'saved-face)))
;; Don't print default face here.