GNU bug report logs - #10907
24.0.94; Updating display of Customize buffer

Previous Next

Package: emacs;

Reported by: Stephen Berman <stephen.berman <at> gmx.net>

Date: Tue, 28 Feb 2012 13:12:01 UTC

Severity: wishlist

Found in version 24.0.94

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10907 in the body.
You can then email your comments to 10907 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Tue, 28 Feb 2012 13:12:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stephen Berman <stephen.berman <at> gmx.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 28 Feb 2012 13:12:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.94; Updating display of Customize buffer
Date: Tue, 28 Feb 2012 14:07:13 +0100
[Message part 1 (text/plain, inline)]
[I posted about this problem to gnu-emacs-help last week but there
hasn't been any response, so I'm adding it to the bugtracker with a more
explicit and self-contained recipe in the hope that, if it's a real bug,
it will be fixed, or if I have made a mistake, it will be pointed out.]

1. mkdir ~/srb; cd ~/srb; touch file1 file2 file3

2. emacs -Q -l path/to/srb.el # Load the attached file.

3. M-x customize-option RET srb-selected-file RET
The Customize buffer shows this, as expected:

 Srb Selected File:
 (*) file1
 ( ) file2
 ( ) file3
     State: STANDARD.
     A selected file name from `srb-file-list'.

4. rm -rf ~/srb

5. Repeat steps 2 and 3; now the Customize buffer shows this:

 Srb Selected File: nil
     State: STANDARD. (mismatch)
     A selected file name from `srb-file-list'.

This is also expected, since srb-selected-file doesn't handle nil.

6. M-x srb-add-file RET file1 RET

7. In the Customize buffer hide and then re-show the value of
srb-selected-file; now the Customize buffer shows this:

 Srb Selected File: "file1"
     State: STANDARD. (mismatch)
     A selected file name from `srb-file-list'.

If I kill the Customize buffer and repeat step 3, it still has the
same display.  What I expected to see is this: 

 Srb Selected File:
 (*) file1
     State: STANDARD.
     A selected file name from `srb-file-list'.

But only if I exit Emacs and then restart it does the Customize buffer
look like this (after loading srb.el).  I haven't been able to get this
display after carrying out steps 4-7 without restarting Emacs.  Is it
possible?  Is there a problem with my defcustom srb-selected-file, or
with the calls to custom-reevaluate-setting and custom-set-default in
srb-add-file, or have I overlooked some other custom-* function that
correctly updates the display?  Or is this a bug in the Customize API?
I'd be grateful for any help.


In GNU Emacs 24.0.94.1 (i686-suse-linux-gnu, GTK+ Version 2.24.7)
 of 2012-02-28 on escher
Windowing system distributor `The X.Org Foundation', version 11.0.11004000
Configured using:
 `configure '--without-toolkit-scroll-bars' 'CFLAGS=-g''

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: en_US.UTF-8
  value of $XMODIFIERS: @im=local
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

