Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site umcp-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!zehntel!hplabs!hao!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.emacs Subject: Re: Arrow Key Problems Message-ID: <8173@umcp-cs.UUCP> Date: Sun, 26-Aug-84 14:46:04 EDT Article-I.D.: umcp-cs.8173 Posted: Sun Aug 26 14:46:04 1984 Date-Received: Thu, 30-Aug-84 06:22:30 EDT References: <446@hogpc.UUCP> <12400007@smu.UUCP> Organization: U of Maryland, Computer Science Dept., College Park, MD Lines: 43 * From: pedz@smu.UUCP ... I have actually used the bind-to-key function on key sequences that did not start with ESC or ^X but I do not know if this will continue to work or not. Sure it will. (Assuming this is Gosling Emacs.) The keyboard interpreter is simply a `while' loop that traverses keymaps. When a leaf is found, the function it points to is executed. Thus you can do silly things like: (bind-to-key "ESC-keymap" "\e\e") or (bind-to-key "that-was-silly" "silly") The first gives an endless loop for ESC-ESC, and can only be undone with ESC-x execute-extended-command (bind-to-key "execute-extended-command" "\e\e"). The second binds ``s'' and creates keymaps such that the whole word invokes the "that-was-silly" function. (Makes it hard to type 's'; you have to quote it first.) All the created keymaps are returned as ``BOGUS!'' if you ask for their name with, e.g., ESC-ESC (return-global-binding "si"). Keys within them can then be bound (from the keyboard or from mlisp). Note that because of the way Emacs does interactive (non-mlisp) bind- to-key's, you can only create ``BOGUS!'' keymaps from MLisp. For prettiness' sake I use (define-keymap) to make a named map first. I use a ^C keymap myself. From my .emacs_pro: (define-keymap "^C-prefix") (bind-to-key "^C-prefix" "\^C") (bind-to-key "execute-shell-command" "\^C!") (bind-to-key "list-marks" "\^C\^M") (bind-to-key "newtime-exit-emacs" "\^C\^C") (bind-to-key "pop-to-existing-buffer" "\^C\^P") (bind-to-key "repeat-until-stopped" "\^Cr") (bind-to-key "visit-RCS-file" "\^C\^V") and so forth. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690 UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland