Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!ames!dftsrv!mimsy!fe2o3!rusty From: rusty@fe2o3.UUCP (Rusty Haddock) Newsgroups: comp.sys.amiga Subject: Re: DNET/FTERM and GNU-emacs Message-ID: <339@fe2o3.UUCP> Date: 29 Mar 90 19:01:03 GMT References: <1990Mar27.153542.2577@iesd.auc.dk> Reply-To: rusty%fe2o3@mimsy.umd.edu (Rusty Haddock) Organization: 1/entropy Lines: 174 In article <1990Mar27.153542.2577@iesd.auc.dk> kasper@iesd.auc.dk (Kasper Osterbye) writes: >I am using DNET directly with a sun. When I "setenv TERM amiga" everything >works fine! Really fine actually! > >What I am wondering is, if any one has set up a configuration for GNU-emacs >on the unix-side so that one can use the amiga function keys and cursor >keys? (noone has touched the mouse in connection with DNet yet?) Here you go folks, not only a termcap file but an amiga.el for your GNU Emacs lisp/term directory (personal or system). Note that my selection for the various function keys may appear weird but you can change them to whatever functions you'd like them to have. The two files are separated by a FORMFEED, ^L. This amiga.el file is running under GNU Emacs version 18.5x and version 18.4x. ;; keybinding for standard default Amiga ANSI window keys ;; Converted Jeff Peck's "lisp/term/sun.el" for a standard ;; Amiga ANSI window/keyboard like you'd get using DNet/Fterm. ;; 11/16/88 Rusty Haddock (defun ignore-key () "interactive version of ignore" (interactive) (ignore)) (defun remove-indent () "Remove any white space at beginning of line." (interactive) (beginning-of-line) (delete-horizontal-space)) (defun backward-other-window () "The function (other-window) used in the reverse direction." (interactive) (other-window -1)) (defun cursor-to-top () "Move cursor to top line in window." (interactive) (move-to-window-line 0)) (defun cursor-to-bottom () "Move cursor to bottom line in window." (interactive) (move-to-window-line -1)) ;;; ;;; handle the Amiga's function keys ;;; (defvar meta-flag t) ; The USA-0 keymap doesn't possess a true META ; key so don't try doing CTRL-META- ; 'cause it don't go. Fortunately, things like ; META-F and such do work. ; LATE FLASH: Email me for a fully-functioning ; keymap that emits ALL 8-bit codes using the ; ALT keys as TRUE meta-keys (8th-bit shifters). (defvar amiga-meta-esc t "*If non-nil, rebind \233 as prefix for Amiga function keys.") (defvar amiga-map (make-sparse-keymap) "*Keymap for \\233 encoded keyboard") (define-key amiga-map "0~" 'scroll-one-line-up) ; f1 (define-key amiga-map "1~" 'scroll-one-line-down) ; f2 (define-key amiga-map "2~" 'beginning-of-buffer) ; f3 (define-key amiga-map "3~" 'end-of-buffer) ; f4 (define-key amiga-map "4~" 'line-to-top-of-window) ; f5 (define-key amiga-map "5~" 'line-to-bottom-of-window) ; f6 (define-key amiga-map "6~" 'other-window) ; f7 (define-key amiga-map "7~" 'backward-other-window) ; f8 (define-key amiga-map "8~" 'describe-key-briefly) ; f9 (define-key amiga-map "9~" 'undo) ; f10 ; Shifted function keys (define-key amiga-map "10~" 'eval-expression) ; F1 (define-key amiga-map "11~" 'ignore-key) ; F2 (define-key amiga-map "12~" 'ignore-key) ; F3 (define-key amiga-map "13~" 'ignore-key) ; F4 (define-key amiga-map "14~" 'cursor-to-top) ; F5 (define-key amiga-map "15~" 'cursor-to-bottom) ; F6 (define-key amiga-map "16~" 'mail) ; F7 (define-key amiga-map "17~" 'rmail) ; F8 (define-key amiga-map "18~" 'save-buffers-kill-emacs) ; F9 (define-key amiga-map "19~" 'save-buffer) ; F10 ; Cursor keys (define-key amiga-map "A" 'scroll-down) ; up arrow (unshifted) (define-key amiga-map "B" 'scroll-up) ; down arrow (define-key amiga-map "C" 'cursor-to-bottom) ; right arrow (define-key amiga-map "D" 'cursor-to-top) ; left arrow (define-key amiga-map "T" 'backward-paragraph) ; UP ARROW (shifted) (define-key amiga-map "S" 'forward-paragraph) ; DOWN ARROW (define-key amiga-map " @" 'forward-word) ; RIGHT ARROW (define-key amiga-map " A" 'backward-word) ; LEFT ARROW (define-key amiga-map "?~" 'help-command) ; Help key (define-key amiga-map "Z" 'tab-to-tab-stop) ; Shift TAB ; I'm sorry that I don't have those extra keys around the keypad ; that you A500/2000 folks have. -Rusty- (if amiga-meta-esc (progn (define-key esc-map "\033" amiga-map) ; Install amiga-map (define-key amiga-map "\033" 'eval-expression))) ; original ESC-ESC ; Yuck! I know, I know... triple ESC ;;; Since .emacs gets loaded before this file, a hook is supplied ;;; for you to put your own bindings in. (defvar amiga-map-hooks nil "List of forms to evaluate after setting amiga-map.") (let ((hooks amiga-map-hooks)) (while hooks (eval (car hooks)) (setq hooks (cdr hooks)) )) # # Commodore Amiga ANSI Termcap # # Rusty Haddock # April 18, 1989 # # Am|dnet|Amiga ANSI for AmigaKermit or DNet:\ :%1=\E?~:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:\ :F1=\E10~:F2=\E11~:F3=\E12~:F4=\E13~:F5=\E14~:\ :F6=\E15~:F7=\E16~:F8=\E17~:F9=\E18~:FA=\E19~:\ :LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:\ :ae=^O:al=\E[L:am:as=^N:bs:bw:\ :cd=\E[J:ce=\E[K:cl=^L:cm=\E[%i%d;%dH:co#77:\ :dc=\E[P:dl=\E[M:do=\E[B:ei=:ic=\E[@:im=:is=\E[c\E[20l:\ :k1=\E0~:k2=\E1~:k3=\E2~:k4=\E3~:k5=\E4~:\ :k6=\E5~:k7=\E6~:k8=\E7~:k9=\E8~:k0=\E9~:\ :kb=^H:kd=\EB:kl=\ED:kr=\EC:ku=\EA:\ :l0=F10:l1=F1:l2=F2:l3=F3:l4=F4:\ :l5=F5:l6=F6:l7=F7:l8=F8:l9=F9:\ :li#23:ms:nl=\E[B:pt:rs=\Ec:se=\E[31;40;0m:sf=\E[S:so=\E[30;43m:\ :sr=\E[T:ue=\E[0m:ul:up=\E[A:us=\E[4m:\ :vb=^G:ve=\E[ p:vi=\E[0 p:xn: A1|dneta|Amiga ANSI for interlace w/ topaz-11 font:\ :li#34:tc=Am: A2|dnetb|Amiga ANSI for interlace w/ pearl 8 font:\ :li#48:tc=Am: A3|dnetc|Amiga ANSI for interlace w/ FTerm 8 font:\ :li#48:co#88:tc=Am: A4|dnetd|Amiga ANSI for interlace w/ topaz-11 font morerow'd:\ :li#34:co#80:tc=Am: A5|dnete|Amiga ANSI for interlace w/ topaz-11 font morerow'd but with 8-pxl title:\ :li#35:co#80:tc=Am: A6|dnetf|Amiga ANSI for interlace w/ topaz-8 font morerow'd:\ :li#48:co#80:tc=Am: AS|net|AmigaSlip|Amiga ANSI using KA9Q TCP/SLIP:\ :co#79:li#22:tc=Am: -- Rusty Haddock o {uunet,rutgers}!mimsy.umd.edu!fe2o3!rusty Laurel, Maryland o rusty%fe2o3@mimsy.umd.edu -=> This .signature protected by Smith & Wesson <=-