From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: Slightly OT: Where are keycodes defined for emacs -nw in X-Windows? Date: Sun, 26 Oct 2003 10:19:05 +0000 Organization: muc.de e.V. -- private internet access Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1067165262 328 80.91.224.253 (26 Oct 2003 10:47:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 26 Oct 2003 10:47:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 26 11:47:39 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ADiQs-0001E6-00 for ; Sun, 26 Oct 2003 11:47:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ADiPv-0006pq-Px for geh-help-gnu-emacs@m.gmane.org; Sun, 26 Oct 2003 05:46:39 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!news.f.de.plusline.net!feed.news.nacamar.de!news.space.net!news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 67 Original-NNTP-Posting-Host: acm.muc.de Original-X-Trace: marvin.muc.de 1067164186 71782 193.149.49.134 (26 Oct 2003 10:29:46 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: 26 Oct 2003 10:29:46 GMT User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686)) Original-Xref: shelby.stanford.edu gnu.emacs.help:117615 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:13547 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13547 Stefan Monnier wrote on Fri, 24 Oct 2003 20:15:24 GMT: >> Searching the info pages brought me to the page "Terminal Specific" in >> the Elisp manual. Checking the environment variable TERM brought me >> to the initalisation file ...../lisp/term/xterm.el. In this file, >> only a small number (21) of function keys are defined, none of them >> with modifiers (i.e. C- M- S- ....). Thanks Stefan, thanks Barry, for chrystal clear answers in record time! > The sequences are poorly standardized, especially the ones with > modifiers. That's why they're absent mostly. But since it generally > doesn't hurt to add bindings to that table (as long as there's no > collision between two different bindings for the same sequence), feel > free to send patches to complete the table. On my xterm, the modifier keys get filtered out, so that C-up and up degenerate into the same event sequence. :-( >> Where on X is the file which defines the relevant keytable, and what's >> the name of the function in X which loads such a table (analogues of >> /etc/default.keytab and loadkeys for the Linux console)? > X is not directly at fault. The translation from C-up to a sequence of > ASCII codes is done by your terminal emulator, so you need to look at > the doc of your xterm, kterm, what-have-you-term, ... [... several frustrating hours later ... ]. The documentation of xterm is of lesser quality than that of Emacs. As well as its man-page, I've got an introductory users' guide to X (a book). It goes on and on and on about the syntax of "resources" (whatever they are), but doesn't seem to say whether they are compiled in with the application, are loaded from some file, or what. It spends nearly 30 pages (not counting a dump of the complete man-page) describing xterm, yet fails to say where to find the keyboard translation table used, or even give any pointers. After all, who'd want to know that anyway? The glossary in this book lacks an entry for "resource", presumably on the grounds that everybody knows what one is anyway, and an accurate definition might spoil that nice warm feeling that you're meant to get because "you've got lot's of resources, therefore you must be very wealthy". However, the glossary _does_ have an entry for "mouse", useful for those people who don't know what that moveable lump of plastic beside their keyboards is called. <\rant mode> Obviously the place to carry this on would be an X newsgroup, not here. > Then Emacs turns those sequences back into meaningful events based on > the lisp/term/$TERM.el file but also based on the terminfo of your > terminal. Yes. I'm begining to wish I hadn't asked the question. Obviously if I want to get anywhere, I'm going to have to spend a _lot_ of time learning about X. That would be a lot of time not available for hacking Emacs. :-( Thanks anyhow! > Stefan -- Alan Mackenzie (Munich, Germany) Email: aacm@muuc.dee; to decode, wherever there is a repeated letter (like "aa"), remove half of them (leaving, say, "a").