GNU bug report logs - #37916
GNUS: wrong item selected in gnus-thread-hide-subtree customization

Previous Next

Package: emacs;

Reported by: Sergey Organov <sorganov <at> gmail.com>

Date: Fri, 25 Oct 2019 07:14:02 UTC

Severity: normal

Tags: fixed

Fixed in version 27.1

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 37916 in the body.
You can then email your comments to 37916 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#37916; Package emacs. (Fri, 25 Oct 2019 07:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sergey Organov <sorganov <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 25 Oct 2019 07:14:02 GMT) Full text and rfc822 format available.

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

From: Sergey Organov <sorganov <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: GNUS: wrong item selected in gnus-thread-hide-subtree customization
Date: Fri, 25 Oct 2019 10:13:43 +0300
The "Non-nil" defcustom item is selected in customization buffer when
actual value of the gnus-thread-hide-subtree is 'nil.

-- 8< --

Fix gnus-thread-hide-subtree defcustom

* lisp/gnus/gnus-sum.el (gnus-thread-hide-subtree): fix order of
items to prevent first 'sexp' from matching 'nil, that caused
"Non-nil" item to be selected in customization buffer when actual
variable value is 'nil.
---
 lisp/gnus/gnus-sum.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index b5d7448..1970465 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -332,11 +332,11 @@ This can be a predicate specifier which says which threads to hide.
 If threads are hidden, you have to run the command
 `gnus-summary-show-thread' by hand or select an article."
   :group 'gnus-thread
-  :type '(radio (sexp :format "Non-nil\n"
+  :type '(radio (const nil)
+		(sexp :format "Non-nil\n"
 		      :match (lambda (widget value)
 			       (not (or (consp value) (functionp value))))
 		      :value t)
-		(const nil)
 		(sexp :tag "Predicate specifier")))
 
 (defcustom gnus-thread-hide-killed t
-- 
2.1.4




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37916; Package emacs. (Fri, 25 Oct 2019 10:41:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Sergey Organov <sorganov <at> gmail.com>
Cc: 37916 <at> debbugs.gnu.org
Subject: Re: bug#37916: GNUS: wrong item selected in
 gnus-thread-hide-subtree customization
Date: Fri, 25 Oct 2019 12:39:56 +0200
Sergey Organov <sorganov <at> gmail.com> writes:

> The "Non-nil" defcustom item is selected in customization buffer when
> actual value of the gnus-thread-hide-subtree is 'nil.

Hm...  'nil and nil are the same.

[...]

> -  :type '(radio (sexp :format "Non-nil\n"
> +  :type '(radio (const nil)
> +		(sexp :format "Non-nil\n"
>  		      :match (lambda (widget value)
>  			       (not (or (consp value) (functionp value))))
>  		      :value t)
> -		(const nil)

Oh, I see.  I think the problem is that that :match is just wrong.
Changing the order of the values (as this patch does) also makes the
problem go away, but I think the right fix here is to fix the :match.

So I've installed the following patch instead:

diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index b5d744843f..f21bc7584e 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -334,7 +334,7 @@ gnus-thread-hide-subtree
   :group 'gnus-thread
   :type '(radio (sexp :format "Non-nil\n"
 		      :match (lambda (widget value)
-			       (not (or (consp value) (functionp value))))
+			       (and value (not (functionp value))))
 		      :value t)
 		(const nil)
 		(sexp :tag "Predicate specifier")))


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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 25 Oct 2019 10:41:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 37916 <at> debbugs.gnu.org and Sergey Organov <sorganov <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 25 Oct 2019 10:41:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37916; Package emacs. (Fri, 25 Oct 2019 13:13:01 GMT) Full text and rfc822 format available.

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

From: Sergey Organov <sorganov <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 37916 <at> debbugs.gnu.org
Subject: Re: bug#37916: GNUS: wrong item selected in gnus-thread-hide-subtree
 customization
Date: Fri, 25 Oct 2019 16:12:19 +0300
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Sergey Organov <sorganov <at> gmail.com> writes:
>
>> The "Non-nil" defcustom item is selected in customization buffer when
>> actual value of the gnus-thread-hide-subtree is 'nil.
>
> Hm...  'nil and nil are the same.
>
> [...]
>
>> -  :type '(radio (sexp :format "Non-nil\n"
>> +  :type '(radio (const nil)
>> +		(sexp :format "Non-nil\n"
>>  		      :match (lambda (widget value)
>>  			       (not (or (consp value) (functionp value))))
>>  		      :value t)
>> -		(const nil)
>
> Oh, I see.  I think the problem is that that :match is just wrong.
> Changing the order of the values (as this patch does) also makes the
> problem go away, but I think the right fix here is to fix the :match.

Yes, I also thought it is, but took kludgy way as I'm not familiar
with the :math specifications.

Thanks for fixing it the right way!

-- Sergey




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 23 Nov 2019 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 209 days ago.

Previous Next


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