Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mit-eddie.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!mly@prep.AI.MIT.EDU From: mly@prep.AI.MIT.EDU Newsgroups: net.emacs Subject: Cursor keys Message-ID: <186@mit-eddie.UUCP> Date: Fri, 14-Feb-86 18:22:56 EST Article-I.D.: mit-eddi.186 Posted: Fri Feb 14 18:22:56 1986 Date-Received: Sun, 16-Feb-86 04:43:47 EST Sender: daemon@mit-eddi.UUCP Organization: MIT, Cambridge, MA Lines: 40 From: mly@prep.AI.MIT.EDU (Richard Mlynarik) You didn't say what emacs you are running, though from circumstantial evidence I assume it is GNU Emacs of some unknown modernity. (Use m-x emacs-version ito find out) This is covered in the `Init Files' section of the GNU Emacs manual (either printed or by way of `m-x info' in Emacs version 17) The example given in that section is: * Make `C-x p' undefined. (global-unset-key "\C-xp") One reason to undefine a key is so that you can make it a prefix. Simply defining `C-x p ANYTHING' would make `C-x p' a prefix, provided it is not otherwise defined. So to solve your problem: I'm fairly new to emacs and was wondering if anyone can tell me if there is a way to define the cursor keys on a DEC VT240 terminal to be next-line, previous-line, forward-char, & backward-char. The cursor keys send the characters ESC [ B,ESC [ A,ESC [ C,ESC [ D respectively. The only problem is that the first two characters are taken to be backward-paragraph (ESC [) and the rest is inserted into the text. place the following forms in your ~/.emacs file: (global-unset-key "\e[") (global-set-key "\e[A" 'previous-line) (global-set-key "\e[B" 'next-line) (global-set-key "\e[C" forward-char) (global-set-key "\e[D" 'backward-char) I don't know how similar a vt240 is to a vt200 or a vt220 -- if they are close, you might consider making a file emacs/lisp/term/vt240.el which is linked to emacs/lisp/term/vt200.el -- that file contains a number of key definitions which some people have found to their liking. Have a look around in that file to see what things are defined and how they can be changed.