Subject: bug#12670: closed (Re: bug#12670: 24.2.50; Uncustomizable defcustom)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 07 Jan 2013 11:27:07 +0000

Your bug report

#12670: 24.2.50; Uncustomizable defcustom

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
12670: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12670
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#12670: 24.2.50; Uncustomizable defcustom
From: Katsumi Yamaoka <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Mon, 07 Jan 2013 20:25:49 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

Chong Yidong wrote:
> Ah, OK.  Looks fine to me, please go ahead and commit to trunk.

Thanks.  Done.

Subject: 24.2.50; Uncustomizable defcustom
From: Katsumi Yamaoka <[email-masked]>
To: [email-masked]
Date: Thu, 18 Oct 2012 18:33:25 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

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)