From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel,gmane.comp.lib.ncurses.bugs Subject: Re: Emacs difficulties in linux console with ncurses-6.3 caused by kcbt=\E^I. Date: Sat, 7 May 2022 10:41:46 +0000 Message-ID: References: <20220506000102.GA10144@prl-debianold-64.jexium-island.net> <83v8uizd6r.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25137"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dickey@his.com, bug-ncurses@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 07 12:43:19 2022 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 1nnHuA-0006MM-Vt for ged-emacs-devel@m.gmane-mx.org; Sat, 07 May 2022 12:43:18 +0200 Original-Received: from localhost ([::1]:55496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnHu9-0001rV-P4 for ged-emacs-devel@m.gmane-mx.org; Sat, 07 May 2022 06:43:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnHsl-000181-Pz for emacs-devel@gnu.org; Sat, 07 May 2022 06:41:52 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:56200 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1nnHsj-0003El-Qh for emacs-devel@gnu.org; Sat, 07 May 2022 06:41:51 -0400 Original-Received: (qmail 93731 invoked by uid 3782); 7 May 2022 10:41:47 -0000 Original-Received: from acm.muc.de (p2e5d55ed.dip0.t-ipconnect.de [46.93.85.237]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 07 May 2022 12:41:47 +0200 Original-Received: (qmail 3562 invoked by uid 1000); 7 May 2022 10:41:46 -0000 Content-Disposition: inline In-Reply-To: <83v8uizd6r.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:289382 gmane.comp.lib.ncurses.bugs:8546 Archived-At: Hello, Eli. On Fri, May 06, 2022 at 22:14:04 +0300, Eli Zaretskii wrote: > > Date: Fri, 6 May 2022 18:49:39 +0000 > > Cc: bug-ncurses@gnu.org, emacs-devel@gnu.org > > From: Alan Mackenzie > > > > Is there perhaps some strategy we could use in Emacs (C code) which would > > > > work around this problem with using ugly ad-hoc code? > > > I suppose you could tell Emacs to ignore kcbt (termcap kB) for Linux. > > Sorry, I mistyped there. I meant to write "withOUT using ugly ... code". > > Eli Zaretskii, the maintainer of Emacs, is against putting in special > > handling for the linux console's kcbt. > I'm not against that, I'm against doing that in term.c for all the > text-mode terminals. I misunderstood you, there, sorry. I'd misunderstood the code, and I thought (without thinking) that the translation functionality for terminfo settings would be buried deep in the C code, somewhere. > You could, for example, modify input-decode-map in lisp/term/linux.el, > and that would be OK with me, if there's no better solution for this. That's the bit I missed - that the pertinent translation into 'backtab is done by the input-decode-map. So, as you say, all that is needed is to remove the binding from that keymap. I'll take back what I said about the problem being difficult to fix. Maybe we can write an entry in PROBLEMS and leave it to the user to fix in her .emacs. Or maybe we can put code in lisp/term/linux.el ourselves. > Doing that will cause users of Emacs on the Linux console to lose > Backtab and gain M-TAB instead. Personally, I'm not sure which one is > more important, but then I don't use the Linux console. I don't know how typical I am of Linux console users, but I have my keymap set up to send a different code for - namely "\033[4}\011". This is according to a scheme developed by Kalle Niemitalo over twenty years ago, which enables one to add bindings for any key with any modifier combination. There are matching bindings in input-decode-map to interpret these prefixes. What was so painful was that typing and separately failed to combine into M-tab, and I couldn't see a way of getting around that. -- Alan Mackenzie (Nuremberg, Germany).