[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
customize: bug with "(choice (list (set ...)))"
From: |
Reiner Steib |
Subject: |
customize: bug with "(choice (list (set ...)))" |
Date: |
Thu, 03 Mar 2005 23:25:38 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Hi,
I'm trying to create a defcustom for a variable that can either be a
function or a list of strings. For convenience I'd like to provide
possible choices for those strings check-boxes. The declaration I
tried, see (1) below, doesn't work (maybe I'm doing something wrong?).
Neither in current CVS nor in Emacs 21.4.
Here are the steps to reproduce:
(1) Create a file /tmp/cus-test.el:
--8<---------------cut here---------------start------------->8---
(defcustom my-test 'foo-bar
"Foo bar"
:group 'LaTeX-macro
:type '(choice (const :tag "TeX search" foo-bar)
(function :tag "Other function")
(list (set :inline t
(const "Antibes")
(const "Warsaw"))
(repeat :inline t
:tag "Other"
(string)))))
(customize-variable 'my-test)
--8<---------------cut here---------------end--------------->8---
(2) emacs -q -no-site-file -l /tmp/cus-test.el
(3) Select "Value menu" -> "List":
,----
| My Test: [Hide Value] [Value Menu] invalid ((nil nil))
| State: EDITED, shown value does not take effect until you set or save it.
|
| Foo bar
| Parent groups: Latex Macro
`----
It doesn't offer the check-boxes as expected, see "invalid ((nil nil))".
But it works when I select it a second time:
(4) Select "Value menu" -> "List" again:
,----
| My Test: [Hide Value] [Value Menu] List:
| Set:
| [ ] Antibes
| [ ] Warsaw
| Other:
| INS
| State: EDITED, shown value does not take effect until you set or save it.
|
| Foo bar
| Parent groups: Latex Macro
`----
A simplified version without the "choice" part works correctly:
--8<---------------cut here---------------start------------->8---
(defcustom my-test-simple nil
"Foo bar"
:type '(list (set :inline t
(const "Antibes")
(const "Warsaw"))
(repeat :inline t
:tag "Other"
(string))))
--8<---------------cut here---------------end--------------->8---
,----
| my-test-simple: [Hide Value]
| Set:
| [ ] Antibes
| [ ] Warsaw
| Other:
| INS
| State: STANDARD.
`----
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
- customize: bug with "(choice (list (set ...)))",
Reiner Steib <=