home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / emacs / 2966 < prev    next >
Encoding:
Internet Message Format  |  1992-08-27  |  14.8 KB

  1. Path: sparky!uunet!sun-barr!news2me.ebay.sun.com!cronkite.Central.Sun.COM!texsun!exucom.exu.ericsson.se!news
  2. From: exujsch@exu.ericsson.se (Johnny Schmittou EXU-T-EEG x7887 Dallas Texas USA)
  3. Newsgroups: comp.emacs
  4. Subject: xterm key bindings for jove and GNUEmacs (Part 1)
  5. Keywords: xterm, .Xdefaults, .joverc, .emacs
  6. Message-ID: <1992Aug27.144055.24522@exu.ericsson.se>
  7. Date: 27 Aug 92 14:40:55 GMT
  8. Sender: news@exu.ericsson.se
  9. Reply-To: exujsch@exu.ericsson.se (Johnny Schmittou EXU-T-EEG x7887 Dallas Texas USA)
  10. Organization: Ericsson Network Systems
  11. Lines: 299
  12. Nntp-Posting-Host: s08b02.exu.ericsson.se
  13.  
  14.  
  15. In article <1992Aug26.145011.20880@exu.ericsson.se> I wrote:
  16. : --------------------------------------------------------------------------
  17. : Here's a hint.  Use "xterm".  You can re-bind the crap of anything you
  18. : damn well please on the keyboard, w/ all kinds of crazy sequences that
  19. : you'll never be able to remember.  You can do this via the ".Xdefaults"
  20. : file.  IMHO, xterm is *much* more flexible than shelltool or cmdtool as
  21. : an openwindows shell interface.  If you want more info, let me know and
  22. : I can e-mail you some files, etc.
  23. : --------------------------------------------------------------------------
  24.  
  25. Several people have requested that I make a post re: the above so this
  26. is it.  I will put some of the info in this post and the rest in a 2nd
  27. post.
  28.  
  29. OK.  Here are the disclaimers.  I'm using a SPARCstation with a SUN4 type
  30. keyboard with a monochrome monitor.  We are running SUN's OpenWindows V2.0.
  31. My key bindings are done thru a combination of the ".Xdefaults" file, the
  32. ".joverc" file for use with jove (and I'm using jove V4.9 now), and finally
  33. the ".emacs" file for use with GNUEmacs.  These bindings are intended to be
  34. used only from an "xterm" shell.  THEY WILL NOT WORK FROM A SHELLTOOL OR
  35. CMDTOOL SHELL!
  36.  
  37. Here's the line that I use to start an "xterm" shell.  I call this typically
  38. from a "shelltool" shell and then I exit the shelltool shell when the
  39. xterm shell becomes alive.
  40.  
  41. xterm -rv -j -rw -xrm "*pointerShape : top_left_arrow" -sf -geometry 110x45+25+80 #70x70+792+5 -T "Xterm wide" -n Xwide -fn screen.b.16 -iconic -e tcsh   &
  42.  
  43.  
  44. Note:  From the above, xterm invocation that I'm having it execute the
  45. "tcsh" program.  If you're running the plain "csh", then change yours
  46. to execute that shell, or whatever other shell you may be running.
  47. Also, note, only issue the above "xterm" once you setup the following
  48. in your ".Xdefaults" file, your ".joverc" file and/or your ".emacs" file.
  49.  
  50. Once you've got the .Xdefaults, the .joverc and/or the .emacs files
  51. setup, and you've logged off and back on, then when you get your "xterm"
  52. started, issue the command "jove" from the xterm shell to fire up jove,
  53. or "emacs -nw" from the xterm shell to fire up GNUEmacs.  Note the
  54. "-nw" which means "no window".  I use this so that I can keep all my
  55. current "xterm" window attributes and such that GNUEmacs does not
  56. start up a new window (shell).
  57.  
  58. Here's the info from my .Xdefaults file to rebind the keyboard for use
  59. with an "xterm" shell.
  60.  
  61. ------------- begin cut here for use in .Xdefaults file--------------------
  62. XTerm*Scrollbar:    False
  63. XTerm*VT100.translations:    \
  64. #override  \n\
  65.   Shift<KeyPress>Select:select-cursor-start() select-cursor-end(CLIPBOARD,CUT_BUFFER0,PRIMARY)\n\
  66.         Shift<Key>F1:                   string("cat ~/setup/.fkeys
  67.     <Key>F1:                        string(0x1b) string("1")     \n\
  68.     Shift<Key>F2:                   string("ls -aF
  69.     <Key>F2:                        string(0x1b) string("2")     \n\
  70.     Shift<Key>F3:                   string("exit")               \n\
  71.     <Key>F3:                        string(0x1b) string("3")     \n\
  72.     Shift<Key>F4:                   string("mail
  73.     <Key>F4:                        string(0x1b) string("4")     \n\
  74.     Shift<Key>F5:                   string("rusers
  75.     <Key>F5:                        string(0x1b) string("5")     \n\
  76.     Shift<Key>F6:                   string("/home/exuxtde/bin/sun4/q
  77.     <Key>F6:                        string(0x1b) string("6")     \n\
  78.     Shift<Key>F7:                   string("ftp rchn
  79.     <Key>F7:                        string(0x1b) string("7")     \n\
  80.     Shift<Key>F8:                   string("ps -aux
  81.     <Key>F8:                        string(0x1b) string("8")     \n\
  82.     Shift<Key>F9:                   string("alias|more
  83.     <Key>F9:                        string(0x1b) string("9")     \n\
  84.     Shift<Key>F10:                  string("ls -laF")            \n\
  85.     <Key>F10:                       string(0x1b) string("0")     \n\
  86.      Shift<Key>SunF36:               string("lpq
  87.      <Key>SunF36:                    string(0x18) string("1")     \n\
  88.      Shift<Key>SunF37:               string("lock
  89.      <Key>SunF37:                    string(0x18) string("2")     \n\
  90.        Any<Key>KP_Equal:               string(0x1b) string("h")     \n\
  91.      Shift<Key>KP_Divide:            string(0x1c)                 \n\
  92.         <Key>KP_Divide:              string(0x12)                 \n\
  93.      Shift<Key>KP_Multiply:          string(0x1b) string("s")     \n\
  94.         <Key>KP_Multiply:            string(0x13)                 \n\
  95.      Shift<Key>KP_Subtract:          string(0x19)                 \n\
  96.         <Key>KP_Subtract:            string(0x18) string("-")     \n\
  97.      Shift<Key>KP_7:                 string(0x18) string("W")     \n\
  98.         <Key>KP_7:                   string(0x18) string(0x17)    \n\
  99.      Shift<Key>KP_8:                 string(0x18) string("A")     \n\
  100.      Ctrl<Key>KP_8:                  string(0x1b) string("{")     \n\
  101.      Meta<Key>KP_8:                  string(0x18) string("A")     \n\
  102.         <Key>KP_8:                   string(0x1b) string("[A")    \n\
  103.      Shift<Key>KP_9:                 string(0x18) string("L")     \n\
  104.         <Key>KP_9:                   string(0x18) string(0x0c)    \n\
  105.      Shift<Key>KP_4:                 string(0x18) string("D")     \n\
  106.      Ctrl<Key>KP_4:                  string(0x08)                 \n\
  107.      Meta<Key>KP_4:                  string(0x18) string("D")     \n\
  108.         <Key>KP_4:                   string(0x1b) string("[D")    \n\
  109.      Any<Key>KP_5:                   string(0x1b) string("[218z") \n\
  110.      Shift<Key>KP_6:                 string(0x18) string("C")     \n\
  111.      Ctrl<Key>KP_6:                  string(0x06)                 \n\
  112.      Meta<Key>KP_6:                  string(0x18) string("C")     \n\
  113.         <Key>KP_6:                   string(0x1b) string("[C")    \n\
  114.      Shift<Key>KP_1:                 string(0x1b) string("L")     \n\
  115.         <Key>KP_1:                   string(0x18) string("E")     \n\
  116.      Shift<Key>KP_2:                 string(0x18) string("B")     \n\
  117.      Ctrl<Key>KP_2:                  string(0x1b) string("}")     \n\
  118.      Meta<Key>KP_2:                  string(0x18) string("B")     \n\
  119.         <Key>KP_2:                   string(0x1b) string("[B")    \n\
  120.      Shift<Key>KP_3:                 string(0x1b) string("U")     \n\
  121.         <Key>KP_3:                   string(0x06)                 \n\
  122.      Shift<Key>KP_0:                 string(0x0f)                 \n\
  123.         <Key>KP_0:                   string(0x01)                 \n\
  124.      Shift<Key>KP_Decimal:           string(0x18) string(".")     \n\
  125.         <Key>KP_Decimal:             string(0x1b) string(".")     \n\
  126.      Shift<Key>KP_Enter:             string(0x18) string("7")     \n\
  127.         <Key>KP_Enter:               string(0x18) string("6")     \n\
  128.      Shift<Key>KP_Add:               string(0x19)                 \n\
  129.         <Key>KP_Add:                 string(0x18) string("+")     \n\
  130.         Shift<Key>Mode_switch:          string(0x18) string("l")     \n\
  131.            <Key>Mode_switch:            string(0x18) string("w")     \n\
  132.   Shift<Key>Delete:                     string(0x04)                 \n\
  133.      <Key>Delete:                       string(0x7f)                 \n\
  134.   Any<Key>BackSpace:                    string(0x08)                 \n\
  135.   Shift<Key>R1:                         string(0x18) string("4")     \n\
  136.      <Key>R1:                           string(0x18) string("3")     \n\
  137.   Shift<Key>R2:                         string(0x18) string("9")     \n\
  138.      <Key>R2:                           string(0x17)                 \n\
  139.   Shift<Key>R3:                         string(0x18) string("8")     \n\
  140.      <Key>R3:                           string(0x19)                 \n\
  141.   Any<Key>L1:                           string(0x1b) string("z")     \n\
  142.   Any<Key>L3:                           string(0x18) string("a")     \n\
  143.   Any<Key>L6:  start-extend() select-end(PRIMARY, CLIPBOARD, CUT_BUFFER0) \n\
  144.   Any<Key>L8:  insert-selection(CLIPBOARD) \n\
  145.   Any<Key>L9:                           string(0x1b) string("a")           \n
  146. XTerm*boldFont:    screen.b.16
  147. XTerm*font:    screen.r.16
  148. XTerm*reverseVideo:    True
  149. XTerm*saveUnder:    False
  150. XTerm*sunFunctionKeys:    True
  151. XTerm*termName:    xterm
  152. XTerm*ttyModes:    intr ^c erase ^h kill ^u
  153. :    
  154. ------------- end cut here for use in .Xdefaults file--------------------
  155.  
  156. To find out what a particular key is named for use in the above, start up
  157. the "xev" program from an xterm shell and then type the key in question.
  158. You'll get a couple of lines of info and you'll see the key's name, e.g.
  159. "F31" in there somewhere.
  160.  
  161. Following is the .joverc file I use which binds jove functions to the
  162. key sequences that I defined above:
  163.  
  164. ------------- begin cut here for .joverc file, jove V4.9 --------------------
  165. set case-ignore-search ON
  166. set match-regular-expressions ON
  167. #---------------------------------------------------
  168. # Binding for the arrow keys
  169. #---------------------------------------------------
  170. #bind-to-key ansi-codes ^[[
  171. #bind-to-key previous-line ^[[A
  172. #bind-to-key next-line ^[[B
  173. #bind-to-key forward-character ^[[C
  174. #bind-to-key backward-character ^[[D
  175. #---------------------------------------------------
  176. # Binding for the control keys
  177. #---------------------------------------------------
  178. bind-to-key over-write-mode ^A
  179. bind-to-key beginning-of-line ^B
  180. bind-to-key forward-word ^F
  181. bind-to-key backward-word ^H
  182. bind-to-key next-page ^N
  183. bind-to-key previous-page ^P
  184. bind-to-key visit-file ^V
  185. bind-to-key exit-jove ^Z
  186. bind-to-key delete-previous-character ^?
  187. bind-to-key search-forward ^_
  188. bind-to-key search-reverse ^\
  189. #---------------------------------------------------
  190. # Binding for the escape keys
  191. #---------------------------------------------------
  192. bind-to-key execute-kbd-macro ^[/
  193. bind-to-key beginning-of-file ^[b
  194. bind-to-key case-word-capitalize ^[c
  195. bind-to-key end-of-file ^[e
  196. bind-to-key find-file ^[i
  197. bind-to-key bind-to-key ^[k
  198. bind-to-key next-window ^[n
  199. bind-to-key write-file ^[o
  200. bind-to-key previous-window ^[p
  201. bind-to-key search-forward ^[s
  202. bind-to-key exit-jove ^[z
  203. bind-to-key beginning-of-file ^[B
  204. bind-to-key case-word-capitalize ^[C
  205. bind-to-key end-of-file ^[E
  206. bind-to-key describe-command ^[H
  207. bind-to-key find-file ^[I
  208. bind-to-key bind-to-key ^[K
  209. bind-to-key next-window ^[N
  210. bind-to-key write-file ^[O
  211. bind-to-key previous-window ^[P
  212. bind-to-key search-forward ^[S
  213. bind-to-key exit-jove ^[Z
  214. bind-to-key set-mark ^[.
  215. bind-to-key beginning-of-window ^[{
  216. bind-to-key end-of-window ^[}
  217. #---------------------------------------------------
  218. # Binding for the function keys F1-F12 for Sun4 kbd
  219. # Note: The normal key mappings for these keys have 
  220. # been changed via the .Xdefaults file.
  221. #---------------------------------------------------
  222. bind-to-key delete-other-windows ^[1
  223. bind-to-key split-current-window ^[2
  224. bind-to-key write-file ^[3
  225. bind-to-key find-file ^[4
  226. bind-to-key query-replace ^[5
  227. bind-to-key list-buffers ^[6
  228. bind-to-key previous-page ^[7
  229. bind-to-key next-page ^[8
  230. bind-to-key delete-buffer ^[9
  231. bind-to-key describe-key ^[0
  232. bind-to-key describe-command ^X1
  233. bind-to-key select-buffer ^X2
  234. #---------------------------------------------------
  235. # Binding for some of the righthand and lefthand
  236. # keypad keys for Sun4 kbd.
  237. # Note: The normal key mappings for these keys have 
  238. # been changed via the .Xdefaults file.
  239. #---------------------------------------------------
  240. bind-to-key execute-named-command ^X3
  241. bind-to-key shell-command ^X4
  242. bind-to-key kill-next-word ^X+
  243. bind-to-key grow-window ^X6
  244. bind-to-key shrink-window ^X7
  245. bind-to-key apropos ^Xa
  246. bind-to-key kill-to-end-of-line ^X.
  247. bind-to-key beginning-of-file ^XA
  248. bind-to-key beginning-of-line ^XD
  249. bind-to-key end-of-line ^XC
  250. bind-to-key end-of-file ^XB
  251. bind-to-key backward-word ^XE
  252. #---------------------------------------------------
  253. # Define macros
  254. #---------------------------------------------------
  255. # define-macro copy-above-space ^[[A^[.^F^H^W^Y^[[B^Y
  256. # define-macro copy-below-space ^[[B^[.^F^H^W^Y^[[A^Y
  257. define-macro copy-above-word ^[[A^[.^F^W^Y^[[B^Y
  258. define-macro copy-above-line ^[[A^[.^E^W^Y^[[B^Y
  259. define-macro copy-below-word ^[[B^[.^F^W^Y^B^[[A^E^Y
  260. define-macro copy-below-line ^[[B^[.^E^W^Y^[[A^Y
  261. define-macro copy-above-space ^[[A^[.^F^H^W^Y^X^X^[[B^Y
  262. define-macro copy-below-space ^[[B^[.^F^H^W^Y^X^X^[[A^Y
  263. define-macro fndnxt ^_^M
  264. define-macro fndprev ^\^M
  265. define-macro insert-4-spaces     
  266. define-macro movetest ^[itest.script^M^[2^[isgaedati.script^M^_jbs m^M^[[218z^[.^[e^W^Y^[[218z^B^Y
  267. define-macro auto-get-file ^K^Y^[[C^[i^Y^M
  268. define-macro trim-trailing-asterisk ^_\\*^M^[.^[[214z^[[216z^W
  269. define-macro trim-leading-asterisk ^_* ^M^[.^B^W
  270. define-macro fix-xtphone-list   ^[[C^[[C^[[C^[[C^[[C  ^[[C^[[C^[[C^[[C^[[C^[[C  ^[[B^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D
  271. define-macro comment-out-np ^S^B.* ^E
  272. define-macro remove-trailing-blanks ^E^[[214z^[[216z^[[C^K^M
  273. define-macro insert-blank-comment ^B^M^[[A                                                        !                                          !^B^[[B
  274. define-macro ins-jbs-comm ^M^[[A!----------------- jbs ----------------------------------------------------------------------------!^B^[[B
  275. define-macro delete-line ^K^K
  276. define-macro insert-us :us.^[s ^M^[[D:eus.
  277. define-macro help-keypad ^[1^[2^[4/home/exujsch/setup/keypad.txt^M^[[218z
  278. define-macro fix-tr-listing ^_\^1^M^B^Q^L^K^B^[[B^K^K
  279. define-macro fix-manhours ^X.^M^[[D^[[B
  280. define-macro abort ^G
  281. #---------------------------------------------------
  282. # Bind the above macro definitions to keys
  283. #---------------------------------------------------
  284. #bind-macro-to-key insert-4-spaces ^I
  285. bind-macro-to-key fndprev ^R
  286. bind-macro-to-key fndnxt ^S
  287. bind-macro-to-key copy-above-word ^X^W
  288. bind-macro-to-key copy-below-word ^XW
  289. bind-macro-to-key copy-above-line ^X^L
  290. bind-macro-to-key copy-below-line ^XL
  291. bind-macro-to-key copy-above-space ^Xw
  292. bind-macro-to-key copy-below-space ^Xl
  293. bind-macro-to-key auto-get-file ^[A
  294. bind-macro-to-key auto-get-file ^[a
  295. bind-macro-to-key insert-blank-comment ^[=
  296. bind-macro-to-key ins-jbs-comm ^['
  297. bind-macro-to-key delete-line ^X-
  298. bind-macro-to-key insert-us ^[;
  299. bind-macro-to-key help-keypad ^[h
  300. bind-macro-to-key abort ^X8
  301. bind-macro-to-key abort ^X9
  302. ------------- end cut here for .joverc file, jove V4.9 --------------------
  303.  
  304. The GNUemacs key bindings for use in the .emacs file, will follow this
  305. posting.
  306.  
  307. Enjoy,
  308. --
  309. ___________________________________________________________________________
  310. Internet....: exujsch@exu.ericsson.se | "Everything I say is the absolute
  311. Real life...: Johnny Schmittou        |  Gospel...  Nah, just kidding."
  312. Virtual life: Q-man   ---<<<I'd rather be drumming.>>>--- Dallas, Texas USA
  313.