help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BACKSPACE in GNU-EMACS editor


From: Stefan Monnier
Subject: Re: BACKSPACE in GNU-EMACS editor
Date: Thu, 10 Feb 2005 09:49:32 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

> i got it working....how about the arrow keys on the keyboard
> (up/down/right/left), do you have any samples ?

> i tried this...but no luck:

> (global-set-key [up] 'previous-line)
> (global-set-key [down] 'next-line)
> (global-set-key [right] 'forward-char)
> (global-set-key [left] 'backward-char)

Note that both the backspace thingy you asked before and these cursor
motions are already the default behavior.

I.e. in your case the problem is not that Emacs's key bindings do not suit
you, but that for some reason Emacs does not properly recognize the keys
you're using.

In such a case `global-set-key' is not the right answer (although it can
work).  You want to use instead:

        (define-key function-key-map [foo] [bar])

where [foo] is the key-sequence that Emacs thinks he receives and [bar] is
the corrected key sequence.  Try to hit your `right' key and then do C-h
l to see what key-sequence Emacs received when you hit `right'.  If it says
something like ESC [ 0 ~, then try

        (define-key function-key-map "\e[0~" [right])


-- Stefan


PS: One of the differences between changing function-key-map and using
    global-set-key is that the former will also work when you use C-x right.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]