unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Leo <sdl.web@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Adding xterm-extras to Emacs
Date: Fri, 12 Oct 2007 12:18:38 -0400	[thread overview]
Message-ID: <jwvfy0g73zg.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m2d4vkajhv.fsf@cam.ac.uk> (Leo's message of "Fri\, 12 Oct 2007 08\:18\:36 +0100")

>>> However, Alt+Ctrl+Right is shown as "<C-M-right>" but not "<C-A-right>"
>>> while Alt+Right is shown as "<A-right>" but not <M-right>. You can see
>>> they are _INCONSISTENT_.
>> 
>> Can you check C-h l as well to see if Alt+Ctrl+Right sends ESC followed by
>> the escape sequence for Ctrl+Right and if Alr+Right does the same.
>> If not, then the inconsistency is in xterm and should be reported there
>> (after reporting there, we may also decide to workaround the problem in
>> Emacs by binding those escape sequences to M-right instead).

> Yes, it looks like Alt+Ctrl+Right and Alt+Right send ESC.

> Alt+Ctrl+Right  ^[[1;7C
> Alt+Right       ^[[1;3C

You mean "it looks like they *don't*"!  The ESC you see are the first char
of an escape sequence, not standalone ESC characters.

What "metaSendsEscape" is supposed to do is to turn Alt+A into ESC A, so if
Right sends ^[[C (aka ESC [ C), then Alt+Right should send ^[^[[C (aka ESC
ESC [ C).  Please report this as a feature request to xterm's maintainers.

But looking at lisp/xterm.el now I see that we indeed inconsistently map
things to S-M-foo but A-foo, so the inconsistency is our fault and should be
corrected with the patch below,


        Stefan


--- xterm.el	09 oct 2007 01:14:42 -0400	1.51
+++ xterm.el	12 oct 2007 11:28:38 -0400	
@@ -89,18 +89,18 @@
     (define-key map "\e[23;6~" [C-S-f11])
     (define-key map "\e[24;6~" [C-S-f12])
 
-    (define-key map "\eO3P" [A-f1])
-    (define-key map "\eO3Q" [A-f2])
-    (define-key map "\eO3R" [A-f3])
-    (define-key map "\eO3S" [A-f4])
-    (define-key map "\e[15;3~" [A-f5])
-    (define-key map "\e[17;3~" [A-f6])
-    (define-key map "\e[18;3~" [A-f7])
-    (define-key map "\e[19;3~" [A-f8])
-    (define-key map "\e[20;3~" [A-f9])
-    (define-key map "\e[21;3~" [A-f10])
-    (define-key map "\e[23;3~" [A-f11])
-    (define-key map "\e[24;3~" [A-f12])
+    (define-key map "\eO3P" [M-f1])
+    (define-key map "\eO3Q" [M-f2])
+    (define-key map "\eO3R" [M-f3])
+    (define-key map "\eO3S" [M-f4])
+    (define-key map "\e[15;3~" [M-f5])
+    (define-key map "\e[17;3~" [M-f6])
+    (define-key map "\e[18;3~" [M-f7])
+    (define-key map "\e[19;3~" [M-f8])
+    (define-key map "\e[20;3~" [M-f9])
+    (define-key map "\e[21;3~" [M-f10])
+    (define-key map "\e[23;3~" [M-f11])
+    (define-key map "\e[24;3~" [M-f12])
 
     (define-key map "\eO4P" [M-S-f1])
     (define-key map "\eO4Q" [M-S-f2])
@@ -164,12 +164,12 @@
     (define-key map "\e[1;8F" [C-M-S-end])
     (define-key map "\e[1;8H" [C-M-S-home])
 
-    (define-key map "\e[1;3A" [A-up])
-    (define-key map "\e[1;3B" [A-down])
-    (define-key map "\e[1;3C" [A-right])
-    (define-key map "\e[1;3D" [A-left])
-    (define-key map "\e[1;3F" [A-end])
-    (define-key map "\e[1;3H" [A-home])
+    (define-key map "\e[1;3A" [M-up])
+    (define-key map "\e[1;3B" [M-down])
+    (define-key map "\e[1;3C" [M-right])
+    (define-key map "\e[1;3D" [M-left])
+    (define-key map "\e[1;3F" [M-end])
+    (define-key map "\e[1;3H" [M-home])
 
     (define-key map "\e[2~" [insert])
     (define-key map "\e[3~" [delete])
@@ -206,10 +206,10 @@
     (define-key map "\e[5;8~" [C-M-S-prior])
     (define-key map "\e[6;8~" [C-M-S-next])
 
-    (define-key map "\e[2;3~" [A-insert])
-    (define-key map "\e[3;3~" [A-delete])
-    (define-key map "\e[5;3~" [A-prior])
-    (define-key map "\e[6;3~" [A-next])
+    (define-key map "\e[2;3~" [M-insert])
+    (define-key map "\e[3;3~" [M-delete])
+    (define-key map "\e[5;3~" [M-prior])
+    (define-key map "\e[6;3~" [M-next])
 
     (define-key map "\e[4~" [select])
     (define-key map "\e[29~" [print])
@@ -425,18 +425,18 @@
     (define-key map [f47] [C-S-f11])
     (define-key map [f48] [C-S-f12])
 
-    (define-key map [f49] [A-f1])
-    (define-key map [f50] [A-f2])
-    (define-key map [f51] [A-f3])
-    (define-key map [f52] [A-f4])
-    (define-key map [f53] [A-f5])
-    (define-key map [f54] [A-f6])
-    (define-key map [f55] [A-f7])
-    (define-key map [f56] [A-f8])
-    (define-key map [f57] [A-f9])
-    (define-key map [f58] [A-f10])
-    (define-key map [f59] [A-f11])
-    (define-key map [f60] [A-f12])
+    (define-key map [f49] [M-f1])
+    (define-key map [f50] [M-f2])
+    (define-key map [f51] [M-f3])
+    (define-key map [f52] [M-f4])
+    (define-key map [f53] [M-f5])
+    (define-key map [f54] [M-f6])
+    (define-key map [f55] [M-f7])
+    (define-key map [f56] [M-f8])
+    (define-key map [f57] [M-f9])
+    (define-key map [f58] [M-f10])
+    (define-key map [f59] [M-f11])
+    (define-key map [f60] [M-f12])
 
     map)
   "Keymap of possible alternative meanings for some keys.")

  reply	other threads:[~2007-10-12 16:18 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-12 22:03 Adding xterm-extras to Emacs Leo
2007-06-12 22:21 ` Dan Nicolaescu
2007-06-12 22:31   ` Leo
2007-06-12 22:43     ` Dan Nicolaescu
2007-06-12 23:32       ` Leo
2007-06-13  0:47         ` Dan Nicolaescu
2007-06-13  0:56           ` Leo
2007-06-13  3:52             ` Dan Nicolaescu
2007-06-13 10:54               ` Johan Bockgård
2007-06-13 13:22                 ` Dan Nicolaescu
2007-06-13 16:18                   ` Johan Bockgård
2007-06-13 19:09                     ` Dan Nicolaescu
2007-06-13  7:08           ` csant
2007-06-13 13:33             ` Dan Nicolaescu
2007-06-13 19:18               ` csant
2007-06-13  9:43           ` Peter Heslin
2007-06-13 14:15             ` Dan Nicolaescu
2007-06-13 15:31               ` Stefan Monnier
2007-06-14  5:08                 ` Dan Nicolaescu
2007-09-13 16:40                   ` Leo
2007-09-13 16:58                     ` Dan Nicolaescu
2007-09-13 19:49                       ` Leo
2007-09-14  1:02                         ` Dan Nicolaescu
2007-09-14  1:20                           ` Leo
2007-09-14  1:30                             ` Dan Nicolaescu
2007-09-14  1:47                               ` Leo
2007-09-14  2:32                                 ` Dan Nicolaescu
2007-09-14  8:02                                   ` Leo
2007-09-14 16:38                                     ` Dan Nicolaescu
2007-09-14 22:29                                       ` Leo
2007-09-15  0:32                                         ` Dan Nicolaescu
2007-09-21 10:15                                           ` Leo
2007-09-21 13:51                                             ` Dan Nicolaescu
2007-10-11 16:26                                               ` Leo
2007-10-11 17:08                                                 ` Dan Nicolaescu
2007-10-11 17:39                                                   ` Leo
2007-10-11 17:42                                                 ` Stefan Monnier
2007-10-11 17:48                                                   ` Leo
2007-10-11 20:12                                                     ` Stefan Monnier
2007-10-11 20:27                                                       ` Leo
2007-10-12  1:11                                                         ` Stefan Monnier
2007-10-12  7:18                                                           ` Leo
2007-10-12 16:18                                                             ` Stefan Monnier [this message]
2007-10-13 10:37                                                               ` Leo
2007-10-13 10:45                                                   ` Leo
2007-09-15  1:27                                         ` Stefan Monnier
2007-09-21 10:11                                           ` Leo
2007-09-21 10:22                                             ` Andreas Schwab
2007-09-21 10:33                                               ` Leo
2007-09-21 11:23                                                 ` Andreas Schwab
2007-09-14 14:04                                   ` Stefan Monnier
2007-09-14 14:13                                     ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvfy0g73zg.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=sdl.web@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).