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

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

Re: 2 questions


From: Kai Großjohann
Subject: Re: 2 questions
Date: Mon, 23 Jul 2001 18:42:42 +0200
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.105

On Mon, 23 Jul 2001, Jesper Holmberg wrote:

> 1. My backspace key works as I want it in X, if I run Emacs in
> graphical mode. It also works in the console. However, if I run
> Emacs in text mode under X (i.e. with -nw), backspace seems to
> generate ctrl-h. Why is this?

I think the right approach to do this is to tell xterm (or whatever
you use) to generate ^? (ascii 127) when you hit the backspace key and
to generate ESC [ 3 ~ (four characters) when you hit the delete key.

And then:

  (unless window-system
    (define-key function-key-map (kbd "ESC [ 3 ~") (kbd "<delete>"))
    ;; some cursor keys
    (define-key function-key-map (kbd "ESC [ 6 z") (kbd "<next>"))
    (define-key function-key-map (kbd "ESC [ 5 z") (kbd "<prior>"))
    (define-key function-key-map (kbd "ESC [ H") (kbd "<home>"))
    (define-key function-key-map (kbd "ESC O H") (kbd "<home>"))
    (define-key function-key-map (kbd "ESC [ 1 ~") (kbd "<home>"))
    (define-key function-key-map (kbd "ESC [ F") (kbd "<end>"))
    (define-key function-key-map (kbd "ESC O F") (kbd "<end>"))
    (define-key function-key-map (kbd "ESC [ 4 ~") (kbd "<end>"))
    (global-set-key (kbd "ESC _") 'set-mark-command))

This goes in ~/.emacs.  Maybe this even enables home, end, pgdn and pgup.

kai
-- 
~/.signature: No such file or directory



reply via email to

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