GNU bug report logs - #12084
24.1; default value for defcustom :type `choice'

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: "Drew Adams" <drew.adams@HIDDEN>; dated Sun, 29 Jul 2012 20:37:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Severity set to 'wishlist' from 'minor' Request was from Stefan Kangas <stefan@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 12084 <at> debbugs.gnu.org:


Received: (at 12084) by debbugs.gnu.org; 16 Sep 2012 23:39:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 16 19:39:28 2012
Received: from localhost ([127.0.0.1]:37668 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TDOQx-0005YY-Ud
	for submit <at> debbugs.gnu.org; Sun, 16 Sep 2012 19:39:28 -0400
Received: from acsinet15.oracle.com ([141.146.126.227]:18442)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <drew.adams@HIDDEN>) id 1TDOQv-0005YR-8u
	for 12084 <at> debbugs.gnu.org; Sun, 16 Sep 2012 19:39:25 -0400
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id q8GNcBPJ020786
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <12084 <at> debbugs.gnu.org>; Sun, 16 Sep 2012 23:38:12 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	q8GNcBs1016681
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <12084 <at> debbugs.gnu.org>; Sun, 16 Sep 2012 23:38:11 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	q8GNcA1i001593
	for <12084 <at> debbugs.gnu.org>; Sun, 16 Sep 2012 18:38:10 -0500
Received: from dradamslap1 (/10.159.170.142)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Sun, 16 Sep 2012 16:38:10 -0700
From: "Drew Adams" <drew.adams@HIDDEN>
To: <12084 <at> debbugs.gnu.org>
References: <4C0A088FCB7042ACBFAF7EE9F1B705C6@HIDDEN>
	<CF028FA9D27E4491B9430DAAF8B97E2E@HIDDEN>
Subject: RE: bug#12084: 24.1; default value for defcustom :type `choice'
Date: Sun, 16 Sep 2012 16:38:00 -0700
Message-ID: <2BB66EBD33BE40CCB9AB3B40547224A8@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <CF028FA9D27E4491B9430DAAF8B97E2E@HIDDEN>
Thread-Index: Ac1tyLnUsKuWUIJRSlKedw8MBAYi2wAAHWEACabGx/A=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
X-Spam-Score: -7.4 (-------)
X-Debbugs-Envelope-To: 12084
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -7.4 (-------)

ping





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12084; Package emacs. Full text available.

Message received at 12084 <at> debbugs.gnu.org:


Received: (at 12084) by debbugs.gnu.org; 29 Jul 2012 20:43:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 29 16:43:01 2012
Received: from localhost ([127.0.0.1]:49289 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SvaKJ-0004pg-TN
	for submit <at> debbugs.gnu.org; Sun, 29 Jul 2012 16:43:01 -0400
Received: from acsinet15.oracle.com ([141.146.126.227]:37739)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <drew.adams@HIDDEN>) id 1SvaKG-0004pY-8m
	for 12084 <at> debbugs.gnu.org; Sun, 29 Jul 2012 16:42:57 -0400
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id q6TKZhDE024027
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <12084 <at> debbugs.gnu.org>; Sun, 29 Jul 2012 20:35:44 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	q6TKZgce016032
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <12084 <at> debbugs.gnu.org>; Sun, 29 Jul 2012 20:35:43 GMT
Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	q6TKZgFe026101
	for <12084 <at> debbugs.gnu.org>; Sun, 29 Jul 2012 15:35:42 -0500
Received: from dradamslap1 (/71.202.147.44)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Sun, 29 Jul 2012 13:35:42 -0700
From: "Drew Adams" <drew.adams@HIDDEN>
To: <12084 <at> debbugs.gnu.org>
References: <4C0A088FCB7042ACBFAF7EE9F1B705C6@HIDDEN>
Subject: RE: bug#12084: 24.1; default value for defcustom :type `choice'
Date: Sun, 29 Jul 2012 13:35:31 -0700
Message-ID: <CF028FA9D27E4491B9430DAAF8B97E2E@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <4C0A088FCB7042ACBFAF7EE9F1B705C6@HIDDEN>
Thread-Index: Ac1tyLnUsKuWUIJRSlKedw8MBAYi2wAAHWEA
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
X-Spam-Score: -6.9 (------)
X-Debbugs-Envelope-To: 12084
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.9 (------)

> (defcustom foo ()
>   "..."
>   :type `(repeat
>    (choice ,@(mapcar (lambda (cset) `(const ,cset))
>                      charset-list)))
>   :group 'convenience)

Lest someone reply that the programmer can order the list, e.g. could use, say,
`(charset-priority-list)' instead of `charset-list', let me say that that would
miss the  point.

