unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Olaf Rogalsky <olaf.rogalsky@t-online.de>
To: 29104@debbugs.gnu.org
Subject: bug#29104: [PATCH]: xterm-mouse-mode clicks in the modeline dont use the keymap properties of the modeline strings
Date: Wed, 01 Nov 2017 14:45:32 +0100	[thread overview]
Message-ID: <87zi869koz.fsf@t-online.de> (raw)

1. emacs -Q -nw
2. M-x xterm-mouse-mode RET
3. mouse-1 click on the `*scratch*' string of the modeline.
4. Nothing happens. Expected behaviour would be, to change to the next buffer `*Messages*'.

This seems to be a bug in `keyboard.c:read_key_sequence'. After reading
the first characters of the xterm click event, they are remapped with
`keyremap_step' at line 9605 using the `input-decode-map'. The result of
this is a mouse-1 event structure, which carries the correct click
position. Unfortunately, this position isn't used, but instead, at line
9035, the position of the variable `first_event' is used.

The following patch sets `first_event' (after a key translation /
remapping) to the remapped event.

diff --git a/src/keyboard.c b/src/keyboard.c
index ee353d2b07..acb9c6be95 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -9607,6 +9607,8 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
 	  if (done)
 	    {
 	      mock_input = diff + max (t, mock_input);
+              first_event = mock_input > 0 ? keybuf[0] : Qnil;
+
 	      goto replay_sequence;
 	    }
 	}
@@ -9647,6 +9649,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
 		/* Adjust the input-decode-map counters.  */
 		indec.end += diff;
 		indec.start += diff;
+                first_event = mock_input > 0 ? keybuf[0] : Qnil;
 
 		goto replay_sequence;
 	      }
@@ -9669,6 +9672,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
 	      indec.start += diff;
 	      fkey.end += diff;
 	      fkey.start += diff;
+              first_event = mock_input > 0 ? keybuf[0] : Qnil;
 
 	      goto replay_sequence;
 	    }


-- 
Olaf Rogalsky
Schwörhausgasse 5
89073 Ulm
Germany





             reply	other threads:[~2017-11-01 13:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 13:45 Olaf Rogalsky [this message]
2017-11-06 23:47 ` bug#29104: [PATCH]: xterm-mouse-mode clicks in the modeline dont use the keymap properties of the modeline strings Olaf Rogalsky
2017-11-11  9:44   ` Eli Zaretskii
2017-11-13 11:33     ` bug#29104: AW: " olaf.rogalsky
2017-11-13 13:57     ` olaf.rogalsky
2017-11-19  4:24       ` Stefan Monnier
2017-11-19 15:50         ` Eli Zaretskii
2017-11-20 13:26           ` Stefan Monnier
2017-11-20 17:15             ` Eli Zaretskii
2017-11-20 18:06               ` Stefan Monnier
2017-11-19 21:14         ` Olaf Rogalsky
2017-11-18  9:52   ` Eli Zaretskii
2017-11-18 14:43     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zi869koz.fsf@t-online.de \
    --to=olaf.rogalsky@t-online.de \
    --cc=29104@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).