From d64478da0b0676f77831ca332ccb6a88c4b5e319 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Thu, 4 Dec 1997 05:49:21 +0000 Subject: [PATCH] (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'. --- lisp/cus-edit.el | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index e06207c53b7..cac6684cbbb 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1734,6 +1734,12 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"." "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 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"." :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 @@ Otherwise, look up symbol in `custom-guess-type-alist'." (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 @@ Match frames with dark backgrounds.") "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 @@ Match frames with dark backgrounds.") :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 @@ Match frames with dark backgrounds.") (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) -- 2.39.2