GNU bug report logs - #22731
emacs-25: Double clicks don't get through to C-h c.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Thu, 18 Feb 2016 12:16:01 UTC

Severity: wishlist

Tags: confirmed

Merged with 7520

Found in version 24.0.50

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 22731 <at> debbugs.gnu.org
Subject: bug#22731: emacs-25: Double clicks don't get through to C-h c.
Date: Thu, 18 Feb 2016 22:39:29 +0000
Hi, Eli.

On Thu, Feb 18, 2016 at 06:58:30PM +0200, Eli Zaretskii wrote:
> > Date: Thu, 18 Feb 2016 12:17:15 +0000
> > From: Alan Mackenzie <acm <at> muc.de>
> > 
> > In the emacs-25 branch, start Emacs with emacs -Q.
> > 
> > In the *scratch* buffer, do C-h c followed by a double click on the left
> > mouse button.
> > 
> > Examine the *Messages* buffer.  There it will be reported that
> > "<down-mouse-1> at that spot runs the command mouse-drag-region".  This
> > is wrong - the event handling code has got impatient and returned the
> > info for <down-mouse-1> rather than waiting for the actual complete
> > event which is a double click.
> > 
> > However, a double click in the *scratch* buffer without C-h c is read
> > correctly, marking the word under the mouse.  It would be nice to be
> > able to find out what this command is that does the marking.

> We never had such a feature in Emacs, AFAICS, so you are asking for an
> enhancement.

OK, I read the fine manual a little bit, and discovered that on a double
click, the Emacs core generates 4 events: a down-mouse, a click, a
double-down-mouse, then a double-click.  And naturally enough, C-h c
only responds to the first event.

This is crazy: if somebody only wants to read about a down-mouse, they'd
only have clicked a down-mouse.  Anybody doing a double-click to C-h c
clearly wants to know what's bound to that, not to the mouse-down.  To
me, it's definitely a bug.

The problem also occurs with C-h k.  It's easy enough to fix, though:



diff --git a/lisp/help.el b/lisp/help.el
index 061daac..6f57159 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -613,7 +613,10 @@ describe-key-briefly
 	   (when (null (cdr yank-menu))
 	     (setq saved-yank-menu (copy-sequence yank-menu))
 	     (menu-bar-update-yank-menu "(any string)" nil))
-	   (setq key (read-key-sequence "Describe key (or click or menu item): "))
+           (while
+               (progn
+                 (setq key (read-key-sequence "Describe key (or click or menu item): "))
+                 (not (sit-for (/ double-click-time 1000.0) t))))
 	   ;; Clear the echo area message (Bug#7014).
 	   (message nil)
 	   ;; If KEY is a down-event, read and discard the
@@ -750,7 +753,10 @@ describe-key
 	   (when (null (cdr yank-menu))
 	     (setq saved-yank-menu (copy-sequence yank-menu))
 	     (menu-bar-update-yank-menu "(any string)" nil))
-	   (setq key (read-key-sequence "Describe key (or click or menu item): "))
+           (while
+               (progn
+                 (setq key (read-key-sequence "Describe key (or click or menu item): "))
+                 (not (sit-for (/ double-click-time 1000.0) t))))
 	   (list
 	    key
 	    (prefix-numeric-value current-prefix-arg)

> Thanks.

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 9 years and 145 days ago.

Previous Next


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