From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#30955: 27.0.50; Mouse clicks on header-line in Info are broken Date: Tue, 27 Mar 2018 15:27:10 -0400 Message-ID: References: <83po3qga5g.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1522178774 19895 195.159.176.226 (27 Mar 2018 19:26:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Mar 2018 19:26:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Colin Baxter To: 30955-done@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 27 21:26:10 2018 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 1f0uET-00054e-N6 for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Mar 2018 21:26:09 +0200 Original-Received: from localhost ([::1]:35754 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0uGX-0004Iv-7m for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Mar 2018 15:28:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0uGO-0004Hr-2n for bug-gnu-emacs@gnu.org; Tue, 27 Mar 2018 15:28:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0uGI-0000kR-9a for bug-gnu-emacs@gnu.org; Tue, 27 Mar 2018 15:28:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48364) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0uGI-0000kG-6I for bug-gnu-emacs@gnu.org; Tue, 27 Mar 2018 15:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f0uGI-0008Tv-0h for bug-gnu-emacs@gnu.org; Tue, 27 Mar 2018 15:28:02 -0400 Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Mar 2018 19:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 30955 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 30955@debbugs.gnu.org, monnier@IRO.UMontreal.CA, eliz@gnu.org Original-Received: via spool by 30955-done@debbugs.gnu.org id=D30955.152217883632547 (code D ref 30955); Tue, 27 Mar 2018 19:28:01 +0000 Original-Received: (at 30955-done) by debbugs.gnu.org; 27 Mar 2018 19:27:16 +0000 Original-Received: from localhost ([127.0.0.1]:56259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f0uFX-0008Ss-LL for submit@debbugs.gnu.org; Tue, 27 Mar 2018 15:27:15 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:37114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f0uFV-0008Si-PQ for 30955-done@debbugs.gnu.org; Tue, 27 Mar 2018 15:27:14 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w2RJRBUG013812; Tue, 27 Mar 2018 15:27:11 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id CEFA6663C5; Tue, 27 Mar 2018 15:27:10 -0400 (EDT) In-Reply-To: (Stefan Monnier's message of "Tue, 27 Mar 2018 14:46:01 -0400") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6251=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6251> : inlines <6522> : streams <1782437> : uri <2615875> 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:144657 Archived-At: > Stefan "not looking forward to debug sessions in read_key_sequence" Ha, I found the sucker! Installed, Stefan --- a/src/keyboard.c +++ b/src/keyboard.c @@ -8701,10 +8701,19 @@ follow_key (Lisp_Object keymap, Lisp_Object key) } static Lisp_Object -active_maps (Lisp_Object first_event) +active_maps (Lisp_Object first_event, Lisp_Object second_event) { Lisp_Object position - = CONSP (first_event) ? CAR_SAFE (XCDR (first_event)) : Qnil; + = EVENT_HAS_PARAMETERS (first_event) ? EVENT_START (first_event) : Qnil; + /* The position of a click can be in the second event if the first event + is a pseudo-event like `header-line` or `mode-line`. */ + if (SYMBOLP (first_event) + && EVENT_HAS_PARAMETERS (second_event) + && EQ (first_event, POSN_POSN (EVENT_START (second_event)))) + { + eassert (NILP (position)); + position = EVENT_START (second_event); + } return Fcons (Qkeymap, Fcurrent_active_maps (Qt, position)); } @@ -9016,13 +9025,14 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, starting_buffer = current_buffer; first_unbound = bufsize + 1; Lisp_Object first_event = mock_input > 0 ? keybuf[0] : Qnil; + Lisp_Object second_event = mock_input > 1 ? keybuf[1] : Qnil; /* Build our list of keymaps. If we recognize a function key and replace its escape sequence in keybuf with its symbol, or if the sequence starts with a mouse click and we need to switch buffers, we jump back here to rebuild the initial keymaps from the current buffer. */ - current_binding = active_maps (first_event); + current_binding = active_maps (first_event, second_event); /* Start from the beginning in keybuf. */ t = 0; @@ -9282,7 +9292,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, && (XBUFFER (XWINDOW (selected_window)->contents) != current_buffer)) Fset_buffer (XWINDOW (selected_window)->contents); - current_binding = active_maps (first_event); + current_binding = active_maps (first_event, Qnil); } GROW_RAW_KEYBUF;