all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* defcustom: order matters in `choice' with value-to-internal
@ 2008-03-21 20:27 Reiner Steib
  2008-03-21 21:49 ` Andreas Schwab
  0 siblings, 1 reply; 6+ messages in thread
From: Reiner Steib @ 2008-03-21 20:27 UTC (permalink / raw)
  To: emacs-devel

Hi,

consider these two defcustoms, which only differ in the order of the
choice elements:

--8<---------------cut here---------------start------------->8---
(defcustom rs-test-1
  "^From:\\|^Newsgroups:\\|^Subject:"
  "doc string 1, list of regexps, regexp or nil"
  :type '(choice
	  (const nil :tag "Use gnus-ignored-headers")
	  regexp
	  (repeat :value-to-internal (lambda (widget value)
				       (custom-split-regexp-maybe value))
		  :match (lambda (widget value)
			   (or (stringp value)
			       (widget-editable-list-match widget value)))
		  regexp)))

(defcustom rs-test-2
  "^From:\\|^Newsgroups:\\|^Subject:"
  "doc string 2, list of regexps, regexp or nil"
  :type '(choice
	  (repeat :value-to-internal (lambda (widget value)
				       (custom-split-regexp-maybe value))
		  :match (lambda (widget value)
			   (or (stringp value)
			       (widget-editable-list-match widget value)))
		  regexp)
	  (const nil :tag "Use gnus-ignored-headers")
	  regexp))
--8<---------------cut here---------------end--------------->8---

In the customize buffer, I get (Emacs 22 branch):

,----[ M-x customize-apropos RET rs-test RET ]
| rs-test-1: [Hide Value] [Value Menu] Regexp: ^From:\|^Newsgroups:\|^Subject:
|    [State]: STANDARD.
| 
| doc string 1, list of regexps, regexp or nil
| Groups: [message-faces]
| 
| rs-test-2: [Hide Value] [Value Menu] Repeat:
| [INS] [DEL] Regexp: ^From:
| [INS] [DEL] Regexp: ^Newsgroups:
| [INS] [DEL] Regexp: ^Subject:
| [INS]
|    [State]: STANDARD.
| 
| doc string 2, list of regexps, regexp or nil
| Groups: [message-faces]
`----

I would have expected the same, split result for both variables.

(BTW, I have now idea why "Groups: [message-faces]" is shown.  Seems
like some random group?)

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-03-24  1:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-21 20:27 defcustom: order matters in `choice' with value-to-internal Reiner Steib
2008-03-21 21:49 ` Andreas Schwab
2008-03-22  9:22   ` Reiner Steib
2008-03-22 17:10   ` Stefan Monnier
2008-03-23 21:41     ` Reiner Steib
2008-03-24  1:23       ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.