bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: Customize creating wrong defaults]


From: Per Abrahamsen
Subject: Re: address@hidden: Customize creating wrong defaults]
Date: Tue, 01 Oct 2002 12:25:57 +0200
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.1 (sparc-sun-solaris2.8)

Use this definition instead:

(defcustom test '((0 . "abc"))
  "xxx"
  :type '(repeat (choice :value "" 
                         (cons :value (0 . "") integer string) 
                         string)))

Explanation:

| Whenever a customize type can be created dynamically, it need to
| have a valid :value attribute to initialize it with.
| 
| Customize typess can be created dynamically if they occur inside a
| 'repeat' or 'choice' type.
| 
| Most atomic types already have valid values, for example the
| `integer' widget had the default :value 0, and the string widget has
| the default
| :value "".
| 
| However, combined types like choice or cons do not have a :value
| that is always valid, it depend on their subtypes.  Therefore, you
| have to specify a valid initial value yourself.

This is a very common error, perhaps the most common error when
creating customize types.  It really should be explained better in the
manual.  Anyone have a suggestion of where and how?

Richard Stallman <address@hidden> writes:

> This seems ot be in the heart of Custom.  Would you please look at it?
>
> From: Jens Schmidt <address@hidden>
> Subject: Customize creating wrong defaults
> To: address@hidden
> Date: 30 Sep 2002 12:44:26 +0100
>
> This bug report will be sent to the Free Software Foundation,
> not to your local site managers!
> Please write in English, because the Emacs maintainers do not have
> translators to read other languages for them.
>
> Your bug report will be posted to the address@hidden mailing list,
> and to the gnu.emacs.bug news group.
>
> In GNU Emacs 21.1.1 (i386-msvc-nt4.0.1381)
>  of 2001-10-22 on buffy
> configured using `configure --with-msvc (12.00)'
> Important settings:
>   value of $LC_ALL: nil
>   value of $LC_COLLATE: nil
>   value of $LC_CTYPE: nil
>   value of $LC_MESSAGES: nil
>   value of $LC_MONETARY: nil
>   value of $LC_NUMERIC: nil
>   value of $LC_TIME: nil
>   value of $LANG: ENU
>   locale-coding-system: iso-latin-1
>   default-enable-multibyte-characters: t
>
> Please describe exactly what actions triggered the bug
> and the precise symptoms of the bug:
>
>
> Eval the following defcustom in an emacs -q:
>
> (defcustom test '((0 . "abc"))
>   "xxx"
>   :type '(repeat (choice (cons integer string) string)))
>
> Then do a M-x customize-variable test RET and press the lower INS
> button.  The result should look like that (note the "invalid"
> list item):
>
> Test: Hide
> INS DEL Choice: Value Menu Cons-cell:
>             Integer: 0
>             String: abc
> INS DEL Choice: Value Menu invalid ((0 ))
> INS
>    State: you have edited the value as text, but you have not set the option.
> xxx
>
>
>
> _______________________________________________
> Bug-gnu-emacs mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs
> ----------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]