GNU bug report logs - #42887
28.0.50; Customize Group doesn't show/hide option on repeated clicking

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Sun, 16 Aug 2020 14:03:01 UTC

Severity: minor

Tags: patch

Found in version 28.0.50

Full log


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

From: Stefan Kangas <stefan <at> marxist.se>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 42887 <at> debbugs.gnu.org
Subject: Re: bug#42887: 28.0.50; Customize Group doesn't show/hide option on
 repeated clicking
Date: Tue, 17 Nov 2020 03:48:30 -0800
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> Mauro Aranda <maurooaranda <at> gmail.com> writes:
>>
>>> Only when I click "too fast" the option doesn't expand,
>>
>> That's different from what I'm seeing.  I can wait several seconds
>> between clicks, and as long as I don't move the mouse cursor the option
>> won't expand.
>
> I think I misunderstood your recipe.  Does an option that starts as hidden
> never expand for you in the recipe?

No, it does expand on the first click.

It will not expand on repeated clicks unless I move the mouse cursor
between clicks.  The delay does not matter (except if I click too fast I
see double-click events).

So I had a quick look, and the defun `custom-toggle-hide-variable' is
called on the first click.  The option then correctly expands.

But that function is not called on subsequent clicks.  After moving the
mouse cursor and clicking, it seems to register again and
`custom-toggle-hide-variable' is called.

This is what I used to test this:

diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index d1077d367d..86235f9fc0 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -2796,11 +2796,14 @@ custom-variable-value-create
 	  (custom-add-parent-links widget))
 	(custom-add-see-also widget)))))

+(defvar count 0)
 (defun custom-toggle-hide-variable (visibility-widget &rest _ignore)
   "Toggle the visibility of a `custom-variable' parent widget.
 By default, this signals an error if the parent has unsaved
 changes.  If the parent has a `simple' :custom-style property,
 the present value is saved to its :shown-value property instead."
+  (message "Click %s" count)
+  (setq count (1+ count))
   (let ((widget (widget-get visibility-widget :parent)))
     (unless (eq (widget-type widget) 'custom-variable)
       (error "Invalid widget type"))




This bug report was last modified 81 days ago.

Previous Next


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