[srb.el (text/x-emacs-lisp, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Tue, 28 Feb 2012 13:51:02 GMT) Full text and rfc822 format available.

Message #8 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 10907 <at> debbugs.gnu.org
Subject: Re: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Tue, 28 Feb 2012 14:46:47 +0100
Stephen Berman <stephen.berman <at> gmx.net> writes:

> 7. In the Customize buffer hide and then re-show the value of
> srb-selected-file; now the Customize buffer shows this:
>
>  Srb Selected File: "file1"
>      State: STANDARD. (mismatch)
>      A selected file name from `srb-file-list'.

The current value does not match any of the empty set of choices.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Tue, 28 Feb 2012 21:52:01 GMT) Full text and rfc822 format available.

Message #11 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 10907 <at> debbugs.gnu.org
Subject: Re: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Tue, 28 Feb 2012 18:50:28 +0100
On Tue, 28 Feb 2012 18:23:11 +0100 Andreas Schwab <schwab <at> linux-m68k.org> wrote:

> Stephen Berman <stephen.berman <at> gmx.net> writes:
>
>> On Tue, 28 Feb 2012 14:46:47 +0100 Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>>
>>> Stephen Berman <stephen.berman <at> gmx.net> writes:
>>>
>>>> 7. In the Customize buffer hide and then re-show the value of
>>>> srb-selected-file; now the Customize buffer shows this:
>>>>
>>>>  Srb Selected File: "file1"
>>>>      State: STANDARD. (mismatch)
>>>>      A selected file name from `srb-file-list'.
>>>
>>> The current value does not match any of the empty set of choices.
>>
>> Do you mean that Custom thinks srb-file-list is still empty?
>
> Its :type hasn't changed at all.
>
>> (defcustom srb-selected-file (car srb-file-list)
>>   "A selected file name from `srb-file-list'."
>>   :type (if srb-file-list
>> 	    `(radio ,@(mapcar (lambda (x) (list 'const x)) srb-file-list))) 
>>   :group 'srb)
>>
>> then when srb-dir is empty or nonexistant, the Custom buffer shows this:
>>
>>  Srb Selected File: nil
>>      State: STANDARD.
>>      A selected file name from `srb-file-list'.
>
> :type is nil (ie. no type).
>
>> and after I add a file and refresh the display by hiding and unhiding
>> the value, it shows this:
>>
>>  Srb Selected File: "file1"
>>      State: STANDARD.
>>      A selected file name from `srb-file-list'.
>
> :type is still nil.

I don't follow you; can (or someone else who gets it) you please
elaborate?  Thanks.

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Tue, 28 Feb 2012 21:56:02 GMT) Full text and rfc822 format available.

Message #14 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 10907 <at> debbugs.gnu.org
Subject: Re: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Tue, 28 Feb 2012 19:00:15 +0100
*Note (elisp) Customization Types::

       You specify the customization type in `defcustom' with the `:type'
    keyword.  The argument of `:type' is evaluated, but only once when the
    `defcustom' is executed, so it isn't useful for the value to vary.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Tue, 28 Feb 2012 22:13:02 GMT) Full text and rfc822 format available.

Message #17 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Andreas Schwab'" <schwab <at> linux-m68k.org>,
	"'Stephen Berman'" <stephen.berman <at> gmx.net>
Cc: 10907 <at> debbugs.gnu.org
Subject: RE: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Tue, 28 Feb 2012 14:11:22 -0800
> *Note (elisp) Customization Types::
> You specify the customization type in `defcustom' with 
> the `:type' keyword.  The argument of `:type' is evaluated,
> but only once when the `defcustom' is executed, so it isn't
> useful for the value to vary.

Having this in the Elisp manual helps developers, but it is not all that helpful
for a Customize user trying to understand the behavior.

Stephen described a purely end-user interaction.  And yes, the behavior is not
obvious.  We obviously felt it sufficiently non-obvious to add that paragraph to
the Elisp manual.  End users deserve some info that helps them too understand a
bit.

At the least there seems to be an Emacs-manual doc bug here. Let's please add
something to help users navigate the labyrinth.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Tue, 28 Feb 2012 22:16:02 GMT) Full text and rfc822 format available.

Message #20 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 10907 <at> debbugs.gnu.org
Subject: Re: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Tue, 28 Feb 2012 18:23:11 +0100
Stephen Berman <stephen.berman <at> gmx.net> writes:

> On Tue, 28 Feb 2012 14:46:47 +0100 Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>
>> Stephen Berman <stephen.berman <at> gmx.net> writes:
>>
>>> 7. In the Customize buffer hide and then re-show the value of
>>> srb-selected-file; now the Customize buffer shows this:
>>>
>>>  Srb Selected File: "file1"
>>>      State: STANDARD. (mismatch)
>>>      A selected file name from `srb-file-list'.
>>
>> The current value does not match any of the empty set of choices.
>
> Do you mean that Custom thinks srb-file-list is still empty?

Its :type hasn't changed at all.

> (defcustom srb-selected-file (car srb-file-list)
>   "A selected file name from `srb-file-list'."
>   :type (if srb-file-list
> 	    `(radio ,@(mapcar (lambda (x) (list 'const x)) srb-file-list))) 
>   :group 'srb)
>
> then when srb-dir is empty or nonexistant, the Custom buffer shows this:
>
>  Srb Selected File: nil
>      State: STANDARD.
>      A selected file name from `srb-file-list'.

:type is nil (ie. no type).

> and after I add a file and refresh the display by hiding and unhiding
> the value, it shows this:
>
>  Srb Selected File: "file1"
>      State: STANDARD.
>      A selected file name from `srb-file-list'.

:type is still nil.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Tue, 28 Feb 2012 22:28:01 GMT) Full text and rfc822 format available.

Message #23 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 10907 <at> debbugs.gnu.org
Subject: Re: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Tue, 28 Feb 2012 16:19:51 +0100
On Tue, 28 Feb 2012 14:46:47 +0100 Andreas Schwab <schwab <at> linux-m68k.org> wrote:

> Stephen Berman <stephen.berman <at> gmx.net> writes:
>
>> 7. In the Customize buffer hide and then re-show the value of
>> srb-selected-file; now the Customize buffer shows this:
>>
>>  Srb Selected File: "file1"
>>      State: STANDARD. (mismatch)
>>      A selected file name from `srb-file-list'.
>
> The current value does not match any of the empty set of choices.

Do you mean that Custom thinks srb-file-list is still empty?  If so, and
if I add a check, that fixes the mismatch, but not the display.
Specifically, if I change the definition of srb-selected-file to this:

(defcustom srb-selected-file (car srb-file-list)
  "A selected file name from `srb-file-list'."
  :type (if srb-file-list
	    `(radio ,@(mapcar (lambda (x) (list 'const x)) srb-file-list))) 
  :group 'srb)

then when srb-dir is empty or nonexistant, the Custom buffer shows this:

 Srb Selected File: nil
     State: STANDARD.
     A selected file name from `srb-file-list'.

and after I add a file and refresh the display by hiding and unhiding
the value, it shows this:

 Srb Selected File: "file1"
     State: STANDARD.
     A selected file name from `srb-file-list'.

I still see the list of radio buttons only after restarting Emacs.  So I
guess the defcustom is still wrong; do you know how to fix it?

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Tue, 28 Feb 2012 22:34:01 GMT) Full text and rfc822 format available.

Message #26 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 10907 <at> debbugs.gnu.org
Subject: Re: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Tue, 28 Feb 2012 19:33:16 +0100
On Tue, 28 Feb 2012 19:00:15 +0100 Andreas Schwab <schwab <at> linux-m68k.org> wrote:

> *Note (elisp) Customization Types::
>
>        You specify the customization type in `defcustom' with the `:type'
>     keyword.  The argument of `:type' is evaluated, but only once when the
>     `defcustom' is executed, so it isn't useful for the value to vary.

Ah, thanks.  I feared as much.  Is there really no way to reevaluate a
defcustom in a running Emacs?  It would be very useful.

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Tue, 28 Feb 2012 23:13:01 GMT) Full text and rfc822 format available.

Message #29 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 10907 <at> debbugs.gnu.org, 'Stephen Berman' <stephen.berman <at> gmx.net>
Subject: Re: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Wed, 29 Feb 2012 00:11:56 +0100
"Drew Adams" <drew.adams <at> oracle.com> writes:

> At the least there seems to be an Emacs-manual doc bug here.

Rubbish.  This is about defcustom, which is not a user-level command.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Wed, 29 Feb 2012 01:03:02 GMT) Full text and rfc822 format available.

Message #32 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Andreas Schwab'" <schwab <at> linux-m68k.org>
Cc: 10907 <at> debbugs.gnu.org, 'Stephen Berman' <stephen.berman <at> gmx.net>
Subject: RE: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Tue, 28 Feb 2012 17:01:11 -0800
> This is about defcustom, which is not a user-level command.

My bad.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Wed, 29 Feb 2012 02:08:02 GMT) Full text and rfc822 format available.

Message #35 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 10907 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> linux-m68k.org>
Subject: Re: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Tue, 28 Feb 2012 21:06:59 -0500
> Ah, thanks.  I feared as much.  Is there really no way to reevaluate a
> defcustom in a running Emacs?

Agreed that there should be some way to have a defcustom type that is
a bit more dynamic: no need to completely reevaluate the whole
expression, but being able to have a dynamic set of `choice's would
be helpful.
I don't know Custom enough to be sure that it doesn't exist, so if it
does, please someone change the :type of completion-styles to make use
of it.  If it doesn't, well, patches welcome,


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Wed, 29 Feb 2012 03:59:02 GMT) Full text and rfc822 format available.

Message #38 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 10907 <at> debbugs.gnu.org, schwab <at> linux-m68k.org
Subject: Re: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Wed, 29 Feb 2012 06:00:23 +0200
> From: Stephen Berman <stephen.berman <at> gmx.net>
> Date: Tue, 28 Feb 2012 19:33:16 +0100
> Cc: 10907 <at> debbugs.gnu.org
> 
> On Tue, 28 Feb 2012 19:00:15 +0100 Andreas Schwab <schwab <at> linux-m68k.org> wrote:
> 
> > *Note (elisp) Customization Types::
> >
> >        You specify the customization type in `defcustom' with the `:type'
> >     keyword.  The argument of `:type' is evaluated, but only once when the
> >     `defcustom' is executed, so it isn't useful for the value to vary.
> 
> Ah, thanks.  I feared as much.  Is there really no way to reevaluate a
> defcustom in a running Emacs?  It would be very useful.

There's custom-reevaluate-setting, but I'm not sure it will do what
you want.




Severity set to 'wishlist' from 'normal' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 29 Feb 2012 08:14:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Wed, 29 Feb 2012 09:06:02 GMT) Full text and rfc822 format available.

Message #43 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 10907 <at> debbugs.gnu.org, Stephen Berman <stephen.berman <at> gmx.net>
Subject: Re: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Wed, 29 Feb 2012 10:05:15 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> Ah, thanks.  I feared as much.  Is there really no way to reevaluate a
>> defcustom in a running Emacs?
>
> Agreed that there should be some way to have a defcustom type that is
> a bit more dynamic: no need to completely reevaluate the whole
> expression, but being able to have a dynamic set of `choice's would
> be helpful.

Define a widget derived from menu-choice with custom :match and
:validate methods.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Wed, 29 Feb 2012 12:22:02 GMT) Full text and rfc822 format available.

Message #46 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 10907 <at> debbugs.gnu.org, schwab <at> linux-m68k.org
Subject: Re: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Wed, 29 Feb 2012 13:20:57 +0100
On Wed, 29 Feb 2012 06:00:23 +0200 Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: Stephen Berman <stephen.berman <at> gmx.net>
>> Date: Tue, 28 Feb 2012 19:33:16 +0100
>> Cc: 10907 <at> debbugs.gnu.org
>> 
>> On Tue, 28 Feb 2012 19:00:15 +0100 Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>> 
>> > *Note (elisp) Customization Types::
>> >
>> >        You specify the customization type in `defcustom' with the `:type'
>> >     keyword.  The argument of `:type' is evaluated, but only once when the
>> >     `defcustom' is executed, so it isn't useful for the value to vary.
>> 
>> Ah, thanks.  I feared as much.  Is there really no way to reevaluate a
>> defcustom in a running Emacs?  It would be very useful.
>
> There's custom-reevaluate-setting, but I'm not sure it will do what
> you want.

Unfortunately it doesn't (I pointed that out in my OP, assuming I was
using it properly).

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Wed, 29 Feb 2012 12:28:02 GMT) Full text and rfc822 format available.

