[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Setting Keyboard bindings for C-Right
From: |
the matt |
Subject: |
Re: Setting Keyboard bindings for C-Right |
Date: |
Sun, 05 Aug 2007 14:53:34 -0700 |
User-agent: |
G2/1.0 |
On Aug 5, 2:11 pm, Peter Dyballa <Peter_Dyba...@Web.DE> wrote:
> Am 04.08.2007 um 20:30 schrieb the matt:
>
> > Any help in translating "ESC [ 1 ; 5 C" into an emacs keybinding would
> > be much appreciated.
>
> You could look into xterm.el - it has lines like:
>
> (define-key map "\e[1;5C" [C-right])
>
> The whole block, starting with
>
> (let ((map (make-sparse-keymap)))
>
> has a comment
>
> ;; xterm from X.org 6.8.2 uses these key definitions.
>
> and ends with
>
> ;; Use inheritance to let the main keymap override those
> defaults.
> ;; This way we don't override terminfo-derived settings or
> settings
> ;; made in the .emacs file.
> (set-keymap-parent map (keymap-parent function-key-map))
> (set-keymap-parent function-key-map map))
>
> Could be it's worth to patch <your terminal>.el with the 300 lines
> from xterm.el.
>
> --
> Greetings
>
> Pete
>
> There is no national science just as there is no national
> multiplication table; what is national is no longer science.
> -- Anton Checov
Thanks Pete,
That's the pointer that I was needing
In the end I added the following to my .emacs file
(right, wrong or indiferent, it's what I did, and where I put it):
(define-key function-key-map "\e[1;5C" [C-
right])
(define-key function-key-map "\e[1;5D" [C-
left])
(global-set-key [(C-right)] 'forward-
word)
(global-set-key [(C-left)] 'backward-word)
Thanks again,
Matt