unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: kai.grossjohann@gmx.net (Kai Großjohann)
Subject: Re: Help producing the Alt modifier
Date: Thu, 01 May 2003 13:47:39 +0200	[thread overview]
Message-ID: <84wuha6g84.fsf@lucy.is.informatik.uni-duisburg.de> (raw)
In-Reply-To: <uPZra.46360$mZ4.553032@news.xtra.co.nz> (Jeremy Bowen's message of "Thu, 01 May 2003 12:24:40 +1200")

Jeremy Bowen <jeremyb@opennw.com> writes:

> Kai Großjohann wrote:
>> What happens when you do this?
>> 
>> (global-set-key (kbd "<escape> a") 'forward-char)
>> (global-set-key (kbd "M-a") 'backward-char)
>
> It seems that ESC actually gives me ESC which is then interpreted as Meta as 
> it should be according to the docs.

Did you actually try it?

I just did "emacs -q -no-site-file", then evaled the above
expressions, then tested them.  And ESC a and M-a did different
things!

However, it only works in a window system where Emacs knows the
difference between <escape> and ESC.  These are actually different
things, though Emacs tries hard to make them behave the same.  Here's
the story:

In the old days, there were only ascii terminals, so special function
keys like ESC and RET and TAB were assigned ascii codes (27 and 13
and 9).  And the system could not distinguish ESC from Ctrl-[, nor
RET from Ctrl-M, nor TAB from Ctrl-I.

But now we have real function keys.  But to preserve the old
behavior, whereby C-m and RET always did the same thing, as did TAB
and C-i and ESC and C-[, function-key-map was invented.  It
translates <escape> into ESC (which is the same as C-[).  There is
also additional magic that makes M-x be the same as ESC x, but I
don't know how that works.  It's different magic, I think.

By explicitly binding <escape>, the automatic translation from
<escape> to ESC (via function-key-map) is shadowed.

-- 
file-error; Data: (Opening input file no such file or directory ~/.signature)

  parent reply	other threads:[~2003-05-01 11:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <brjra.39656$mZ4.458546@news.xtra.co.nz>
2003-04-29  6:51 ` Help producing the Alt modifier Klaus Zeitler
     [not found]   ` <5SBra.42419$mZ4.495512@news.xtra.co.nz>
2003-04-30  5:30     ` Klaus Zeitler
     [not found]       ` <k5Zra.46248$mZ4.552438@news.xtra.co.nz>
2003-05-03  4:24         ` Bijan Soleymani
2003-05-03 11:41           ` Marco Parrone
2003-04-30 14:26 ` Kai Großjohann
     [not found]   ` <uPZra.46360$mZ4.553032@news.xtra.co.nz>
2003-05-01 11:47     ` Kai Großjohann [this message]
2003-05-01 22:15       ` Stefan Monnier
2003-05-02 14:17         ` Ehud Karni
     [not found]         ` <mailman.5490.1051885088.21513.help-gnu-emacs@gnu.org>
2003-05-02 16:21           ` Stefan Monnier
2003-05-05  1:25         ` Alexander Nikolov
2003-05-05  6:10           ` Kai Großjohann
2003-05-10  1:24             ` Alexander Nikolov
2003-05-10 15:07               ` Alexander Nikolov
     [not found]       ` <V1jsa.49550$mZ4.583907@news.xtra.co.nz>
2003-05-02  9:16         ` Luis O. Silva
2003-05-02 12:25         ` Kai Großjohann
     [not found]         ` <mailman.5480.1051867002.21513.help-gnu-emacs@gnu.org>
     [not found]           ` <73fta.58420$mZ4.668797@news.xtra.co.nz>
2003-05-05  7:36             ` Klaus Zeitler
2003-05-06  2:53             ` Bijan Soleymani

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=84wuha6g84.fsf@lucy.is.informatik.uni-duisburg.de \
    --to=kai.grossjohann@gmx.net \
    /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.
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).