Help with GNU Emacs for SGI

Scott Henry scotth at corp.sgi.com
Thu Feb 15 20:05:28 AEST 1990


LH> I've managed to compile GNU emacs 18.55 for the SGI (I have a personal
LH> Iris), but to make this reasonable, I need a /emacs/lisp/term file for
LH> the iris-ansi terminal type.  Does anybody have one?  I called SG and
LH> they told me to buy their version of emacs; Stallman wouldn't like
LH> that, I'm sure....

LH> I need advice on making it recognize mouse clicks and selections.  It
LH> would also be nice not to have to cons up the entire set of key definitions 
LH> from scratch.  Surely someone must have done this, right?

LH> Help is much appreciated: mail to hunter at nlm.nih.gov

LH> Thanks!

Shortly after I got GNU Emacs up on my 4D, I hacked up term/vt100.el to
work within a wsh window using wsh as a terminal emulator.  It doesn't
support mouse-stuff except that which a wsh supports. Place the following
in lisp/term as iris-ansi.el, and make a hard link as iris-ansi-net.el.

I did try porting NeWS-mode, but 4Sight is sufficiently different from
Sun's NeWS (and I am definitely NOT a NeWS hacker) that I coudn't get it
ported in the time I had available.  The X11 interface works fine (if you
add the recently posted patch to reduce the (*&^(*&^) beep volume, but I
miss the extra arrow-key bindings.

;; term/iris-ansi.el
;; term/iris-ansi-net.el
;; Map Iris 4D function key escape sequences from a wsh
;; into the standard slots in function-keymap.
;; This is just a hacked-up version of vt100.el so as to use the 4D
;; keyboard escape sequences (and some added keys).
;; This software is in the public domain.
;; It is not supported by Silicon Graphics, Inc.
;; Hacker: Scott Henry

(require 'keypad)

(defvar Iris-CSI-map nil
  "The Iris-CSI-map maps the CSI function keys on the Iris 4D keyboard.
The CSI keys are the arrow keys.")

(if (not Iris-CSI-map)
    (progn
     (setq Iris-CSI-map (lookup-key global-map "\e["))
     (if (not (keymapp Iris-CSI-map))
	 (setq Iris-CSI-map (make-sparse-keymap)))  ;; <ESC>[ commands

     (setup-terminal-keymap Iris-CSI-map
	'(("A" . ?u)		; up arrow
	  ("B" . ?d)		; down-arrow
	  ("C" . ?r)		; right-arrow
	  ("D" . ?l)		; left-arrow
	  ("H" . ?h)			; home key
	  ("161q" . ?P)			; shift up arrow
	  ("164q" . ?N)			; shift down arrow
	  ("158q" . ?1)			; shift left arrow
	  ("167q" . ?3)			; shift right arrow
	  ("150q" . ?P)			; page up key
	  ("154q" . ?N)			; page down key
	  ("159q" . ?\C-a)		; control left arrow
	  ("168q" . ?\C-b)		; control right arrow
	  ("139q" . ?0)			; insert key
	  ("162q" . ?7)			; control up arrow
	  ("165q" . ?9)			; control down arrow
	  ("146q" . ?\C-c)		; end key
	  ("147q" . ?f)			; shift end key
	  ("P" . ?\C-d)			; shift delete
	  ("142q" . ?k)			; control delete
	  ("143q" . ?u)			; shift home
	  ("144q" . ?u)			; control home
			))))

(defun enable-arrow-keys ()
  "Enable the use of the VT100 arrow keys for cursor motion.
Because of the nature of the VT100, this unavoidably breaks
the standard Emacs command ESC [; therefore, it is not done by default,
but only if you give this command."
  (interactive)
  (global-set-key "\e[" Iris-CSI-map))

--
  Scott Henry <scotth at sgi.com>	| These are my	| Tardis Express -- when it
  Information Services,		| Opinions only!| absolutely, positively
  Silicon Graphics, Inc		| Whose else?	| has to be there -- yesterday.



More information about the Comp.sys.sgi mailing list