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: Wed, 25 Aug 2021 11:32:12 +0200 Message-ID: <20210825093212.jliurmm3j2x7yvyk@Ergus> References: <20210819024728.kgnf6jmpakqdto4p.ref@Ergus> <20210819024728.kgnf6jmpakqdto4p@Ergus> <87mtp71i4s.fsf@mail.linkov.net> <20210824081906.lg2qt4z2snhaxnjv@Ergus> <20210824083433.GC17209@tuxteam.de> <20210824091741.heeyge3xhufujkd7@Ergus> <20210824110014.GA28734@tuxteam.de> <20210824153003.d5oakoawkqwke2yb@Ergus> <20210825070640.GB11313@tuxteam.de> 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="26050"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: tomas@tuxteam.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 25 11:33:24 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 1mIpHf-0006W7-Mu for ged-emacs-devel@m.gmane-mx.org; Wed, 25 Aug 2021 11:33:23 +0200 Original-Received: from localhost ([::1]:43600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIpHe-0000An-NK for ged-emacs-devel@m.gmane-mx.org; Wed, 25 Aug 2021 05:33:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIpH5-0007pY-Eh for emacs-devel@gnu.org; Wed, 25 Aug 2021 05:32:47 -0400 Original-Received: from sonic306-1.consmr.mail.bf2.yahoo.com ([74.6.132.40]:36169) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mIpH2-0003so-Tn for emacs-devel@gnu.org; Wed, 25 Aug 2021 05:32:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1629883962; bh=kWkaMdOeJt5sw4Vyc0PrGdLVedxo6GDZcR1i16k74Ac=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=FrupFwAxEswPqt9wvULBfdd0ud6lvzKanopRF1A6OPupJsD85iewsJV+shXP/lYI47E2TyCBm8BefvZo7d2HFxexGnnav7NRP565mZd10BOJUDumUXfR3r7TeXafEldpsCOFUpyCT5aFy2EMPXqVsTPo3KFnfZvx4NCmWkQJm8FePJw8Z0D3vvWtexhvGkCmMTKSmZEW2DrNPmF7Q8opVNL9fTYnKY9nMfkZ0VyBBSK2Rmb6TEJJL5aYG7Efi093jwKMNfmtMEIYNnA8VThrIxDuC4XNacTEQ/B33pIiqd26j5klNBxhlA5V/1cH6s/wsiIye3Bnok/4Z/X+zOTShQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1629883962; bh=IG5Eb5QPK69hSLCI8HWzLY3+tQLtJE78oIJV3bNotCk=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=NNQuwei0KWSqvDmfsHiSjrfwQKE52ua+zGN87YU0TB9zTZjTvP7FKCPoPB34gMAqxi5FOa7Xzt7uPawwNj+A/dp1Rg4nLJpFEdiM/BKKi5m4Zd1xzpv4SYRtx1AvYbTN/Rl3fW/QMPbjYnxvBDjFq2K6gtSLDmKeS0fib5tNfGos+ZEhmmCZTn+V5q8S4RvQvMFEvxbsDE8UN/9kunZZ2kz6p30GhgwdAyooc6pCueJmktInqgXN2GEzRFKfa9fKTtBvkEXSmJM/lYBtwUNn0fIh8kJBJeyirSBstiPe88mcoOXu8tiJPpuaxFdvvXknWEVOs4HIMo59qavaxdk/Sw== X-YMail-OSG: goPpXFIVM1kQT2IziWBfg6QoUnBjOjCWpimixdQ0IA1.wFfMZHMIdqiEZBtZYaf wfjjGKc15OIW1HuVIunkzftM4f.LJIMzc3oCpwf1iGvnTUNWQDCXl67xcjSSg2WPywEUmITSEeYE Jfacbc2Wz2HxcmBUEhWPCn3dMR._.B90WckLSMAM1KywFn89yNfAOW9ympGq3FiIOB13pXY5DNVF kpM3YmF_WIZj1OmOj0_BYM6xjBSVo2WOOYcoAmfEekBaKvvBZR8aFO7S0LWrFPJbq2OfxrVLQ935 bIyt9HBU9.amCuVdeopNZ7heCYDfyXy1XOqrhD3MRBNun_rwJ6ggj9EMhZ68bp4AGyr5Zz3qqTZm glZ4HlrA_BQLaNnMQfy1l3v9jBlNhUjWlkb5c95gmc2wpl8e6NwwzpmaYP0JBvuuhNWIOHgMdmYt N48gR6f_WuMUe0z4znwOqM.2xiLLmoT7PbZH0xjikq3IJfIPk9fY5M.y1t74cEowVH1IFlfQKxIT M_Py.UyVr43P27BoqIWwwfkyvaCcHtWXQwrmY0TSWrggFEOwndSjec0eHu99NTtee10iJ2f4yVm_ jBOhVNkb5D5WExYDVOKXmTeoB6nnSliENUwS.mPgX8dmPYRAtsJ6k7SxNWkKS_RS0P7gYcwcIQfl tWAqU9lFmOemZpr.2WO9q8ftjjicXkS5h8PvJ8Zx1E0DFOIlRzrmkoTOUE9WCHbrvISKA7GZAc4q 1_7vGP18GJWMOjJwWBHTlnXboXDF2KCYmrDhidBhLfu4OZ4rjEtzZaK9TaLC3Ggh7aYAxHqD4X3z vdCcmizLwzzS.zWdnZDNrVT4QN1xOdWaIXMKLOrLFX X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Wed, 25 Aug 2021 09:32:42 +0000 Original-Received: by kubenode510.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID ddef35b397bb803b2878148162345e0a; Wed, 25 Aug 2021 09:32:36 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20210825070640.GB11313@tuxteam.de> 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.132.40; envelope-from=spacibba@aol.com; helo=sonic306-1.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:272952 Archived-At: On Wed, Aug 25, 2021 at 09:06:40AM +0200, tomas@tuxteam.de wrote: >On Tue, Aug 24, 2021 at 05:30:03PM +0200, Ergus wrote: > >[...] > >> Hi! >> >> Thanks for the link! Of course we can emulate anything in xterm. The >> question is what xterm does by default? and why we bound the menu >> sequence to [print] instead of [menu] if emacs internally uses [menu] >> for execute-extended-command? > >[...] > >> If xterm assumes it is a VT220; then we must assume the same when using >> it by default (until we implement a more complex API to ask >> xterm... (but that may be inefficient and probably don't worth it for >> such a detail). > >I wouldn't expect an "xterm API". The "API" are the escape sequences :) > I meant an api to ask xterm about modifyFunctionKeys value for a general solution. For this specific case kf16=\E[29~ unconditionally; so we don't care. But there are some more values we actually support in gui (C-S-M-), but not in xterm in spite of we could (modifyFunctionKeys:2 has higher values like kf63 for those cases)... but that's another topic. Please don't start another discussion about this without finishing the previous (and simpler) one. >The best one can do, I guess, is try to convince each one of the >pseudo terminal implementors to use the same escape sequence for >each of the non-standard keys. Perhaps there already /are/ ANSI >(or some other standards body!) escape sequences. Perhaps not. > There has been a lot of work on that for decades but not a conclusion. Any way the de-facto standard for almost all the terminal emulators around (except rxvt) is to support whatever xterm does and follow xterm convention. That applies to "modern" non standard features like mouse tracking events. >> Sometimes emacs assumes there is a [menu] key but then in xterm the same >> key is interpreted as [print] by emacs. So a very comfortable key (for >> those who have it) that we can't use consistently. > >When you say "emacs assumes" you are referring to some "GUI guts"? > I am referring to what emacs understand for the same key on gui or xterm. >> Part of my intention is to minimize the "special" customization required >> when using xterm+emacs (either in Xdefaults or in init.el); any fancy >> more specific customization can be made latter by the user when he gets >> familiar with the rest of the environment (GNU/Linux, xterm, emacs, >> Elisp, the command line interface, the OS configuration system...) for >> new users it is like getting into Narnia the fist week/month. > >The lowest common denominator would be to assume that there is no >"print" (aka PrintSc) key, same for "menu", more so for "windows". > I started the thread asking because now I understand that in general the [menu] key seems to emit the same than . What I don't know is if the PrintSc does the same with a another key. The other think clear now is that \E[29~ is NOT [print]. It is either (from xterm's source code and terminfo) or [menu] (as menu key seems to emit the same X event in all the cases.) So [menu] in general seems to be a shortcut for ? Probably you know better than me about this conventions or where can be found in some X sources? >> I expect that most of the emacs features work and behave as similar as >> possible when using the xterm, tty or gui without customization, >> everything out of the box. > >That's because you have only seen one keyboard [2] :) > >BTW, just out of kicks, I tried the same experiment with the Linux >terminal (no need for the cat, just hexdump will do, btw), and it >also doesn't translate "print" into any escape sequence. So this >isn't limited to X terminal emulators. > >If you want consistency across the terminal emulators *and* you >want print (and/or menu...) *and* you want it out of the box, you >better start sending config [1] patches to all the term emulators >out there :-) > >Cheers > >[1] https://en.wikipedia.org/wiki/ANSI_escape_code >[2] not meant personally: we are just witnessing a curious "inversion". > At the time those terminal emulators were designed, there was a > *huge* variety of keyboards and few emulators, these days it's > the other way around. PC has won, and if Microsoft says "we wanna > have one key, because Apple also haz one", then everyone has a > Windows key. Actually they got two, because Apple had two). >[3] if the implementors were as wise as xterm's and put those tidbits > into some config, that is > > - t