all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: XeCycle <XeCycle@Gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: define-key turns to go the wrong way.
Date: Thu, 04 Apr 2013 17:05:37 +0800	[thread overview]
Message-ID: <87eheqacny.fsf@xc.laptop> (raw)
In-Reply-To: b2652296-7ec9-400b-92a1-fd2f01707480@googlegroups.com

[-- Attachment #1: Type: text/plain, Size: 1211 bytes --]

Peng Dai <daipeng123456@gmail.com> writes:

> I use ubuntu12.04(32bit,US), and emacs24.2. When I descide to have a new key
> "\C-[" and "\C-]" to scroll my window,
>
> so I write the following in the init.el
>
> (global-set-key (kbd "\C-]") (lambda () (interactive) (scroll-up 2)))
> (global-set-key (kbd "\C-[") (lambda () (interactive) (scroll-down 2)))

Minor mistake: when using kbd, you're expected to write "C-]"
without the backslash.

> this first is work fine. but the second didn't work.
> When I use the "\C-h k" to see what' wrong. It turn out to be
> "\C-[" was readed as "<ECS>". I search the google with no result,
> it says it was because of the ISCAE's key value but with no
> soluvation give.

Yes.  "C-[" *is* <ESC>, at least on terminals.  Emacs is designed
to be compatible with terminals, so it's unlikely to get changed.

> And I find another key has the same problem,too. like:
> "\C-j" turn to be "<SPACE>"
> "\C-M-j" turn to be "<RET>j"

DO NOT ESCAPE CTRL OR META WHEN USING `kbd'.

-- 
Carl Lei (XeCycle)
Department of Physics, Shanghai Jiao Tong University
OpenPGP public key: 7795E591
Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

  reply	other threads:[~2013-04-04  9:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-04  1:45 define-key turns to go the wrong way Peng Dai
2013-04-04  9:05 ` XeCycle [this message]
2013-04-04  9:31 ` Peter Dyballa

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

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

  git send-email \
    --in-reply-to=87eheqacny.fsf@xc.laptop \
    --to=xecycle@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.