emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xterm [menu] key definition


From: Ergus
Subject: Re: xterm [menu] key definition
Date: Tue, 24 Aug 2021 22:23:40 +0200

On Tue, Aug 24, 2021 at 08:28:22PM +0300, Eli Zaretskii wrote:
Date: Tue, 24 Aug 2021 18:40:36 +0200
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
 emacs-devel <emacs-devel@gnu.org>
From:  Ergus via "Emacs development discussions." <emacs-devel@gnu.org>

Just to clarify.

What I am proposing is as simple as the attached patch.

I won't expect any complain about the change, but if so we then may
decide to do something like an alias between [menu] and [print]:

Hi Eli:

It is fine for me. Actually I didn't add the [PATCH] flag to the Subject
of the message because the patch was only to illustrate the proposal
with specific code, not more and more words and explications.


Look, we need some kind of evidence that this is TRT, some document
that describes that key, or explains why urxvt and xterm behave
differently, or who and why made the current code as it is.  We cannot
make this change in xterm.el just because you think it's right and it
suits your personal system configuration.  The code we have wins by
default, unless you can come up with a clear reason explaining why it
is wrong.


I am not saying the current code is wrong. Just that the so called
[print] key does not exist while the same key is seen as [menu] in gui.

I expect that emacs user gets the similar behavior when they press the
menu key. Either in tty, tui or gui... or at least as consistent as
possible. (either redefining ^[[29~ as [menu] or binding the context
menu to [print]... I have already this on my config... obviously I
prefer the first alternative)

I already wrote to Thomas Dickey (xterm maintainer) some days ago about
this:

=================================

On Wed, Aug 18, 2021 at 08:38:44PM -0400, Thomas Dickey wrote:
On Wed, Aug 18, 2021 at 09:46:53PM +0200, Ergus wrote:
Hi:

I use emacs and I have noticed that when using xterm and I press the
menu key, emacs is detecting <print> instead. (emacs just added a
context menu and it could be probably bind to the menu key)

cat shows that xterm sends ^[[29~ But I can't find information if this
is the right one or how to debug this.

hmm - I didn't notice, but in a quick check the key which I guessed is
"menu" (between the Windows key and the Ctrl key on the right-side of
my keyboard) does send ^[[29~ and xev says that's "Menu":

--------------------------------------------------------------------------------
KeyPress event, serial 34, synthetic NO, window 0xc00001,
   root 0x111, subw 0xc00002, time 60750193, (37,34), root:(37,57),
   state 0x0, keycode 118 (keysym 0xff67, Menu), same_screen YES,
   XLookupString gives 0 bytes:
   XmbLookupString gives 0 bytes:
   XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0xc00001,
   root 0x111, subw 0xc00002, time 60750321, (37,34), root:(37,57),
   state 0x0, keycode 118 (keysym 0xff67, Menu), same_screen YES,
   XLookupString gives 0 bytes:
   XFilterEvent returns: False

KeyPress event, serial 34, synthetic NO, window 0xc00001,
   root 0x111, subw 0xc00002, time 60750537, (37,34), root:(37,57),
   state 0x0, keycode 118 (keysym 0xff67, Menu), same_screen YES,
   XLookupString gives 0 bytes:
   XmbLookupString gives 0 bytes:
   XFilterEvent returns: False
--------------------------------------------------------------------------------

But in the terminal description, I'd not assigned anything to that.
It's not a numbered function key, and terminfo doesn't have a standard
"menu" key (I could add one, but had overlooked this :-).

Emacs does.  Someone was telling me recently about something related
to xterm, so I've a current source.  In that, I see this, with grep:

lisp/term/lk201.el:35:    (define-key map "\e[29~" [menu])
lisp/term/xterm.el:353:    (define-key map "\e[29~" [print])
lisp/term/rxvt.el:67:    (define-key map "\e[29~" [S-f6])

which is kind of old (git blame tells me):

0ba6bcb1d6e (Stefan Monnier    2007-09-07 19:47:46 +0000  353)

but the first match shows the binding that you'd like to have.

I don't use emacs, but suppose that you can add that definition
to your custom settings, and get the menu that you expect.

--
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net

=================================

The rest of the change, i.e. binding the menu to the <menu> key, is
fine by me.  But not the change in xterm.el, not without a very good
explanation.

Okay?

The other change I propose is the S-<f6> instead of S-<f10> and for that
we have all the evidence that urxvt binds the same escape sequence to
S-<f6> (since we do:

lisp/term/rxvt.el:67:    (define-key map "\e[29~" [S-f6])

and "\e[29~" is what the menu key sends by default)

Otherwise we will need to request to all the compatible terminals around
to update their terminfo.. a very long process that will delay for years
until all the systems in all the servers will be updated.

Best,
Ergus


reply via email to

[Prev in Thread] Current Thread [Next in Thread]