From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: input-decode-map: Silently ignore certain sequences Date: Fri, 14 Dec 2018 02:10:39 +0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1544728140 9405 195.159.176.226 (13 Dec 2018 19:09:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 13 Dec 2018 19:09:00 +0000 (UTC) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 13 20:08:56 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gXWLw-0002NH-4e for ged-emacs-devel@m.gmane.org; Thu, 13 Dec 2018 20:08:56 +0100 Original-Received: from localhost ([::1]:54383 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXWO2-0004Ua-Ns for ged-emacs-devel@m.gmane.org; Thu, 13 Dec 2018 14:11:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXWNp-0004Tl-TM for emacs-devel@gnu.org; Thu, 13 Dec 2018 14:10:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXWNo-0007Zn-RL for emacs-devel@gnu.org; Thu, 13 Dec 2018 14:10:53 -0500 Original-Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]:41157) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gXWNo-0007YE-JT for emacs-devel@gnu.org; Thu, 13 Dec 2018 14:10:52 -0500 Original-Received: by mail-ot1-x32c.google.com with SMTP id u16so2973781otk.8 for ; Thu, 13 Dec 2018 11:10:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=atkrUxn8GuPwZFlSeSi5zYfx7nze07/CUfzh6rFqBlQ=; b=FFaImchrIcvD7snEeYaRc/8D0Erj0oBUV3aMRNDElRpcNA3N4NyjGSJmIWyoxYBBVL gfeK8wbrasXgaDWuD649cl0bgsQGL+HUq485vkriNCMyH/uQDZv+jX66gRzVkWjC+gox KtyhZztkcY+Is9jjwnvLmnQfyNlKKO3FUZYzyBV0fO/whzQRlQv5XCPvyqQ1Pht3Cy9e kdadksVIxV5fX6CclWyuNnQyrF3M7u1FURnveitiGM3oAN1JfBE2f0DRHGAW1clkd4f0 z2oZNsfyo0fTH3avUcpyzIitZYpuV9rbpbCQaN8kLQ+euR2yvbUkPWSyGsnLbKSwLSic DpLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=atkrUxn8GuPwZFlSeSi5zYfx7nze07/CUfzh6rFqBlQ=; b=VVJBgtiq8HBuoJScMr5zqbxCJ8E4wn0qp6en9Z6oIGnGN5F8oXumLsiEDKzaCI8ffB tP0jSn9t8iQk4MezB7tqdOTgQMkQgbCPGYn911w5F9N2ZIh9HAX/t3MvLfSHx19lgBYf iSokB01pD+0HX/y+uDN5ukvlcdpMBoaQmTRrLH5vu2ebjLxtLLb6AdmffuR/yAvhCxfx tnOcs0yKJxkwmElbLevRog5GiVORyKwUxqIarE11V6X8yjAYu4i3OGDbajlX3bQwWcKa ZLdk5pKGEsloT2hDbX0mhZlDQgCbWPJk+NakBM3I2KPNZ93MhLyQ8UfFAUCaJBPnN1i6 sKNA== X-Gm-Message-State: AA+aEWbGekycwqhnFokeMc6T3VpTMOurVYA5+YIYrCAWGEPAAhbCN+C4 LAcoRani0N8XPPL/lLisie8WbLd2Q1/XfIew67db+JYb X-Google-Smtp-Source: AFSGD/XSJWJ3wAL0WFAJ0h5qVX6HDkFdVJa3G1kcUa094B2wEKKjvwoCQUd3ikdTfujMsbxF3GFUSQSTZx1DnzZQNPc= X-Received: by 2002:a9d:6419:: with SMTP id h25mr26328otl.34.1544728251418; Thu, 13 Dec 2018 11:10:51 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::32c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:231801 Archived-At: Hello emacs-devel, I am trying to implement an input-decode-map for the Kitty terminal emulator [1], specifically, for its full keyboard mode extension [2]. This would solve one of the two major deficiences of Emacs in a terminal emulator, namely, the inability to distinguish many keystrokes. (The other one, lack of full color, is also solved by Kitty, with the right terminfo modifications.) In the full keyboard mode, the terminal passes to the application *all* keystrokes, in a very machine-friendly format. That is, for events other than character input (i.e. normal characters, shifted characters, Enter, Tab, and Backspace), it sends an escape sequence containing a key code, a modifier bit mask, and whether the key was pressed, released, or autorepeated. This is a bit too much for an application such as Emacs; in particular, it is not interested in key release events, or events regarding modifier keys. To give an example, Kitty sends the sequence =E2=80=9CESC _ K p A B b ESC \= =E2=80=9D for the event =E2=80=9CLeft Alt pressed=E2=80=9D. I can get Emacs to ignore this sequence by doing this: (define-key input-decode-map "\e_KpABb\e\\" []) However, input decoding is accompanied by echoing the current key sequence prefix, and when the sequence is complete, Emacs clears the echo area. With key release events, this happens *a lot*. This is suboptimal because sometimes Emacs asks a question in the echo area and waits for a key. For example, when the user presses C-x C-c, (kill-emacs) may ask whether to save files. Then the release event for C-c comes, and the echo area is cleared. Is there a way to turn off echoing for prefixes of sequences matched against input-decode-map, so that echoing still works for =E2=80=9Cmanual= =E2=80=9D key sequences but not sequences sent by the terminal? If not, would such an option be considered useful? [1]: https://sw.kovidgoyal.net/kitty/ [2]: https://sw.kovidgoyal.net/kitty/protocol-extensions.html#keyboard-hand= ling