Message #49 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 10907 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Wed, 29 Feb 2012 13:26:47 +0100
On Wed, 29 Feb 2012 10:05:15 +0100 Andreas Schwab <schwab <at> linux-m68k.org> wrote:

> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>
>>> Ah, thanks.  I feared as much.  Is there really no way to reevaluate a
>>> defcustom in a running Emacs?
>>
>> Agreed that there should be some way to have a defcustom type that is
>> a bit more dynamic: no need to completely reevaluate the whole
>> expression, but being able to have a dynamic set of `choice's would
>> be helpful.
>
> Define a widget derived from menu-choice with custom :match and
> :validate methods.

Thanks for the suggestion; I'll try taking a stab at it, but with my
level of competence and available time, it may take a while, if I
succeed at all (if anyone else beats me to the punch, please let know).

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Wed, 29 Feb 2012 19:47:01 GMT) Full text and rfc822 format available.

Message #52 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 10907 <at> debbugs.gnu.org, Stephen Berman <stephen.berman <at> gmx.net>,
	Andreas Schwab <schwab <at> linux-m68k.org>
Subject: Re: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Wed, 29 Feb 2012 14:45:32 -0500
Stefan Monnier wrote:

> but being able to have a dynamic set of `choice's would be helpful.

When might you want to use such a thing, as opposed to having :type a
static list that encompasses all possible valid settings?

