home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / misc / iris4d.el < prev    next >
Encoding:
Text File  |  1990-07-22  |  4.4 KB  |  109 lines

  1. ;From ark1!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!jpl-devvax!larryc Fri May 18 15:57:19 1990
  2. ;Article 1944 of comp.emacs:
  3. ;Path: ark1!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!jpl-devvax!larryc
  4. ;>From larryc@jpl-devvax.JPL.NASA.GOV (Larry E. Carroll)
  5. ;Newsgroups: comp.emacs
  6. ;Subject: Silicon Graphics F key binding
  7. ;Message-ID: <8108@jpl-devvax.JPL.NASA.GOV>
  8. ;Date: 15 May 90 23:45:54 GMT
  9. ;Reply-To: larryc@devvax.JPL.NASA.GOV (Larry E. Carroll)
  10. ;Organization: Jet Propulsion Laboratory, Pasadena, CA
  11. ;Lines: 94
  12. ;
  13. ;Recently someone asked for a Silicon Graphics init file that would map the 
  14. ;function keys.  I wasn't able to respond then because I didn't have access 
  15. ;to news posting.  Hope this isn't too late to help.
  16. ;
  17. ;This is what worked for me.  I'm CCing it to comp.emacs because I'd 
  18. ;like to hear if there is a better way.
  19. ;
  20. ;First, I had version 18.54.  I also had a problem loading the default init 
  21. ;file, which I solved by putting the following alias in my .login file. 
  22. ;(Loading the default would not over-ride the redefinition below of the 
  23. ;DEL key.)
  24. ;
  25. ;  alias em ~/bin/emacs -q -l ~/.emacsinit
  26. ;
  27. ;In the emacs init file I included the following along with such things as 
  28. ;my preferred c-indent-level.
  29. ;
  30. ;  (load "~/emacs/lisp/term/iris4d.elc")
  31. ;
  32. ;In iris4d.el (later byte-compiled to iris4d.elc) I put the following.
  33.  
  34.   ;;  Change the Help prefix character; it conflicts with the BACKSPACE key.
  35.  
  36.   (define-key global-map "\C-\\" help-map)
  37.   (global-set-key "C-h" 'backward-delete-char)
  38.  
  39.   ;;  Define the <escape left-bracket> ANSI function key prefix, in prep.
  40.   ;;  for defining the Silicon Graphics keymap.
  41.  
  42.   (global-unset-key "\e[")
  43.   (global-unset-key "\e]")
  44.   (global-seat-key "\e{" 'backward-paragraph ;;  You may want a different
  45.   (global-seat-key "\e}" 'forward-paragraph  ;;  key binding.
  46.  
  47.   (defvar iris-reg-map (make-sparse-keymap) "*Keymap for ESC-[ keys")
  48.   (global-set-key "\e[" iris-reg-map)
  49.  
  50.   (define-key iris-reg-map "\177" 'delete-char)          ;; The DEL key
  51.  
  52.   ;;--------------------------------------------------------------------
  53.   ;;  Define the Silicon Graphics regular keypad keymap.
  54.  
  55.   (define-key iris-reg-map "142q" 'kill-word)            ;; Ctrl-Delete
  56.  
  57.   (define-key iris-reg-map "A" 'previous-line)           ;; Up-arrow
  58.   (define-key iris-reg-map "B" 'next-line)               ;; Down-arrow
  59.   (define-key iris-reg-map "C" 'forward-char)            ;; Right-arrow
  60.   (define-key iris-reg-map "D" 'backward-char)           ;; Left-arrow
  61.  
  62.   (define-key iris-reg-map "168q" 'forward-word)         ;; Ctrl-right-arrow
  63.   (define-key iris-reg-map "159q" 'forward-word)         ;; Ctrl-right-arrow)
  64.   (define-key iris-reg-map "158q" 'beginning-of-line)    ;; Shift-left-arrow
  65.   (define-key iris-reg-map "167q" 'end-of-line)          ;; Shift-right-arrow
  66.  
  67.   (define-key iris-reg-map "154q" 'scroll-up)            ;; Page-up
  68.   (define-key iris-reg-map "150q" 'scroll-down)          ;; Page-down
  69.   (define-key iris-reg-map "156q" 'scroll-other-window)  ;; Ctrl-page-down
  70.   ;;  Unfortunately for consistency, Ctrl-page-up produces nothing useful.
  71.  
  72.   (define-key iris-reg-map "H" 'beginning-of-buffer)     ;; Home
  73.   (define-key iris-reg-map "146q" 'end-of-buffer)        ;; End
  74.  
  75.   (define-key iris-reg-map "139q" 'overwrite-mode)       ;; Insert
  76.  
  77.   ;;---------------------------------------------------------------------
  78.   ;;  Define the SG function-key keymap.  (Until a good reason comes along
  79.   ;;  to change it, it is the same as the regular-keypad map.)
  80.  
  81.   (define-key iris-reg-map "001q" 'whatever)             ;; F1
  82.                  ...
  83.   (define-key iris-reg-map "008q" 'you-choose)           ;; F8
  84.                    
  85.   (define-key iris-reg-map "P" ')             ;; F9 (Also made by Shift-Delete)
  86.   (define-key iris-reg-map "Q" ')             ;; F10
  87.   (define-key iris-reg-map "R" ')             ;; F11
  88.   (define-key iris-reg-map "S" ')             ;; F12
  89.  
  90.   ;;---------------------------------------------------------------------
  91.   ;;  Define the SG numeric keypad keymap.
  92.  
  93.   (define-key iris-num-map "n" 'delete-char)
  94.  
  95.   (define-key iris-num-map "x" 'previous-line)
  96.   (define-key iris-num-map "r" 'next-line)
  97.   (define-key iris-num-map "v" 'forward-char)
  98.   (define-key iris-num-map "t" 'backward-char)
  99.  
  100.   (define-key iris-num-map "y" 'scroll-up)
  101.   (define-key iris-num-map "s" 'scroll-down)
  102.  
  103.   (define-key iris-num-map "w" 'beginning-of-buffer)
  104.   (define-key iris-num-map "q" 'end-of-buffer)
  105.  
  106.   (define-key iris-num-map "p" 'overwrite-mode)
  107.  
  108.  
  109.