unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Olaf Rogalsky <olaf.rogalsky@t-online.de>
Cc: 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: Sat, 11 Nov 2017 11:44:25 +0200	[thread overview]
Message-ID: <83375lp2ti.fsf@gnu.org> (raw)
In-Reply-To: <877ev3nf5b.fsf@t-online.de> (message from Olaf Rogalsky on Tue,  07 Nov 2017 00:47:28 +0100)

> From: Olaf Rogalsky <olaf.rogalsky@t-online.de>
> Date: Tue, 07 Nov 2017 00:47:28 +0100
> 
> My patch takes place after a key translation has been performed.  It
> checks, that the key translation is not empty, (or more precisely, that
> the current event sequence is not empty),
> 
>            first_event = mock_input > 0 ? keybuf[0] : Qnil;  
>                          ^^^^^^^^^^^^^^
> 
> and if so, sets the variable first_event to the first event in the
> sequence.
> 
>            first_event = mock_input > 0 ? keybuf[0] : Qnil;  
>                                           ^^^^^^^^^
> 
> Here, all key translations where allready replaced by their
> corresponding binding.  If the current event sequence is empty,
> first_event is set to Qnil, which means that the default active keymaps
> should be used. This would be the case, if the raw key sequence was
> bound to an empty vector in a translation map.
> 
>            first_event = mock_input > 0 ? keybuf[0] : Qnil;  
>                                                       ^^^^
> 
> Now back to my original problem: mouse clicks in the mode line do not
> work correctly. xterm-mouse-mode uses the input-decode-map to translate
> special character sequences coming from xterm (starting with "\e[") into
> proper mouse events.  Without the patch, first_event is set to ?\e.
> Therefore the esc-map is used to find a binding for the mouse event,
> which of cause does not work as intended. With the patch, first_event is
> set to the mouse event and the binding in the local-map property will be
> found.
> 
> Et vola, mouse clicks in the mode line will work :-)

Thanks for the detailed explanations, they help a lot.

I have a few questions.  First, why did you need this hunk:

> @@ -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;
>  	    }

This is no longer about input-decode-map, it's about
key-translation-map.  And xterm-mouse-mode doesn't use
key-translation-map, so why change this part?

The next question is whether this patch caters correctly to features
other than xterm-mouse-mode.  The input-decode-map is used by
terminal-specific support in xterm.el and rxvt.el -- does it still
make sense to use keybuf[0] as first_event for replaying their
sequences?





  reply	other threads:[~2017-11-11  9:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 13:45 bug#29104: [PATCH]: xterm-mouse-mode clicks in the modeline dont use the keymap properties of the modeline strings Olaf Rogalsky
2017-11-06 23:47 ` Olaf Rogalsky
2017-11-11  9:44   ` Eli Zaretskii [this message]
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=83375lp2ti.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=29104@debbugs.gnu.org \
    --cc=olaf.rogalsky@t-online.de \
    /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).