Function: custom-face-edit-value-create

custom-face-edit-value-create is a byte-compiled function defined in cus-edit.el.gz.

Signature

(custom-face-edit-value-create WIDGET)

Source Code

;; Defined in /usr/src/emacs/lisp/cus-edit.el.gz
(defun custom-face-edit-value-create (widget)
  (let* ((alist (widget-checklist-match-find
		 widget (widget-get widget :value)))
	 (args  (widget-get widget :args))
	 (show-all (widget-get widget :show-all-attributes))
	 (buttons  (widget-get widget :buttons))
	 (defaults (widget-checklist-match-find
		    widget
		    (widget-get widget :default-face-attributes)))
	 entry)
    (unless (looking-back "^ *" (line-beginning-position))
      (insert ?\n))
    (insert-char ?\s (widget-get widget :extra-offset))
    (if (or alist defaults show-all)
	(dolist (prop args)
	  (setq entry (or (assq prop alist)
			  (assq prop defaults)))
	  (if (or entry show-all)
	      (widget-checklist-add-item widget prop entry)))
      (insert (propertize "-- Empty face --" 'face 'shadow) ?\n))
    (let ((indent (widget-get widget :indent)))
      (if indent (insert-char ?\s (widget-get widget :indent))))
    (push (widget-create-child-and-convert
	   widget 'visibility
	   :help-echo "Show or hide all face attributes."
	   :button-face 'custom-visibility
	   :pressed-face 'custom-visibility
	   :mouse-face 'highlight
	   :on "Hide Unused Attributes"    :off "Show All Attributes"
	   :on-glyph nil :off-glyph nil
	   :always-active t
	   :action 'custom-face-edit-value-visibility-action
	   show-all)
	  buttons)
    (insert ?\n)
    (widget-put widget :buttons buttons)
    (widget-put widget :children (nreverse (widget-get widget :children)))))