unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Setting Keyboard bindings for C-Right
@ 2007-08-04 18:30 the matt
  2007-08-05  3:26 ` weber
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: the matt @ 2007-08-04 18:30 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

Any help in translating "ESC [ 1 ; 5 C" into an emacs keybinding would
be much appreciated.

I know this comes up frequently, so really what I need is to know how
to input my key bindings for C-Right for emacs -nw in my terminal

Output of view-losses for C-Right
ESC [ 1 ; 5 C

I've tried  the following (and a few other variations to no avail)

(define-key function-key-map "\eO1;5C" [C-right])
(global-set-key [(C-right)] 'forward-word)

Any help in translating "ESC [ 1 ; 5 C" into an emacs keybinding would
be much appreciated.

System:  Emacs 21.4.1
               Fedora FC5
               <generic keyboard>
Thanks

Matt

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Setting Keyboard bindings for C-Right
  2007-08-04 18:30 Setting Keyboard bindings for C-Right the matt
@ 2007-08-05  3:26 ` weber
  2007-08-05  3:39   ` the matt
  2007-08-05 20:11 ` Peter Dyballa
       [not found] ` <mailman.4421.1186344683.32220.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 5+ messages in thread
From: weber @ 2007-08-05  3:26 UTC (permalink / raw)
  To: help-gnu-emacs

On Aug 4, 3:30 pm, the matt <m...@kettlewell.net> wrote:
> Hello,
>
> Any help in translating "ESC [ 1 ; 5 C" into an emacs keybinding would
> be much appreciated.
>
> I know this comes up frequently, so really what I need is to know how
> to input my key bindings for C-Right for emacs -nw in my terminal
>
> Output of view-losses for C-Right
> ESC [ 1 ; 5 C
>
> I've tried  the following (and a few other variations to no avail)
>
> (define-key function-key-map "\eO1;5C" [C-right])
> (global-set-key [(C-right)] 'forward-word)
>
> Any help in translating "ESC [ 1 ; 5 C" into an emacs keybinding would
> be much appreciated.
>
> System:  Emacs 21.4.1
>                Fedora FC5
>                <generic keyboard>
> Thanks
>
> Matt

This works for me:
(global-set-key [(control right)] 'forward-word)

Cheers
weber

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Setting Keyboard bindings for C-Right
  2007-08-05  3:26 ` weber
@ 2007-08-05  3:39   ` the matt
  0 siblings, 0 replies; 5+ messages in thread
From: the matt @ 2007-08-05  3:39 UTC (permalink / raw)
  To: help-gnu-emacs

On Aug 4, 9:26 pm, weber <hug...@gmail.com> wrote:
>
> This works for me:
> (global-set-key [(control right)] 'forward-word)
>
> Cheers
> weber

I agree that it works well  in an X system. :)

Try emacs -nw  and it won't work because C-right isn't interpreted the
same

You can see this for yourself by running M-x view-losses (C-h l ) and
you will see the difference between the two.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Setting Keyboard bindings for C-Right
  2007-08-04 18:30 Setting Keyboard bindings for C-Right the matt
  2007-08-05  3:26 ` weber
@ 2007-08-05 20:11 ` Peter Dyballa
       [not found] ` <mailman.4421.1186344683.32220.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Dyballa @ 2007-08-05 20:11 UTC (permalink / raw)
  To: the matt; +Cc: help-gnu-emacs


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Setting Keyboard bindings for C-Right
       [not found] ` <mailman.4421.1186344683.32220.help-gnu-emacs@gnu.org>
@ 2007-08-05 21:53   ` the matt
  0 siblings, 0 replies; 5+ messages in thread
From: the matt @ 2007-08-05 21:53 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-08-05 21:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-04 18:30 Setting Keyboard bindings for C-Right the matt
2007-08-05  3:26 ` weber
2007-08-05  3:39   ` the matt
2007-08-05 20:11 ` Peter Dyballa
     [not found] ` <mailman.4421.1186344683.32220.help-gnu-emacs@gnu.org>
2007-08-05 21:53   ` the matt

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).