From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Input for TTY menus Date: Mon, 23 Sep 2013 16:18:02 +0300 Message-ID: <83r4cfismt.fsf@gnu.org> References: <831u4llymo.fsf@gnu.org> <83vc1wlsp3.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1379942295 458 80.91.229.3 (23 Sep 2013 13:18:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Sep 2013 13:18:15 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 23 15:18:18 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VO61m-0006Qs-3U for ged-emacs-devel@m.gmane.org; Mon, 23 Sep 2013 15:18:14 +0200 Original-Received: from localhost ([::1]:40626 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO61l-00059x-7c for ged-emacs-devel@m.gmane.org; Mon, 23 Sep 2013 09:18:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO61c-00059o-FG for emacs-devel@gnu.org; Mon, 23 Sep 2013 09:18:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VO61T-0001J6-1V for emacs-devel@gnu.org; Mon, 23 Sep 2013 09:18:04 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:61768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO61S-0001Iy-Ps for emacs-devel@gnu.org; Mon, 23 Sep 2013 09:17:54 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MTK00D00Y7IZY00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Mon, 23 Sep 2013 16:17:53 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MTK00DOBY9QA6B0@a-mtaout20.012.net.il>; Mon, 23 Sep 2013 16:17:50 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163578 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > Date: Thu, 19 Sep 2013 15:21:17 -0400 > > >> read_char won't handle the arrow keys. To handle the arrow keys you > >> need to use read_key_sequence > > Thanks. This means I'll probably need to clone some small subset of > > the code in command_loop_1 after it calls read_key_sequence, in order > > to process the key sequence, right? > > I don't think there's much to do there, but clearly you'll want to do > something with the sequence, indeed. Although you might like to simply > setup your keymaps in such a way that you can just use > read_key_sequence_cmd (which should usually be the same as (key-binding > ), except when the keymaps are dynamic and might change between > the time they were read by read_key_sequence and the call to > key-binding) to know what operation to perform. > > >> (probably after setting up some overriding-terminal-local-map). > > What would be the purpose of overriding-terminal-local-map in this > > case? > > The key sequences read by read_key_sequence depend on the currently > active keymaps to decide when a key sequence is complete (i.e. when to > stop reading subsequent events). Is it OK to bind keys in overriding-terminal-local-map to symbols whose function cell is void? (The C code interprets these symbols when they are delivered by read_key_sequence via read_key_sequence_cmd.) It seems to work, but I wonder if that is just be sheer luck, and should be discouraged for some reason.