home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / terms / 300l.el next >
Encoding:
Text File  |  1990-07-22  |  7.4 KB  |  253 lines

  1. ;From ark1!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!uw-beaver!Teknowledge.COM!unix!hplabs!hpfcso!hpfcmgw!hpfcse!hpuecoz!hpuecoa!clem!jon Wed Feb 14 08:55:44 1990
  2. ;Article 1388 of comp.emacs:
  3. ;Path: ark1!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!uw-beaver!Teknowledge.COM!unix!hplabs!hpfcso!hpfcmgw!hpfcse!hpuecoz!hpuecoa!clem!jon
  4. ;>From jon@clem.UUCP (Jon Trulson)
  5. ;Newsgroups: comp.emacs
  6. ;Subject: Re: using HP function keys with emacs & HP-UX
  7. ;Message-ID: <1510001@clem.UUCP>
  8. ;Date: 11 Feb 90 05:14:50 GMT
  9. ;References: <1461@ursa-major.SPDCC.COM>
  10. ;Organization: Metropolitan State College
  11. ;Lines: 238
  12. ;
  13. ;
  14. ;
  15. ;
  16. ;    Just so happens I do, (if it ever gets out) The following is a
  17. ;copy of my 300l.el (hp9854a) that I obtained from a friend.  Here's my
  18. ;system info: HP9000/370 HP-UX 6.5 running gnuemacs 18.55.
  19. ;
  20. ;
  21. ;                Jon Trulson - MSC
  22. ;
  23. ;------------------ Cut Here  ----------------------
  24.  
  25. ;;
  26. ;;    To Anyone Who Has Figured Out how to get the `Extend char' key on    
  27. ;;    their HP2392  to act as the Meta key, using GNU emacs 18.50 on an HP
  28. ;;    300 series machine (a > 350, to be exact): Help!  
  29. ;;    
  30. ;;    it is my understanding that the extend char key does not just set the
  31. ;;    top bit of the key that you hit, it accesses an alternate character
  32. ;;    set.  some keys, like "z" dont seem to have an extended char.  if you
  33. ;;    do find a way of doing this, PLEASE let me know...  it would be most
  34. ;;    useful.
  35. ;;    
  36. ;;       Also, while I'm here: if you have been able to do the above, you
  37. ;;    are also probably smart enough to have made a default.el which sets up
  38. ;;    all the special keys to the right of the main keyboard to be useful
  39. ;;    (i.e. `Clear display', `Prev', the arrow keys, etc).
  40. ;;    
  41. ;;    
  42. ;;    here is what we use for our lisp/term/hp2392.el file, minus some local
  43. ;;    junk that you probably dont want anyway...  (yes, i know, this should
  44. ;;    probably use the keypad stuff that has already been set up, but i had
  45. ;;    this written before i knew that it existed.  if someone has a cleaner
  46. ;;    hack, i would be interested in that too.)
  47. ;;    
  48. ;;                                                                          
  49. ;;
  50. ;; cursor pad
  51. ;;
  52.  
  53. (global-set-key "\eA" 'previous-line)   ; up arrow
  54. (global-set-key "\eB" 'next-line)       ; down arrow
  55. (global-set-key "\eC" 'forward-char)    ; right arrow
  56. (global-set-key "\eD" 'backward-char)   ; left arrow
  57. (global-set-key "\eh" 'home)            ; home to the top of the window
  58.  
  59.  
  60. (global-set-key "\eS" 'beginning-of-buffer); shift up arrow - top of file
  61. (global-set-key "\eT" 'end-of-buffer)   ; shift down arrow - end of file
  62. (global-set-key "\eR" 'end-of-line)   ; shift right arrow - end of line
  63. (global-set-key "\eL" 'beginning-of-line); shift left arrow - beg of line
  64. (global-set-key "\eF" 'home-bottom)     ; shift home to bottom of window
  65.  
  66.  
  67. ;;
  68. ;; named keys
  69. ;;
  70.  
  71. (global-set-key "\eK" 'clear-end-of-line) ; clear line
  72. (global-set-key "\eJ" 'hide-window)     ; clear display
  73. (global-set-key "\eL" 'insert-line)     ; insert line
  74. (global-set-key "\eM" 'delete-line)     ; delete line
  75. (global-set-key "\eQ" 'overwrite-mode)  ; insert char
  76. (global-set-key "\eP" 'delete-char)     ; delete char
  77. (global-set-key "\eV" 'scroll-down)     ; prev screen
  78. (global-set-key "\eU" 'scroll-up)       ; next screen
  79.  
  80.  
  81. (global-set-key "\e&a0C" 'beginning-of-line) ; from shift clear line & display
  82. (global-set-key "\eG" 'beginning-of-line) ; from shift clear line & display
  83.  
  84. ;;(global-set-key "\eK" 'clear-end-of-line) ; shift clear line
  85. ;;(global-set-key "\eJ" 'delete-window) ; shift clear display
  86. ;;(global-set-key "\eL" 'insert-line)   ; shift insert line
  87. ;;(global-set-key "\eM" 'delete-line)   ; shift delete line
  88. (global-set-key "\eN" 'overwrite-mode)  ; shift insert char
  89. (global-set-key "\eO" 'delete-char)     ; shift delete char
  90. (global-set-key "\e&r-1H" 'scroll-down) ; shift prev
  91. (global-set-key "\e&r+1H" 'scroll-up)   ; shift next
  92.  
  93.  
  94.  
  95. ;;
  96. ;; function definitions for the cursor and named keys
  97. ;;
  98.  
  99. (defun home ()
  100.   "Home to the upper left of the window."
  101.   (interactive)
  102.  
  103.   (move-to-window-line 0)
  104.   (move-to-column (window-hscroll (selected-window)))
  105.   (setq temporary-goal-column (window-hscroll (selected-window)))
  106.   )
  107.  
  108.  
  109. (defun home-bottom ()
  110.   "Home to the lower right of the window."
  111.   (interactive)
  112.  
  113.   (move-to-window-line -1)
  114.   (move-to-column (window-hscroll (selected-window)))
  115.   (setq temporary-goal-column (window-hscroll (selected-window)))
  116.   )
  117.  
  118.  
  119. (defun insert-line ()
  120.   "Insert a line before the current line."
  121.   (interactive)
  122.  
  123.   (let ((org-point (point))
  124.         )
  125.     (condition-case conditions
  126.         (progn
  127.           (beginning-of-line)
  128.           (open-line 1)
  129.           )
  130.       (error (goto-char org-point)
  131.              (signal (car conditions) (cdr conditions))
  132.              )
  133.       )
  134.     )
  135.   
  136.   )
  137.  
  138.  
  139. (defun delete-line ()
  140.   "Delete the current line."
  141.   (interactive)
  142.  
  143.   (let ((org-point (point))
  144.         )
  145.     (condition-case conditions
  146.         (kill-region (progn
  147.                        (beginning-of-line)
  148.                        (point)
  149.                        )
  150.                      (progn
  151.                        (end-of-line)
  152.                        (if (eobp)
  153.                            (point)
  154.                          (forward-char)
  155.                          (point)
  156.                          )
  157.                        )
  158.                      )
  159.       (error (goto-char org-point)
  160.              (signal (car conditions) (cdr conditions))
  161.              )
  162.       )
  163.     )
  164.  
  165.   )
  166.  
  167.  
  168. (defun clear-end-of-line ()
  169.   "Clear to the end of the line."
  170.   (interactive)
  171.  
  172.   (let ((org-point (point))
  173.         )
  174.     (condition-case conditions
  175.         (kill-region (point)
  176.                      (progn
  177.                        (end-of-line)
  178.                        (point)
  179.                        )
  180.                      )
  181.       (error (goto-char org-point)
  182.              (signal (car conditions) (cdr conditions))
  183.              )
  184.       )
  185.     )
  186.  
  187.   )
  188.  
  189.  
  190. (defun hide-window ()
  191.   "Hide the current window from view."
  192.   (interactive)
  193.  
  194.   (if (one-window-p t)
  195.       (bury-buffer)
  196.     (delete-window)
  197.     )
  198.   )
  199.  
  200.  
  201. ;;
  202. ;; set up dired keys
  203. ;;
  204.  
  205. ;;(define-key dired-mode-map "\eA" 'dired-previous-line)
  206. ;;(define-key dired-mode-map "\eB" 'dired-next-line)
  207.  
  208.  
  209. ;;
  210. ;; set up the user function keys
  211. ;; Note: I unset the keys before I re-defined them since some of
  212. ;;    the characters sent by the function keys are used by gnuemacs
  213. ;;    for other things.  Note, you can also define the funtion keys
  214. ;;    themselves to return other than their default values..
  215.  
  216. (global-unset-key "\ep")
  217. (global-set-key "\ep\r" 'save-buffers-kill-emacs)   ; f1
  218.  
  219. (global-unset-key "\eq")
  220. (global-set-key "\eq\r" 'set-mark-command)                 ; f2
  221.  
  222. (global-unset-key "\er")
  223. (global-set-key "\er\r" 'kill-region)               ; f3
  224.  
  225. (global-unset-key "\es")
  226. (global-set-key "\es\r" 'help-for-help)             ; f4
  227.  
  228. (global-unset-key "\et")
  229. (global-set-key "\et\r" 'Control-X-prefix)          ; f5
  230.  
  231. (global-unset-key "\eu")
  232. (global-set-key "\eu\r" 'execute-extended-command)  ; f6
  233.  
  234. (global-unset-key "\ev")
  235. (global-set-key "\ev\r" 'list-buffers)              ; f7
  236.  
  237. (global-unset-key "\ew")
  238. (global-set-key "\ew\r" 'other-window)              ; f8
  239.  
  240. ;;; HP terminals usually encourage using ^H as the rubout character
  241.  
  242. (let ((the-table (make-string 128 0)))
  243.   (let ((i 0))
  244.     (while (< i 128)
  245.       (aset the-table i i)
  246.       (setq i (1+ i))))
  247.   ;; Swap ^H and DEL
  248.   (aset the-table ?\177 ?\^h)
  249.   (aset the-table ?\^h ?\177)
  250.   (setq keyboard-translate-table the-table))
  251.  
  252.  
  253.