home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / emacs / 2684 < prev    next >
Encoding:
Text File  |  1992-07-23  |  2.4 KB  |  82 lines

  1. Newsgroups: comp.emacs
  2. Path: sparky!uunet!mcsun!sun4nl!nikhefk!templon
  3. From: templon@paramount.nikhefk.nikhef.nl (Jeffrey Templon)
  4. Subject: Need Help Keybinding/X-Function (I give up!)
  5. Message-ID: <1992Jul23.095406.23227@paramount.nikhefk.nikhef.nl>
  6. Organization: NIKHEFK
  7. Date: Thu, 23 Jul 1992 09:54:06 GMT
  8. Lines: 72
  9.  
  10.  
  11. I am trying to bind some of the functions on a Sparc keyboard
  12. to be the same as they are for shelltool, etc.  I am having
  13. problems.  At the moment I am working on a Sparcstation 1+,
  14. running SunOs 4.1.2, emacs 18.57.  Here is the relevant
  15. snatch of my .emacs file.  I appreciate any assistance.
  16.  
  17. oh, yes, what happens?  Well, when I do a C-h k on the "Paste"
  18. key, it indeed reports the binding.  But when I just hit
  19. the "Paste" key, nothing happens.  Yes I have verified that
  20. something was in the x-cut-buffer.
  21.  
  22. ----------------------------------------
  23. ;;;
  24. ;;;
  25. ;;;
  26. (defun sparc () "Setup Sun Keyboard, assume sun-4"
  27. ;;;
  28. ;;; The following comes from sun.el in the standard distribution
  29. ;;; handle sun's extra function keys
  30. ;;; this version for those who run with standard .ttyswrc and no emacstool
  31. ;;;
  32. ;;; sunview picks up expose and open on the way UP, 
  33. ;;; so we ignore them on the way down
  34. ;;;
  35.  
  36.   (defvar sun-esc-bracket t
  37.     "*If non-nil, rebind ESC [ as prefix for Sun function keys.")
  38.  
  39.   (defvar sun-raw-map (make-sparse-keymap) "*Keymap for ESC-[ encoded keyboard")
  40.  
  41. ;;;
  42. ;;;     X-windows binding stuff -- construction in progress
  43. ;;;
  44.   (define-key sun-raw-map "199z" '(lambda ()
  45.                     (interactive)
  46.                     (insert (x-get-cut-buffer))))
  47.   (if sun-esc-bracket
  48.       (progn
  49.     (define-key esc-map "[" sun-raw-map)        ; Install sun-raw-map
  50.     (define-key esc-map "[[" 'backward-paragraph)    ; the original esc-[
  51.     ))
  52. )
  53. ;;;
  54. ;;;
  55. (defun jtdef () "J. T.'s special definitions: get arrow keys, etc."
  56.   (interactive)
  57. ;;;
  58. ;;;   do terminal-specific stuff here
  59. ;;;
  60.   (if (string-equal (getenv "TERM") "sun-cmd") (sparc))
  61. ;;;
  62. ;;;   swap delete and backspace for NIKHEF people
  63. ;;;
  64.   (let ((the-table (make-string 128 0)))
  65.     (let ((i 0))
  66.       (while (< i 128)
  67.     (aset the-table i i)
  68.     (setq i (1+ i))))
  69.     ;; Swap ^H and DEL
  70.     (aset the-table ?\177 ?\^h)
  71.     (aset the-table ?\^h ?\177)
  72.     (aset the-table ?\^^ ?\^s)
  73.     (aset the-table ?\^\\ ?\^q)
  74.     (setq keyboard-translate-table the-table)))
  75. ;;;
  76. ;;;
  77. ;
  78. (setq-default truncate-lines t)
  79. (setq default-major-mode 'text-mode)
  80. (setq initial-major-mode 'text-mode)
  81. (setq term-setup-hook 'jtdef)
  82.