[comp.sys.ibm.pc] Wanted: .emacs for WordStar

dubner@hpspkla.spk.hp.com (Joseph L. Dubner) (10/21/89)

Don't laugh, but my favorite editor is WordStar (version 4.0).  My
fingers fly over its CNTL-this and CNTL-that sequences -- much preferred
to the "meta" key of 'emacs' or the insert/command mode of 'vi'.  But I
don't expect WordStar International Corp. to port their MS-DOS jewel to
unix anytime in my lifetime.

Alas, I need to use emacs at work.  I suppose I could just learn it, but
*all* of my other editors (Turbo C, Turbo Pascal, SideKick, my DOS
command line editor, etc.) honor the WordStar keys and I'd rather not
have to switch back and forth.  Which brings me to my question: can
anyone suggest a file of key bindings that makes emacs act like WordStar?

Thanks,
Joe Dubner
dubner@hpspkla.HP.COM
(509) 921-3514 (days)
(208) 772-3657 (eves)

madd@world.std.com (jim frost) (11/16/89)

dubner@hpspkla.spk.hp.com (Joseph L. Dubner) writes:
>can
>anyone suggest a file of key bindings that makes emacs act like WordStar?

Sure.  My "wordstar" emulation bindings follow.

The bindings are quite similar to the 3.0 bindings; having never used
4.0, I don't know what the differences are.  There are some minor
differences when dealing with blocks, but most of the time these work
fine.

Note that ^G is the emacs 'quit' character and if it is hit too fast
it can cause emacs to abort.  This is usually only a problem on very
slow machines.

jim frost
software tool & die     "The World" Public Access Unix for the '90s
madd@std.com            +1 617-739-WRLD  24hrs {3,12,24}00bps

-- cut here --
; Wordstar Keycap Definition for EMACS
;
; This file causes EMACS to emulate WordStar.  You should do one of
; two things to make this work.  Either copy this file into ~/.emacs,
; after which it will be loaded every time you call up emacs, or
; copy it into ~/.wordstar and make an alias ws 'emacs -l ~/.wordstar'
; which will let you call it up with the normal ws command.
;
; This was created a long time ago on a machine far, far away by
; jim frost (madd@std.com).
;

(setq inhibit-terminal-defaults t)
(setq C-K-map (make-keymap))
(define-key C-K-map " " ())
(define-key C-K-map "b" 'set-mark-command)
(define-key C-K-map "\002" 'set-mark-command)
(define-key C-K-map "c" 'yank)
(define-key C-K-map "\003" 'yank)
(define-key C-K-map "d" 'save-buffers-kill-emacs)
(define-key C-K-map "\004" 'save-buffers-kill-emacs)
(define-key C-K-map "f" 'find-file)
(define-key C-K-map "\006" 'find-file)
(define-key C-K-map "k" 'copy-region-as-kill)
(define-key C-K-map "\013" 'copy-region-as-kill)
(define-key C-K-map "q" 'kill-emacs)
(define-key C-K-map "\021" 'kill-emacs)
(define-key C-K-map "r" 'insert-file)
(define-key C-K-map "\022" 'insert-file)
(define-key C-K-map "s" 'save-some-buffers)
(define-key C-K-map "\023" 'save-some-buffers)
(define-key C-K-map "\025" ())
(define-key C-K-map "v" 'yank)
(define-key C-K-map "\026" 'yank)
(define-key C-K-map "y" 'kill-region)
(define-key C-K-map "\031" 'kill-region)
(define-key C-K-map "\037" 'kill-emacs)

(setq C-O-map (make-keymap))
(define-key C-O-map " " ())
(define-key C-O-map "c" 'center-line)
(define-key C-O-map "\003" 'center-line)
(define-key C-O-map "b" 'switch-to-buffer)
(define-key C-O-map "\002" 'switch-to-buffer)
(define-key C-O-map "j" 'justify-current-line)
(define-key C-O-map "\012" 'justify-current-line)
(define-key C-O-map "k" 'kill-buffer)
(define-key C-O-map "\013" 'kill-buffer)
(define-key C-O-map "l" 'list-buffers)
(define-key C-O-map "\014" 'list-buffers)
(define-key C-O-map "m" 'auto-fill-mode)
(define-key C-O-map "\015" 'auto-fill-mode)
(define-key C-O-map "r" 'set-fill-column)
(define-key C-O-map "\022" 'set-fill-column)
(define-key C-O-map "\025" ())
(define-key C-O-map "wd" 'delete-other-windows)
(define-key C-O-map "wh" 'split-window-horizontally)
(define-key C-O-map "wo" 'other-window)
(define-key C-O-map "wv" 'split-window-vertically)

(setq C-Q-map (make-keymap))
(define-key C-Q-map " " ())
(define-key C-Q-map "a" 'replace-string)
(define-key C-Q-map "\001" 'replace-string)
(define-key C-Q-map "c" 'end-of-buffer)
(define-key C-Q-map "\003" 'end-of-buffer)
(define-key C-Q-map "d" 'end-of-line)
(define-key C-Q-map "\004" 'end-of-line)
(define-key C-Q-map "f" 're-search-forward)
(define-key C-Q-map "\006" 're-search-forward)
(define-key C-Q-map "r" 'beginning-of-buffer)
(define-key C-Q-map "\022" 'beginning-of-buffer)
(define-key C-Q-map "\025" ())
(define-key C-Q-map "y" 'kill-line)
(define-key C-Q-map "\031" 'kill-line)

(define-key global-map "\001" 'backward-word)
(define-key global-map "\002" 'fill-paragraph)
(define-key global-map "\003" 'scroll-up)
(define-key global-map "\004" 'forward-char)
(define-key global-map "\005" 'previous-line)
(define-key global-map "\006" 'forward-word)
(define-key global-map "\007" 'delete-char)
(define-key global-map "\010" 'backward-char)
(define-key global-map "\011" 'indent-for-tab-command)
(define-key global-map "\012" 'help-for-help)
(define-key global-map "\013" C-K-map)
(define-key global-map "\015" 'newline)
(define-key global-map "\017" C-O-map)
(define-key global-map "\020" 'quoted-insert)
(define-key global-map "\021" C-Q-map)
(define-key global-map "\022" 'scroll-down)
(define-key global-map "\023" 'backward-char)
(define-key global-map "\024" 'kill-word)
(define-key global-map "\025" 'quit)
(define-key global-map "\026" 'overwrite-mode)
(define-key global-map "\030" 'next-line)
(define-key global-map "\031" 'kill-line)
(define-key global-map "\035" 'quoted-insert)
(define-key global-map "\037" C-Q-map)

(setq default-fill-column 65)