GNU bug report logs -
#12670
24.2.50; Uncustomizable defcustom
Previous Next
Reported by: Katsumi Yamaoka <yamaoka <at> jpl.org>
Date: Thu, 18 Oct 2012 09:36:02 UTC
Severity: normal
Found in version 24.2.50
Done: Katsumi Yamaoka <yamaoka <at> jpl.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 12670 in the body.
You can then email your comments to 12670 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12670
; Package
emacs
.
(Thu, 18 Oct 2012 09:36:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Katsumi Yamaoka <yamaoka <at> jpl.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 18 Oct 2012 09:36:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi,
I realized that a certain defcustom form is unable to customize
a user option. To reproduce this, evaluate the following form,
perform M-x customize-option, and press the [INS] button.
(defcustom foo nil
"Doc"
:type '(repeat (group (group :inline t (choice string function)))))
Then you will find a funny thing there and see it is unable to
edit. After some investigations I found this is due to
`widget-default-get', that fails to get the default value of
components within an inlined form (I mean (bar :inline t ...)).
A patch is attached, not tested with all sorts of defcustom
forms though.
[DIFF (text/x-patch, inline)]
--- wid-edit.el~ 2012-04-22 21:52:01.618551000 +0000
+++ wid-edit.el 2012-10-18 09:27:17.158803700 +0000
@@ -525,9 +525,18 @@
(defun widget-default-get (widget)
"Extract the default external value of WIDGET."
(widget-apply widget :value-to-external
(or (widget-get widget :value)
- (widget-apply widget :default-get))))
+ (progn
+ (when (widget-get widget :args)
+ (let (args)
+ (dolist (arg (widget-get widget :args))
+ (setq args (append args
+ (if (widget-get arg :inline)
+ (widget-get arg :args)
+ (list arg)))))
+ (widget-put widget :args args)))
+ (widget-apply widget :default-get)))))
(defun widget-match-inline (widget vals)
"In WIDGET, match the start of VALS."
(cond ((widget-get widget :inline)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12670
; Package
emacs
.
(Sat, 22 Dec 2012 01:43:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 12670 <at> debbugs.gnu.org (full text, mbox):
Katsumi Yamaoka <yamaoka <at> jpl.org> writes:
> evaluate the following form, perform M-x customize-option, and press
> the [INS] button.
>
> (defcustom foo nil
> "Doc"
> :type '(repeat (group (group :inline t (choice string function)))))
>
> Then you will find a funny thing there and see it is unable to
> edit.
I can't reproduce this on Emacs 23.4, the emacs-24 branch, or trunk.
After opening the customization buffer for `foo', I click on INS and it
opens up
INS DEL Choice: Value Menu invalid (nil)
and clicking on "Value Menu" allows me to insert a function or string.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12670
; Package
emacs
.
(Sat, 22 Dec 2012 13:37:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 12670 <at> debbugs.gnu.org (full text, mbox):
Chong Yidong <cyd <at> gnu.org> wrote:
> Katsumi Yamaoka <yamaoka <at> jpl.org> writes:
>> evaluate the following form, perform M-x customize-option, and press
>> the [INS] button.
>> (defcustom foo nil
>> "Doc"
>> :type '(repeat (group (group :inline t (choice string function)))))
>> Then you will find a funny thing there and see it is unable to
>> edit.
> I can't reproduce this on Emacs 23.4, the emacs-24 branch, or trunk.
> After opening the customization buffer for `foo', I click on INS and it
> opens up
> INS DEL Choice: Value Menu invalid (nil)
> and clicking on "Value Menu" allows me to insert a function or string.
Oops, you're right. I don't recall why I said it's uncustomisable,
but please let me rephrase it:
That defcustom form is unable to suggest a default value, that's
the one suitable to beginners for example, to a user. Could you
try the following two examples? Both behaviors should be the same.
And my patch solves it.
(defcustom foo1 nil
"Doc"
:type '(repeat (group (group :inline t
(choice (string :value "foo")
function)))))
(defcustom foo2 nil
"Doc"
:type '(repeat (group (choice (string :value "foo")
function))))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12670
; Package
emacs
.
(Sun, 06 Jan 2013 03:39:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 12670 <at> debbugs.gnu.org (full text, mbox):
Katsumi Yamaoka <yamaoka <at> jpl.org> writes:
> Oops, you're right. I don't recall why I said it's uncustomisable,
> but please let me rephrase it:
> That defcustom form is unable to suggest a default value, that's
> the one suitable to beginners for example, to a user. Could you
> try the following two examples? Both behaviors should be the same.
> And my patch solves it.
Ah, OK. Looks fine to me, please go ahead and commit to trunk.
Reply sent
to
Katsumi Yamaoka <yamaoka <at> jpl.org>
:
You have taken responsibility.
(Mon, 07 Jan 2013 11:27:05 GMT)
Full text and
rfc822 format available.
Notification sent
to
Katsumi Yamaoka <yamaoka <at> jpl.org>
:
bug acknowledged by developer.
(Mon, 07 Jan 2013 11:27:07 GMT)
Full text and
rfc822 format available.
Message #19 received at 12670-done <at> debbugs.gnu.org (full text, mbox):
Chong Yidong wrote:
> Ah, OK. Looks fine to me, please go ahead and commit to trunk.
Thanks. Done.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 04 Feb 2013 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 12 years and 195 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.