Subject: Re: bug#12670: 24.2.50; Uncustomizable defcustom

From: Katsumi Yamaoka <[email-masked]>
Date: Sat, 22 Dec 2012 22:35:51 +0900

Chong Yidong <[email-masked]> wrote:
> Katsumi Yamaoka <[email-masked]> writes:

>> 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.

> I can't reproduce this on Emacs 23.4, the emacs-24 branch, or trunk.
> After opening the customization buffer for `foo', I click on INS and it
> opens up

> INS DEL Choice: Value Menu invalid (nil)

> and clicking on "Value Menu" allows me to insert a function or string.

Oops, you're right.  I don't recall why I said it's uncustomisable,
but please let me rephrase it:
That defcustom form is unable to suggest a default value, that's
the one suitable to beginners for example, to a user.  Could you
try the following two examples?  Both behaviors should be the same.
And my patch solves it.

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