[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master 6fdc3fa: Support terminal focus notifications
From: |
Stefan Monnier |
Subject: |
Re: [Emacs-diffs] master 6fdc3fa: Support terminal focus notifications |
Date: |
Sat, 09 Jun 2018 15:05:01 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> handle-focus-{in,out} have an interactive specification that makes them
> not work when bound directly to the synthetic event --- which seems silly,
> since we never actually use the event --- but I didn't want to touch the
> existing focus code.
Ah, right. We can fix the interactive spec not to signal an error.
>>> +(define-key global-map [xterm-focus-in] #'xterm-handle-focus-in)
>>> +(define-key global-map [xterm-focus-out] #'xterm-handle-focus-out)
>>
>> I think this deserves a comment explaining why we don't use the
>> pre-existing `focus-in` and `focus-out` events and why we bind our
>> events in global-map rather than in special-map (as is done for
>> `focus-in/out` events).
>
> I was being consistent with the xterm-paste event. All three events should
> go in special-map if that's the right place, shouldn't they?
The decision should not be based on the fact that they all come
from xterm. I think xterm-paste wouldn't be right on special-map.
But to tell you the truth, I'm not completely sure what should go on
special-map and what shouldn't.
> It doesn't seem to make a difference in this case.
I think it makes a difference if you do:
C-x <focus-out> <focus-in> C-c
[ My general rule of thumb for special-map is to think about what
should happen if such events happen in the middle of
a key-sequence. ]
Stefan