From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: usenet@heslin.eclipse.co.uk (Peter Heslin) Newsgroups: gmane.emacs.help Subject: Re: can't global-set-key in emacs -nw Date: 2 Feb 2004 13:04:07 -0800 Organization: http://groups.google.com Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1075757249 13639 80.91.224.253 (2 Feb 2004 21:27:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 2 Feb 2004 21:27:29 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 02 22:27:09 2004 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 1Anlb2-0003w9-00 for ; Mon, 02 Feb 2004 22:27:09 +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 1AnlQd-0003EG-Qm for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Feb 2004 16:16:23 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 72 Original-NNTP-Posting-Host: 213.152.32.235 Original-X-Trace: posting.google.com 1075755847 22220 127.0.0.1 (2 Feb 2004 21:04:07 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 2 Feb 2004 21:04:07 +0000 (UTC) Original-Xref: shelby.stanford.edu gnu.emacs.help:120633 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:16581 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16581 Stefan Monnier wrote in message news:... > >> Once your terminal emulator is properly configured you need to tell Emacs > >> what that seuqnce is by appropriate (define-key function-key-map ...) calls. > >> See lisp/term/xterm.el for some default settings used if your terminal > >> is xterm. The same terminal emulator may send different sequences > >> depending on the configuration, so there's no standard sadly. > > > Assuming the user has not changed any escape sequences via resources > > settings, is this still really the case? > > Well, yes, it seems. Hi Stefan, I decided to check on this. I went and downloaded the current source of xterm from http://dickey.his.com/xterm/xterm.html, and there is a document with it called ctlseqs.ms, which confirms that the behavior I am seeing on my system is the documented, correct behavior of current xterm. It has the following statement:: In normal mode, i.e., a Sun/PC keyboard when the sunKeyboard resource is false, xterm recognizes function key modifiers which are parameters appended before the final character of the control sequence. Code Modifiers --------------------------------- 2 Shift 3 Alt 4 Shift + Alt 5 Control 6 Shift + Control 7 Alt + Control 8 Shift + Alt + Control --------------------------------- For example, shift-F5 would be sent as CSI 1 5 ; 2 ~ If the alwaysUseMods resource is set, the Meta modifier also is recog­ nized, making parameters 9 through 16. In other words, all of these combinations of modifiers on function keys send distinct and documented escape sequences that Emacs could and should interpret correctly. So I think we should regard systems on which xterm behaves differently as broken. I think it's more likely that it's just that some distributions have older versions of xterm stuck in them out of inertia, rather than that they are deliberately wanting different behavior. I would be happy to work on adding these escape sequences to term/xterm.el, if you think such a patch would be acceptable in principle. My only question would be the Alt/Meta issue. Xterm clearly regards Alt as the more important key, with Meta available additionally on some systems where the alwaysUseMods resource is set. This might be taken to imply that the Alt combinations that xterm sees ought to be translated to Emacs Meta, which is the more important key for Emacs. But then people who have and use both Alt and Meta keys would probably not like to see them switched around when using xterm. Is there a way that we could have the best of both worlds? In other words, can we send Alt to Emacs as Alt and Meta as Meta, but have it easy for users who just use the Alt key as a Meta key not to have to duplicate all of their Meta-Fx bindings as Alt-Fx also, just to work under xterm? I suspect that I'm not the only one who would like to have it so that Emacs just treats my Alt key as Meta both under X and in xterm. Peter