changeset 20411:089ca3e66e6d

(custom-unlispify-remove-prefixes): Reference to related variables added. (custom-variable-default-form): New variable controlling default display form for customization of variables. (custom-variable): widget `:form' is nil before initialization. (custom-variable-value-create): Initialize `:form' to `custom-variable-default-form'. (custom-face-default-form): New variable controlling default display form for customization of faces. (custom-face): widget `:form' is nil before initialization. (custom-face-value-create): Initialize `:form' to `custom-face-default-form'.
author Karl Heuer <kwzh@gnu.org>
date Thu, 04 Dec 1997 05:49:21 +0000
parents af925352116e
children 31468445f518
files lisp/cus-edit.el
diffstat 1 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/cus-edit.el	Thu Dec 04 05:28:27 1997 +0000
+++ b/lisp/cus-edit.el	Thu Dec 04 05:49:21 1997 +0000
@@ -1734,6 +1734,12 @@
   "Face used for pushable variable tags."
   :group 'custom-faces)
 
+(defcustom custom-variable-default-form 'edit
+  "Default form of displaying variable values."
+  :type '(choice (const edit)
+		 (const lisp))
+  :group 'custom-buffer)
+
 (define-widget 'custom-variable 'custom
   "Customize variable."
   :format "%v"
@@ -1742,7 +1748,7 @@
   :custom-category 'option
   :custom-state nil
   :custom-menu 'custom-variable-menu-create
-  :custom-form 'edit
+  :custom-form nil ; defaults to value of `custom-variable-default-form'
   :value-create 'custom-variable-value-create
   :action 'custom-variable-action
   :custom-set 'custom-variable-set
@@ -1770,6 +1776,8 @@
 (defun custom-variable-value-create (widget)
   "Here is where you edit the variables value."
   (custom-load-widget widget)
+  (unless (widget-get widget :custom-form)
+    (widget-put widget :custom-form custom-variable-default-form))
   (let* ((buttons (widget-get widget :buttons))
 	 (children (widget-get widget :children))
 	 (form (widget-get widget :custom-form))
@@ -2170,6 +2178,13 @@
   "Face used for face tags."
   :group 'custom-faces)
 
+(defcustom custom-face-default-form 'selected
+  "Default form of displaying face definition."
+  :type '(choice (const all)
+		 (const selected)
+		 (const lisp))
+  :group 'custom-buffer)
+
 (define-widget 'custom-face 'custom
   "Customize face."
   :sample-face 'custom-face-tag-face
@@ -2179,7 +2194,7 @@
   :value-create 'custom-face-value-create
   :action 'custom-face-action
   :custom-category 'face
-  :custom-form 'selected
+  :custom-form nil ; defaults to value of `custom-face-default-form'
   :custom-set 'custom-face-set
   :custom-save 'custom-face-save
   :custom-reset-current 'custom-redraw
@@ -2283,6 +2298,8 @@
 	   (unless (eq state 'hidden)
 	     (message "Creating face editor...")
 	     (custom-load-widget widget)
+	     (unless (widget-get widget :custom-form)
+		 (widget-put widget :custom-form custom-face-default-form))
 	     (let* ((symbol (widget-value widget))
 		    (spec (or (get symbol 'saved-face)
 			      (get symbol 'face-defface-spec)