The problem (bug) is about specifying the default value, and documenting that.
It is not about improving the particular example used to illustrate the problem.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12084; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Jul 2012 20:36:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 29 16:36:09 2012
Received: from localhost ([127.0.0.1]:49268 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SvaDg-0004fd-QN
	for submit <at> debbugs.gnu.org; Sun, 29 Jul 2012 16:36:09 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45543)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <drew.adams@HIDDEN>) id 1SvaDd-0004fW-Vk
	for submit <at> debbugs.gnu.org; Sun, 29 Jul 2012 16:36:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1Sva6h-0006XD-Co
	for submit <at> debbugs.gnu.org; Sun, 29 Jul 2012 16:28:56 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,
	UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:35587)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1Sva6h-0006X0-9J
	for submit <at> debbugs.gnu.org; Sun, 29 Jul 2012 16:28:55 -0400
Received: from eggs.gnu.org ([208.118.235.92]:35846)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1Sva6g-000689-0c
	for bug-gnu-emacs@HIDDEN; Sun, 29 Jul 2012 16:28:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1Sva6e-0006Uy-SN
	for bug-gnu-emacs@HIDDEN; Sun, 29 Jul 2012 16:28:53 -0400
Received: from acsinet15.oracle.com ([141.146.126.227]:28364)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1Sva6e-0006TR-Lr
	for bug-gnu-emacs@HIDDEN; Sun, 29 Jul 2012 16:28:52 -0400
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id q6TKSlXh021266
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <bug-gnu-emacs@HIDDEN>; Sun, 29 Jul 2012 20:28:48 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	q6TKSjUA012476
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <bug-gnu-emacs@HIDDEN>; Sun, 29 Jul 2012 20:28:47 GMT
Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	q6TKSjJO031725
	for <bug-gnu-emacs@HIDDEN>; Sun, 29 Jul 2012 15:28:45 -0500
Received: from dradamslap1 (/71.202.147.44)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Sun, 29 Jul 2012 13:28:44 -0700
From: "Drew Adams" <drew.adams@HIDDEN>
To: <bug-gnu-emacs@HIDDEN>
Subject: 24.1; default value for defcustom :type `choice'
Date: Sun, 29 Jul 2012 13:28:34 -0700
Message-ID: <4C0A088FCB7042ACBFAF7EE9F1B705C6@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
Thread-Index: Ac1tyLnUsKuWUIJRSlKedw8MBAYi2w==
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.17
X-Spam-Score: -6.1 (------)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.1 (------)

emacs -Q
 
(defcustom foo ()
  "..."
  :type `(repeat
   (choice ,@(mapcar (lambda (cset) `(const ,cset))
       charset-list)))
  :group 'convenience)
 
That defines an option whose value is a list of charsets (symbols).
 
When you try to use `M-x customize-option foo', and you click [INS] to
choose a charset to insert into the list, you should, I think,
immediately get the prompt to choose a charset using completion.
 
Instead, you immediately get the first charset in `charset-list' as your
"choice".  You are not given any chance to _choose_, for this supposed
"choice".
 
Yes, you can then click button Value Menu, which will prompt you to
choose.  But you did not choose the initial value that was inserted
(e.g., `chinese-cns11643-15').
 
This is not good.
 
Worse, there is no way, AFAICT, for you to specify a default value for
`choice'.  You can use :value to specify a default for any given
`choice' possibility (alternative), but you cannot specify a default
value for the overall `choice'.
 
And yet there is such a default value imposed by Emacs: a value appears
when you click [INS], before you click Value Menu and are presented with
a chance to choose.  A preliminary choice is made for you: a default
value is inserted.
 
Finally, this default value is described nowhere in the doc.  It seems
to be the first element of the `choice' list, but I do not see this
documented.
 
Well, there is this bit buried in the doc of `choice', under a
discussion of :value (which applies only to the default value of an
individual alternative):
 
 "If some values are covered by more than one of the alternatives,
  customize will choose the first alternative that the value fits."
 
It is not clear what "the value" is here, that is being tested to fit.
But I guess that sentence applies to our case here, in this sense: All
of the possible alternatives "fit", so the first is used (it is the
first that "fits").
 
In sum, there are 3 problems reported here:
 
1. Clicking button [INS] immediately sets the value.  You are not given
a prompt to choose a value.
 
2. There is no way for the programmer to define that default value that
is inserted as soon as you click [INS].
 
3. There is no documentation regarding this default value.
 
I would like for #1 to be fixed, if possible.  That would presumably
obviate any need to fix #2 and #3.  In effect, if #1 is fixed then there
is no default value needed because you would be immediately forced to
choose the value.
 
However, when you do choose, there could be a default value for your
minibuffer entry.  In that case, i.e., if we did provide for you to be
able to just hit RET without explicitly choosing an alternative
(e.g. using completion), then #2 and #3 would still apply: there should
be a way to specify the default value (#2), and specifying the default
value should be documented (#3).
 

In GNU Emacs 24.1.1 (i386-mingw-nt5.1.2600)
 of 2012-06-10 on MARVIN
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.6) --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include'
 
y






Acknowledgement sent to "Drew Adams" <drew.adams@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#12084; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.