diff lisp/cus-edit.el @ 111018:de901820e0bc

Allow Custom settings to be migrated into a custom theme. * cus-theme.el (custom-theme--migrate-settings): New var. (customize-create-theme): Allow editing the `user' theme. (custom-theme-add-variable, custom-theme-add-var-1) (custom-theme-add-face, custom-theme-add-face-1): Add a checkbox to the front of each variable or face widget. (custom-theme-write): Save theme settings in the correct order. Optionally, remove saved settings from user customizations. (custom-theme-write-variables, custom-theme-write-faces): Saved only the checked widgets. (customize-themes): Add a link for migrating custom settings. * custom.el (custom-declare-theme, provide-theme): Use custom-theme-name-valid-p. (custom-theme-name-valid-p): Remove checks that are now unnecessary since themes no longer obey load-path. * cus-edit.el (custom-variable-value-create): For the simple style, hide documentation string when hidden.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 16 Oct 2010 20:00:34 -0400
parents 9506df1b7b65
children c00190a8c8ef
line wrap: on
line diff
--- a/lisp/cus-edit.el	Sat Oct 16 16:36:20 2010 -0400
+++ b/lisp/cus-edit.el	Sat Oct 16 20:00:34 2010 -0400
@@ -2520,6 +2520,7 @@
 	 (get (or (get symbol 'custom-get) 'default-value))
 	 (prefix (widget-get widget :custom-prefix))
 	 (last (widget-get widget :custom-last))
+	 (style (widget-get widget :custom-style))
 	 (value (let ((shown-value (widget-get widget :shown-value)))
 		  (cond (shown-value
 			 (car shown-value))
@@ -2633,7 +2634,7 @@
       (unless (eq (preceding-char) ?\n)
 	(widget-insert "\n"))
       ;; Create the magic button.
-      (unless (eq (widget-get widget :custom-style) 'simple)
+      (unless (eq style 'simple)
 	(let ((magic (widget-create-child-and-convert
 		      widget 'custom-magic nil)))
 	  (widget-put widget :custom-magic magic)
@@ -2641,8 +2642,10 @@
       (widget-put widget :buttons buttons)
       ;; Insert documentation.
       (widget-put widget :documentation-indent 3)
-      (widget-add-documentation-string-button
-       widget :visibility-widget 'custom-visibility)
+      (unless (and (eq style 'simple)
+		   (eq state 'hidden))
+	(widget-add-documentation-string-button
+	 widget :visibility-widget 'custom-visibility))
 
       ;; The comment field
       (unless (eq state 'hidden)