home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1015 < prev    next >
Internet Message Format  |  1990-12-28  |  6KB

  1. From: dsill@ophiuchi.nswc.navy.mil (Dave Sill)
  2. Newsgroups: alt.sources
  3. Subject: [gnu.emacs] Re: Wordstar emulation mode for GNU Emacs?
  4. Message-ID: <11383@stag.math.lsa.umich.edu>
  5. Date: 14 Mar 90 01:03:35 GMT
  6.  
  7. Original-posting-by: dsill@ophiuchi.nswc.navy.mil (Dave Sill)
  8. Original-subject: Re: Wordstar emulation mode for GNU Emacs?
  9. Reposted-by: emv@math.lsa.umich.edu (Edward Vielmetti)
  10.  
  11. [This is an experimental alt.sources re-posting from the newsgroup(s)
  12. gnu.emacs. Comments on this service to emv@math.lsa.umich.edu 
  13. (Edward Vielmetti).]
  14.  
  15.  
  16. In article <3263@trantor.harris-atd.com>,
  17. laprade@ringworld.harris-atd.com (Ken Laprade) writes:
  18. > Has anyone ever written a Wordstar emulation mode for GNU Emacs (sort of
  19. > like the EDT emulation of edt.el)?  We have some users that would probably
  20. > like this, but I don't want to bother making it if someone else already has.
  21.  
  22. I received the following submission to the elisp archives a while
  23. back.  I'm still trying to get caught up...
  24.  
  25. From: jimf%saber@harvard.harvard.edu (Jim Frost)
  26. >
  27. >What follows is a set of Emacs bindings that give a fair approximation
  28. >of the WordStar 3.x key bindings, with a couple of extensions.  It's
  29. >good enough not to drive WordStar people crazy but I confess that I
  30. >didn't work too hard on it (it shows -- nowadays I'd probably make it
  31. >a mode or something).  If you want to include this in the archives, go
  32. >ahead -- I just give it away to anyone who requests it anyway.
  33.  
  34. Happy hacking,
  35.  
  36. jim frost
  37. saber software
  38. jimf@saber.com
  39.  
  40. -- cut here --
  41. ; Wordstar Keycap Definition for EMACS
  42. ;
  43. ; This file causes EMACS to emulate WordStar.  You should do one of
  44. ; two things to make this work.  Either copy this file into ~/.emacs,
  45. ; after which it will be loaded every time you call up emacs, or
  46. ; copy it into ~/.wordstar and make an alias ws 'emacs -l ~/.wordstar'
  47. ; which will let you call it up with the "normal" ws command.
  48. ;
  49. ; caveats: * ^G (delete-character) is hard bound to the emacs function
  50. ;            quit, so if you delete very fast you might cause emacs to
  51. ;            abort.  tell it to save your file and then to continue and
  52. ;            all will be well, although annoying.  this doesn't happen
  53. ;            often unless the machine is kind of slow.
  54. ;          * block copy and delete work as they do in emacs, not in
  55. ;            wordstar, which means you can block end above the block
  56. ;            begin and you can also block-delete from block begin to
  57. ;            where the cursor is without explicitly doing a block-end.
  58. ;          * ^Owv is split-window-vertically
  59. ;          * ^Owh is split-window-horizontally
  60. ;          * ^Owo is other-window
  61. ;          * ^Owd is delete-other-windows
  62. ;
  63. ; for further information contact jim frost at madd@bu-it.bu.edu
  64. ;
  65.  
  66. (setq inhibit-terminal-defaults t)
  67. (setq C-K-map (make-keymap))
  68. (define-key C-K-map " " ())
  69. (define-key C-K-map "b" 'set-mark-command)
  70. (define-key C-K-map "\002" 'set-mark-command)
  71. (define-key C-K-map "c" 'yank)
  72. (define-key C-K-map "\003" 'yank)
  73. (define-key C-K-map "d" 'save-buffers-kill-emacs)
  74. (define-key C-K-map "\004" 'save-buffers-kill-emacs)
  75. (define-key C-K-map "f" 'find-file)
  76. (define-key C-K-map "\006" 'find-file)
  77. (define-key C-K-map "k" 'copy-region-as-kill)
  78. (define-key C-K-map "\013" 'copy-region-as-kill)
  79. (define-key C-K-map "q" 'kill-emacs)
  80. (define-key C-K-map "\021" 'kill-emacs)
  81. (define-key C-K-map "r" 'insert-file)
  82. (define-key C-K-map "\022" 'insert-file)
  83. (define-key C-K-map "s" 'save-some-buffers)
  84. (define-key C-K-map "\023" 'save-some-buffers)
  85. (define-key C-K-map "\025" ())
  86. (define-key C-K-map "v" 'yank)
  87. (define-key C-K-map "\026" 'yank)
  88. (define-key C-K-map "y" 'kill-region)
  89. (define-key C-K-map "\031" 'kill-region)
  90. (define-key C-K-map "\037" 'kill-emacs)
  91.  
  92. (setq C-O-map (make-keymap))
  93. (define-key C-O-map " " ())
  94. (define-key C-O-map "c" 'center-line)
  95. (define-key C-O-map "\003" 'center-line)
  96. (define-key C-O-map "b" 'switch-to-buffer)
  97. (define-key C-O-map "\002" 'switch-to-buffer)
  98. (define-key C-O-map "j" 'justify-current-line)
  99. (define-key C-O-map "\012" 'justify-current-line)
  100. (define-key C-O-map "k" 'kill-buffer)
  101. (define-key C-O-map "\013" 'kill-buffer)
  102. (define-key C-O-map "l" 'list-buffers)
  103. (define-key C-O-map "\014" 'list-buffers)
  104. (define-key C-O-map "m" 'auto-fill-mode)
  105. (define-key C-O-map "\015" 'auto-fill-mode)
  106. (define-key C-O-map "r" 'set-fill-column)
  107. (define-key C-O-map "\022" 'set-fill-column)
  108. (define-key C-O-map "\025" ())
  109. (define-key C-O-map "wd" 'delete-other-windows)
  110. (define-key C-O-map "wh" 'split-window-horizontally)
  111. (define-key C-O-map "wo" 'other-window)
  112. (define-key C-O-map "wv" 'split-window-vertically)
  113.  
  114. (setq C-Q-map (make-keymap))
  115. (define-key C-Q-map " " ())
  116. (define-key C-Q-map "a" 'replace-string)
  117. (define-key C-Q-map "\001" 'replace-string)
  118. (define-key C-Q-map "c" 'end-of-buffer)
  119. (define-key C-Q-map "\003" 'end-of-buffer)
  120. (define-key C-Q-map "d" 'end-of-line)
  121. (define-key C-Q-map "\004" 'end-of-line)
  122. (define-key C-Q-map "f" 're-search-forward)
  123. (define-key C-Q-map "\006" 're-search-forward)
  124. (define-key C-Q-map "r" 'beginning-of-buffer)
  125. (define-key C-Q-map "\022" 'beginning-of-buffer)
  126. (define-key C-Q-map "\025" ())
  127. (define-key C-Q-map "y" 'kill-line)
  128. (define-key C-Q-map "\031" 'kill-line)
  129.  
  130. (define-key global-map "\001" 'backward-word)
  131. (define-key global-map "\002" 'fill-paragraph)
  132. (define-key global-map "\003" 'scroll-up)
  133. (define-key global-map "\004" 'forward-char)
  134. (define-key global-map "\005" 'previous-line)
  135. (define-key global-map "\006" 'forward-word)
  136. (define-key global-map "\007" 'delete-char)
  137. (define-key global-map "\010" 'backward-char)
  138. (define-key global-map "\011" 'indent-for-tab-command)
  139. (define-key global-map "\012" 'help-for-help)
  140. (define-key global-map "\013" C-K-map)
  141. (define-key global-map "\015" 'newline)
  142. (define-key global-map "\017" C-O-map)
  143. (define-key global-map "\020" 'quoted-insert)
  144. (define-key global-map "\021" C-Q-map)
  145. (define-key global-map "\022" 'scroll-down)
  146. (define-key global-map "\023" 'backward-char)
  147. (define-key global-map "\024" 'kill-word)
  148. (define-key global-map "\025" 'quit)
  149. (define-key global-map "\026" 'overwrite-mode)
  150. (define-key global-map "\030" 'next-line)
  151. (define-key global-map "\031" '(lambda () (interactive)
  152.                 (beginning-of-line)
  153.                 (delete-region (point)
  154.                            (progn (forward-line 1)
  155.                               (point)))))
  156. (define-key global-map "\035" 'quoted-insert)
  157. (define-key global-map "\037" C-Q-map)
  158.  
  159. (setq default-fill-column 65)
  160.  
  161. Dave Sill (dsill@relay.nswc.navy.mil)
  162.