Subject: bug#12670: 24.2.50; Uncustomizable defcustom

From: Katsumi Yamaoka <[email-masked]>
Date: Thu, 18 Oct 2012 18:33:25 +0900

Hi,

I realized that a certain defcustom form is unable to customize
a user option.  To reproduce this, evaluate the following form,
perform M-x customize-option, and press the [INS] button.

(defcustom foo nil
  "Doc"
  :type '(repeat (group (group :inline t (choice string function)))))

Then you will find a funny thing there and see it is unable to
edit.  After some investigations I found this is due to
`widget-default-get', that fails to get the default value of
components within an inlined form (I mean (bar :inline t ...)).

A patch is attached, not tested with all sorts of defcustom
forms though.

--- wid-edit.el~	2012-04-22 21:52:01.618551000 +0000
+++ wid-edit.el	2012-10-18 09:27:17.158803700 +0000
@@ -525,9 +525,18 @@
 (defun widget-default-get (widget)
   "Extract the default external value of WIDGET."
   (widget-apply widget :value-to-external
 		(or (widget-get widget :value)
-		    (widget-apply widget :default-get))))
+		    (progn
+		      (when (widget-get widget :args)
+			(let (args)
+			  (dolist (arg (widget-get widget :args))
+			    (setq args (append args
+					       (if (widget-get arg :inline)
+						   (widget-get arg :args)
+						 (list arg)))))
+			  (widget-put widget :args args)))
+		      (widget-apply widget :default-get)))))
 
 (defun widget-match-inline (widget vals)
   "In WIDGET, match the start of VALS."
   (cond ((widget-get widget :inline)