I can only see it being harmful. Eg if you want to compute the :type
based on whether some external utility is installed on the system, you
could end up with saved settings in ~/.emacs that suddenly become
invalid (wrong type) if said utility gets removed from the system.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Thu, 01 Mar 2012 02:44:02 GMT) Full text and rfc822 format available.

Message #55 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 10907 <at> debbugs.gnu.org, Stephen Berman <stephen.berman <at> gmx.net>,
	Andreas Schwab <schwab <at> linux-m68k.org>
Subject: Re: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Wed, 29 Feb 2012 21:42:58 -0500
>> but being able to have a dynamic set of `choice's would be helpful.
> When might you want to use such a thing, as opposed to having :type a
> static list that encompasses all possible valid settings?

In the email to which you respond, I mention completion-styles, since
these can refer to styles that are provided by external packages.

> I can only see it being harmful.  Eg if you want to compute the :type
> based on whether some external utility is installed on the system, you
> could end up with saved settings in ~/.emacs that suddenly become
> invalid (wrong type) if said utility gets removed from the system.

Just because there are scenarios where you can bump into bugs doesn't
mean it can't be very useful.  E.g. types such as `function' also accept
a set of values that depends on what's installed, yet it hasn't proved
to be a problem.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Sat, 03 Mar 2012 17:05:02 GMT) Full text and rfc822 format available.

