From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#29272: 26.0.90; "C-h k C-mouse-3" followed by menu selection asks for more keys Date: Wed, 29 Nov 2017 08:19:34 -0500 Message-ID: <87wp29jk7t.fsf@users.sourceforge.net> References: <83shdjn3ju.fsf@gnu.org> <83mv3rn02t.fsf@gnu.org> <20171114205449.GA8025@ACM> <87fu8xnc17.fsf@users.sourceforge.net> <83h8td4uw5.fsf@gnu.org> <5A1E724A.5030507@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1511961621 8742 195.159.176.226 (29 Nov 2017 13:20:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 29 Nov 2017 13:20:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: acm@muc.de, 29272@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 29 14:20:17 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eK2Hg-0001ng-7f for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Nov 2017 14:20:16 +0100 Original-Received: from localhost ([::1]:43005 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eK2Hl-0000mS-Oz for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Nov 2017 08:20:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eK2HY-0000et-9F for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2017 08:20:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eK2HT-0001vF-AG for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2017 08:20:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55327) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eK2HT-0001v4-6J for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2017 08:20:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eK2HS-0006HN-Vu for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2017 08:20:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Nov 2017 13:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29272 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 29272-submit@debbugs.gnu.org id=B29272.151196158524101 (code B ref 29272); Wed, 29 Nov 2017 13:20:02 +0000 Original-Received: (at 29272) by debbugs.gnu.org; 29 Nov 2017 13:19:45 +0000 Original-Received: from localhost ([127.0.0.1]:35774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eK2HB-0006Ge-Ic for submit@debbugs.gnu.org; Wed, 29 Nov 2017 08:19:45 -0500 Original-Received: from mail-it0-f54.google.com ([209.85.214.54]:36843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eK2H9-0006GQ-BZ for 29272@debbugs.gnu.org; Wed, 29 Nov 2017 08:19:43 -0500 Original-Received: by mail-it0-f54.google.com with SMTP id d16so4067325itj.1 for <29272@debbugs.gnu.org>; Wed, 29 Nov 2017 05:19:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=cQ0FKuAjymTWXZF7ppvpFalgnp7hA6jkmsl4AuCT66k=; b=uRrOe9xcoBxSQHGPxzzwPjhEm/dBhOGdH/RiiaPirLGBgGeG6qflBrZdu2ZL0VEX0s zMG2cWznnLR3KVggp1bLz56YbEqSBK9GHYRhgs7dlt4Ie6ut/vNUE6g0WxrsvNO8iOyR RLJa5VyemJIxGQ20fU8GHZ096hrXy8UIEcLj5pqkoFKmpSxKnfz4vysTuANIz0jy1o1J uWE7iTMEC1S3cjVjq/d+lysi9AkocyU7kIB5WZqMRydzmRzTuEZ6LiC4nap6+FFqviDf Low3FDXrx0pxp+umPLgLBqNtpMhHvobnquwAX5au1/iltju8z8XaxYBkRnyGkLTW9oIM aDFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=cQ0FKuAjymTWXZF7ppvpFalgnp7hA6jkmsl4AuCT66k=; b=p6f39CHW7ELV5IuAiiRt361pdHPaBVnPfrNZcCBrOZP/aIXvXAAn/y19MxRcmg3bdQ q6BLP9NgOm0poq0uPrpBuKXler4zNCIef/R93vy2/DCIzXn+AjTS50b0Y5dUXDFVnkxr YJV1/o/foMMjOZ6zIj3UAkvRhNC5Ze2/Md7yrE5CbZvcWdNx6PmSwVg6Zry48nuRKF75 RBXSdsK/VpCbPATb+/aXtU9Z6N3WqAXhZ4JDLa+fgJVEPKcB2n5QfH1UNU0DfxilAZ4+ +uCI4V5XuPcC/9vR4HZnF/sfWdZRx6tUjnOE8BsfQ+tV4acFRMg9QabcTKgCQdEhnGsJ 8JWw== X-Gm-Message-State: AJaThX57Vgrh9YM4CEqV9A12obc7FrQ5ULgXxqJzSjmk1L2xWWRk4SHL gs3HdrwrCxa2DIca4MCUsFFy5rv5 X-Google-Smtp-Source: AGs4zMZQTcWE2HQRdcefZwgFkz2N2EVwGYBVb9Tg63cLgerhMQ78Jl0wKGorNZm+Z5UbbHFWglPYDw== X-Received: by 10.36.101.140 with SMTP id u134mr7147165itb.108.1511961577513; Wed, 29 Nov 2017 05:19:37 -0800 (PST) Original-Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id c65sm781097ioj.23.2017.11.29.05.19.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Nov 2017 05:19:36 -0800 (PST) In-Reply-To: <5A1E724A.5030507@gmx.at> (martin rudalics's message of "Wed, 29 Nov 2017 09:39:38 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:140541 Archived-At: >From what I can tell, we should only need to wait for a double click when we get a single mouse event; when clicking in a menu, read-key-sequence returns [(C-down-mouse-3 (# ...)) the-command]. The following works for me in lucid and gtk: --- c/lisp/help.el +++ i/lisp/help.el @@ -726,19 +726,19 @@ help-read-key-sequence (while (pcase (setq key (read-key-sequence "\ Describe the following key, mouse click, or menu item: ")) - ((and (pred vectorp) (let `(,key0 . ,_) (aref key 0)) - (guard (symbolp key0)) (let keyname (symbol-name key0))) - (or - (and no-mouse-movement - (string-match "mouse-movement" keyname)) - (and (string-match "\\(mouse\\|down\\|click\\|drag\\)" - keyname) - (progn - ;; Discard events (e.g. ) which might - ;; spuriously trigger the `sit-for'. - (sleep-for 0.01) - (while (read-event nil nil 0.01)) - (not (sit-for (/ double-click-time 1000.0) t)))))))) + (`[(,key0 . ,_)] + (or (and no-mouse-movement (eq key0 'mouse-movement)) + ;; Wait long enough to fully read a double click event. + ;; FIXME: How to handle double-click-time = t? + (and (numberp double-click-time) + (string-match "\\(mouse\\|down\\|click\\|drag\\)" + (symbol-name key0)) + (progn + ;; Discard events (e.g. ) which might + ;; spuriously trigger the `sit-for'. + (sleep-for 0.01) + (while (read-event nil nil 0.01)) + (not (sit-for (/ double-click-time 1000.0) t)))))))) (list key ;; If KEY is a down-event, read and include the martin rudalics writes: > BTW: Could someone please fix that > > (not (sit-for (/ double-click-time 1000.0) t)) > > form so it handles at least those values of `double-click-time' > described in its documentation: > > Maximum time between mouse clicks to make a double-click. > Measured in milliseconds. The value nil means disable double-click > recognition; t means double-clicks have no time limit and are detected > by position only. > > I'm not sure what `sit-for' is supposed to return in those cases. I don't know how to handle the double-click-time = t case though.