From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: xterm [menu] key definition Date: Tue, 24 Aug 2021 22:23:40 +0200 Message-ID: <20210824202340.begmfw4xwzud6pga@Ergus> References: <20210819024728.kgnf6jmpakqdto4p.ref@Ergus> <20210819024728.kgnf6jmpakqdto4p@Ergus> <87mtp71i4s.fsf@mail.linkov.net> <20210824164036.caohbap24666ij35@Ergus> <831r6iwy4p.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6252"; mail-complaints-to="usenet@ciao.gmane.io" Cc: juri@linkov.net, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 24 22:24:50 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mIcyY-0001SS-Dd for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Aug 2021 22:24:50 +0200 Original-Received: from localhost ([::1]:44166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIcyW-0000e2-Ns for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Aug 2021 16:24:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIcy1-0008On-Ko for emacs-devel@gnu.org; Tue, 24 Aug 2021 16:24:17 -0400 Original-Received: from sonic316-12.consmr.mail.bf2.yahoo.com ([74.6.130.122]:42703) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mIcxx-0005cJ-GL for emacs-devel@gnu.org; Tue, 24 Aug 2021 16:24:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1629836651; bh=tRsEPF4VQoLYgR3T6DnCZ581Q2m5TeZ65SnuPPHCow4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=FX8Rs+Q5HbkopaFkY0lyYwOgTu1EK6W9Xrsf/JMRGT+7NVPhFqvIZMcpHY6ZuKzpY336x85/OXVQ0K0keUi8scqcC31WTeUjxUe2Zdl5E/vG7absHqHjWd2CvPttiCb9FZxdI0Zbq6kMS9ROshyOrVZeOlSOhrSNdzEZo7n1L4Z6f+GoHkiOAE0VjT/jY/Wi4WgjXbPy8s1HQGRi8AHINDCy9j/u8O06IcJs+JxdRYhJGQrMdbmvZ5DpDQTCcQxHLwXtceh7OdK1qkibZsHGguNk2y5FJaLaKB7ttnWbVQwpjpJVHVPWWapWAm7queaE7UOj51bd8QdlBk5FEIWcWw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1629836651; bh=Tx96MX7acNqzI5ngkqtw95+ACRfX0GJ9CDZ0Eo9YC8d=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=ft6Wa4J0XnKR1er0sci5RChoF2C1/d2ZzmYFsNyW0yf3oPcLmAQjQooKz5/tgaK+Q7jXQ263GOVlD4PBLIpnn1Mfiu+W4J5uUq4W3bODo5UvOH+19MkXr8SOoC4ZXQJ7Lpve/ryudpQrB6Uj4ViE9tSsyZ2Rw2CQskWz64iNspoSW3hXPlO5mt+w2IE8HxsoF/bv+gRFMvgMp7jSvfPdGfKHKTaZSsFEjsm8m63pLaEey5Q18OYseMEhjq6N2NikLdOOEN0ACvxt49DfcXs8y2Hs2lq5qvqDziQQAhFSC8vC2+yss2UlvygNXA4neZiOOxvErbBeOAzN2E7p67rqxA== X-YMail-OSG: jV.Un7MVM1lmxOOPw871Ibpr.7GQYqD.V.cJLM2XDrCtkr4g1eDrt.8jmge9MK9 Vf9dP1vJfo94KryWo.HovxwvWB7HNqBDtSZzwlg97Zie7GLlo.1ovPDQgHSVcCcJmExjEWJCTIC6 ObLaKG9FRp5iewc16vdjtQsLsuaW8pih2oArVD1aenocC_9hIp3PH3nOIwGxwXjqI6vFWZ.ZKmv5 qbsOig0vAlMg0NpqyLUng2hmP5zKvltTWjRBzUfmFMpt.IOXuGHvMP6.4iWlKXEkGRF5_3Q6e3xo RfRafe.TKNV4WmbKObGXyUKhTyrN2GpNUMPoHOgsrfn4vKyTKJnuhNSCtdp8GK71xMxXQDNgG6Se pU6V76Qh1ZMCMkg1Tm0kl7Ef1z00FiWCAqpZiChfvsD1gWEaqpXIjecjuuSNnlhJyh6o0ziwnAUQ .MHgvRV5.J1qEYCviJUag_FEEZ.MlU30rYwT4782lMSG3KLDep2NzcIvw_LxWWPvs1mmCEiHg1Gm 6tUZVtpdht9bCrS8nSrlev6EL63kcpACMxo_Y7162us8nlV4dCOIRE7sLI5.6nP_fqSxT438Ar0_ vPFRrBpZj1n1Ueb8fzhJn00Ha0Z6rP_tv6MEGc8eDdcJJm7UXfm.LosskTYlVtCDmMU4jGS3Xmui rJxerqd6MRJooo3bgGdj45Kgdt6C3BBiqoAoJvPSUCZINuLrN0JwAxhYnNrdkD.4W6QHwU1ZIm.8 Ax6TmGw4ALB_NOSS3O4BEevR0B7werkOew9SElw2BzPZW.Lj9NI8v2PsPGXs9F7icxWxLIsZp3bf BuFZFs.kX9LNSKP3hpkwn_OAO4AL43GlEmqHje4rEO X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.bf2.yahoo.com with HTTP; Tue, 24 Aug 2021 20:24:11 +0000 Original-Received: by kubenode531.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 0474a74a5c2e35e4c687fbc7ad1e6002; Tue, 24 Aug 2021 20:24:05 +0000 (UTC) Content-Disposition: inline In-Reply-To: <831r6iwy4p.fsf@gnu.org> X-Mailer: WebService/1.1.18906 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Received-SPF: pass client-ip=74.6.130.122; envelope-from=spacibba@aol.com; helo=sonic316-12.consmr.mail.bf2.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:272923 Archived-At: 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 , >> emacs-devel >> From: Ergus via "Emacs development discussions." >> >> 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 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 >https://invisible-island.net >ftp://ftp.invisible-island.net ================================= >The rest of the change, i.e. binding the menu to the 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- instead of S- and for that we have all the evidence that urxvt binds the same escape sequence to S- (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