Message #58 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 10907 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> linux-m68k.org>
Subject: Re: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Sat, 03 Mar 2012 18:03:50 +0100
[Message part 1 (text/plain, inline)]
On Tue, 28 Feb 2012 21:06:59 -0500 Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:

>> Ah, thanks.  I feared as much.  Is there really no way to reevaluate a
>> defcustom in a running Emacs?
>
> Agreed that there should be some way to have a defcustom type that is
> a bit more dynamic: no need to completely reevaluate the whole
> expression, but being able to have a dynamic set of `choice's would
> be helpful.

It turns out that, at least for my use case, completely reevaluating the
whole expression in fact DTRT -- see the attached file.  Admittedly,
elegant it isn't, and AFAIK this is virtually never done (I guess that's
why it didn't occur to me when I asked the above question) -- but other
than inelegance, is there a problem with doing this?

Steve Berman

[srb.el (text/x-emacs-lisp, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10907; Package emacs. (Thu, 21 Apr 2022 13:50:02 GMT) Full text and rfc822 format available.

Message #61 received at 10907 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 10907 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> linux-m68k.org>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#10907: 24.0.94; Updating display of Customize buffer
Date: Thu, 21 Apr 2022 15:49:41 +0200
Stephen Berman <stephen.berman <at> gmx.net> writes:

> It turns out that, at least for my use case, completely reevaluating the
> whole expression in fact DTRT -- see the attached file.  Admittedly,
> elegant it isn't, and AFAIK this is virtually never done (I guess that's
> why it didn't occur to me when I asked the above question) -- but other
> than inelegance, is there a problem with doing this?

No, doing that's fine, but rather unusual.

Andreas pointed out that the traditional way to do more dynamic types is
to use a menu-choice with :match and stuff, so I don't think there's
anything much to fix here, really, and I'm therefore closing this bug
report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 10907 <at> debbugs.gnu.org and Stephen Berman <stephen.berman <at> gmx.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 21 Apr 2022 13:50:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 20 May 2022 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 341 days ago.

Previous Next


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