[comp.editors] Wordstar-like editor for Unix

litauer@infko.UUCP (Christoph Litauer) (09/18/90)

Hello, 
I would like to use a Wordstar-like editor on a Unix-System, because I 
worked much with Turbo-Pasacal and Turbo-C on my PC. So, is there anyone, who
ever made a wordstar-configuration for the Emacs-editor, or who is able to
simulate this kind of editor by using vi ???

Greetings, Christoph


Chrsitoph Litauer                                  litauer@infko.UUCP      
Uni Koblenz,                                       (..!unido!infko!litauer)
Inst. f. Informatik                             
Rheinau 3-4, D-5400 Koblenz, Germany            

a0528@gray3.zrz.tu-berlin.de (Ueb28) (09/19/90)

In article <1299@infko.UUCP> litauer@infko.UUCP (Christoph Litauer) writes:

   I would like to use a Wordstar-like editor on a Unix-System, because I 
   worked much with Turbo-Pasacal and Turbo-C on my PC. So, is there anyone, who
   ever made a wordstar-configuration for the Emacs-editor, or who is able to
   simulate this kind of editor by using vi ???

I can't imagine this is possible with vi.
But there is a Wordstar emulation for Unipress (Gosling) Emacs. On the
CeBIT computer fair I had a short look at the source, and the comments
made me think that it is not written exclusively for Unipress Emacs.
Maybe it is portable to GNU Emacs, and if not, it should be possible
to write a similar thing for GNU Emacs. Perhaps it already exists.
--
-----------------
Juergen Nickelsen
nickel@w104zrz.zrz.tu-berlin.de
nickelsen@mikroperipherik.e-technik.tu-berlin.dbp.de

jan@echo.canberra.edu.au (Jan Newmarch) (09/20/90)

I have never tried it, but there is the Fenix editor for sale which
looks like Wordstar. Fax (813) 923-1542. I have translations for the Motif
text widget under X-Windows which make it a bit Wordstar-ish:

	*XmText*translations:	#override		\n\
	  Ctrl<Key>S:		 backward-character() \n\
	  Ctrl<Key>Q,Ctrl<Key>R: beginning-of-file() \n\
	  Ctrl<Key>K,Ctrl<Key>S: kill-selection() \n\
	  Ctrl<Key>K,Ctrl<Key>U: unkill() \n\
	  Ctrl<Key>K,Ctrl<Key>Y: delete-selection() \n\
	  Ctrl<Key>K,Ctrl<Key>C: stuff()  \n\
	  Ctrl<Key>K,Ctrl<Key>V: kill-selection() unkill() \n\
	  Ctrl<Key>R:            previous-page() grab-focus() \n\
	  Ctrl<Key>C:            next-page() set-insertion-point() \n\
	  Ctrl<Key>Q,Ctrl<Key>C: end-of-file() \n\
	  Ctrl<Key>Q,Ctrl<Key>S: beginning-of-line() \n\
	  Ctrl<Key>Q,Ctrl<Key>D: end-of-line() \n\
	  Ctrl<Key>K,Ctrl<Key>B: set-insertion-point() extend-start() \n\
	  Ctrl<Key>K,Ctrl<Key>K: extend-end(PRIMARY,CUT_BUFFER0) \n\
	  Ctrl<Key>Y:		 delete-to-end-of-line() delete-to-start-of-line()
	

+----------------------+---+
  Jan Newmarch, Information Science and Engineering,
  University of Canberra, PO Box 1, Belconnen, Act 2616
  Australia. Tel: (Aust) 6-2522422. Fax: (Aust) 6-2522999

  ACSnet: jan@ise.canberra.edu.au
  ARPA:   jan%ise.canberra.edu.au@uunet.uu.net
  UUCP:   {uunet,ukc}!munnari!ise.canberra.edu.au!jan
  JANET:  jan%au.edu.canberra.ise@EAN-RELAY

+--------------------------+

wyle@inf.ethz.ch (Mitchell Wyle) (09/20/90)

In <A0528.90Sep19175647@gray3.zrz.tu-berlin.de> 
nickel@w104zrz.zrz.tu-berlin.de claims:

>ever made a wordstar-configuration for the Emacs-editor, or who is able to
>simulate this kind of editor by using vi ???
>
>I can't imagine this is possible with vi.

The only problems have to do with mapping stuff like control S.
Otherwise, it's a pretty simple map macro set.

map ^A ^V^[hi
map ^D ^V^[li

etc.  You stay in insert mode and do cursor movement with the wordstar
keys.  Mapping the menu stuff ^Q and ^K is harder but do-able.

>But there is a Wordstar emulation for Unipress (Gosling) Emacs. On the

All of these "great" emulation packages for the different emacsen have the
same untenable problems:

1) emacs is still underneath the emulation.  You still need
control-meta-alt-shift-compose-diamond-clover-cokebottle-V 
to give commands.  If you accidentily type
control-meta-alt-shift-compose-diamond-clover-pepsibottle-V
you are blasted into some bizare emacs twilight zone where it forked three
times, and is loading 12 Gigabytes of hypertext help in the background.

When you search for text, the cursor jumps around while you type.
When you save a file, a command line appears.
Etc.
Emacs is still there.  You are *not* in wordstar.

2) Since it's emacs, you have to wait a few years til it's your turn to
type at it.  If you are running on a cray-2 and ram disk, response time
approaches vi.

bevan@cs.man.ac.uk (Stephen J Bevan) (09/20/90)

In <8732@neptune.inf.ethz.ch> wyle@inf.ethz.ch (Mitchell Wyle) writes :-

> All of these "great" emulation packages for the different emacsen have the
> same untenable problems:
> 
> 1) emacs is still underneath the emulation.  You still need
> control-meta-alt-shift-compose-diamond-clover-cokebottle-V 
> to give commands. 

What commands?
Wordstar does most (all?) of its commands via the control key so I
don't see how that is any different.

> If you accidentily type
> control-meta-alt-shift-compose-diamond-clover-pepsibottle-V
> you are blasted into some bizare emacs twilight zone where it forked three
> times, and is loading 12 Gigabytes of hypertext help in the background.

This only happens if you layer the WordStar keys over the Emacs ones.
If you use empty keymaps to start with, all you'll get is a message
when you press something you shouldn't.

> When you search for text, the cursor jumps around while you type.

Only if you bind the WordStar search function directly to
isearch-forward rather than search-forward.  Acutally binding it to
search-forward is a bit naive there is a lot more processing you need
to do before acutally doing the search.

> When you save a file, a command line appears.

Sorry don't understand this.  When I save a file all it does is tell
me the name of the file it has saved.  You can even get rid of that if
you really want to.

> Emacs is still there.  You are *not* in wordstar.

I would have thought this is rather obvious.  If you define it on top
of vi then :-

`vi is still there.  You are *not* in wordstar'

So what?

> 2) Since it's emacs, you have to wait a few years til it's your turn to
> type at it.  If you are running on a cray-2 and ram disk, response time
> approaches vi.

Well it runs quite nicely on my machine, but then again it is a SPARCstation!


Stephen J. Bevan	bevan@cs.man.ac.uk

PS. I *have* written a WordStar mode for Emacs.  I just need to work
    out how to deal with the help screens, before I post it.

PPS.  I think WordStar is almost as bad an editor as vi and never use
      the mode myself.  I only wrote it for somebody else.

em@dce.ie (Eamonn McManus) (09/21/90)

In article <8732@neptune.inf.ethz.ch> wyle@inf.ethz.ch (Mitchell Wyle) writes:
[re wordstar arrow-key emulation]
>map ^A ^V^[hi
>map ^D ^V^[li
>
>etc.  You stay in insert mode and do cursor movement with the wordstar
>keys.  Mapping the menu stuff ^Q and ^K is harder but do-able.

(That should be map!, not map.)

This topic seems to come up every few months and advice like the above is
invariably given.  I would be very interested to see a macro for up or
down cursor motion that works correctly in all parts of a line, including
the first character.  If you try writing such a macro you will soon see
what the problem is.
-- 
Eamonn McManus    <em@dce.ie>    <em%dce.ie@cunyvm.cuny.edu>
	    Fingers are for fuguing.

shri@ncst.ernet.in (H.Shrikumar) (09/25/90)

In article <1299@infko.UUCP> litauer@infko.UUCP (Christoph Litauer) writes:
>ever made a wordstar-configuration for the Emacs-editor, or who is able to
>simulate this kind of editor by using vi ???

   I have absolutely no idea why I did it :-), but a while ago
I did make a "ws" emulator all within vi! 

   This is for cshell users, bourne and korn shell users need to make
some mods. Such as a ws.sh file instead of ws.alias ...


   shar follows below ...

-- shrikumar ( shri@ncst.in )

--------:<--------
#!/bin/sh
# "ws" emulation for vi.
# A (very inadequate) old-CP/M-WS emulator for vi/UNIX.
# Comments welcome, bug fixes welcome, but bug reports to /dev/null
# flames to /dev/null
# use at own risk. Enjoy!
echo Extracting ws.alias ... | tr -d '\012'
sed 's/^X//' << 'xxEOFxx' > ws.alias
Xalias ws 'vi "+source ~shri/src/sh/wsovly.ovl" ~shri/src/sh/wsmsgs.ovr'
xxEOFxx
echo done.
echo Extracting ws.exrc ... | tr -d '\012'
sed 's/^X//' << 'xxEOFxx' > ws.exrc
Xset notimeout autoindent report=1 nomagic ignorecase nomesg redraw 
Xset remap noterse nowrapscan warn errorbells
Xmap g 1G
Xmap! ^? ^[xi
X" <<< OPENING MENU >>>=======================================================
Xmap L :L - not implemented^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H
Xmap F :F - not implemented^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H
Xmap H :H - not implemented^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H
Xmap D :set wm=15 beautify^M:e! <filename>^H^H^H^H^H^H^H^H^H^H
Xmap N :set showmatch lisp^M:e! <filename>^H^H^H^H^H^H^H^H^H^H
Xmap P :!lpr <filename>^H^H^H^H^H^H^H^H^H^H
Xmap E :!mv -i <oldname> <newname>^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H
Xmap O :!cp -i <oldname> <newname>^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H
Xmap Y :!rm -i <filename>^H^H^H^H^H^H^H^H^H^H
Xmap R :! <command>^H^H^H^H^H^H^H^H^H
Xmap X :q!^M
Xmap S :!spell <filename>^H^H^H^H^H^H^H^H^H^H
Xmap M :M - not implemented^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H
X" Based on "WORDSTAR IN ACTION", Randall McMullan, NCST lib 2056
X" Cursor moves leave in insert mode =======================================
X" Any session must begin with a down cursor movement for sanity .... :-)
Xmap ^[OD ha
Xmap ^[OB ja
Xmap ^[OA ka
Xmap ^[OC la
X" Cursor moves while in insert mode=========================================
Xmap! ^[OD ^[ha
Xmap! ^[OB ^[j^Ga
Xmap! ^[OA ^[k^Ga
Xmap! ^[OC ^[la
Xmap! ^R ^[^L^Ga
X" QUIT, SAVE, DONE and EXIT from file edit =================================
Xmap! ^Kq ^[:rew!^M:source ~shri/src/sh/wsovly.ovl^M
Xmap! ^Ks ^[:!mv % `basename % '\..*'`.bak^M:w^Ma
Xmap! ^Kd ^[:!mv % `basename % '\..*'`.bak^M:w^M^[:rew!^M:source ~shri/src/sh/wsovly.ovl^M
Xmap! ^Kx ^[:!mv % `basename % '\..*'`.bak^M:wq^M
Xmap! ^Kr ^[:r <filename>^H^H^H^H^H^H^H^H^H^H 
Xmap! ^Kp ^[:!lpr %^Ma
X" Chapter: Changing Layout =================================================
Xmap! ^B ^[!}fmt^M}^Ga
Xmap! ^Qq^B ^[:!Gfmt^M^Ga
X" Centre text line =========================================================
Xmap! ^Oc ^[ko.ce^V^[!jnroff^M^Ga
X" Insert mode toggle ... implementing a toggle involves messy remaps. Avoid.
X"map! ^V^V ^[:^V - not implemented^U^Ha
Xmap! ^U ^[U^Ga
Xmap! ^Y ^[dd^Ga
Xmap! ^T ^[dw^Ga
X" Chapter: Block Moves =====================================================
Xmap! ^Kb ^[:mark b^M^Ga
Xmap! ^Kk ^[:mark k^M^Ga
Xmap! ^Kv ^[:'b,'kmove .^M^Ga
Xmap! ^Kc ^[:'b,'kcopy .^M^Ga
Xmap! ^Ky ^[:'b,'kdelete^M^Ga
X" Movement commands .... ===================================================
Xmap! ^Qc ^[G^Ga
Xmap! ^Qr ^[1G^Ga
Xmap! ^E ^[k^Ga
Xmap! ^X ^[j^Ga
X" You must start up vi with stty old to be able to use this.
Xmap! ^Z ^[^F^Ga
Xmap! ^W ^[^B^Ga
X" Idiosyncrazies of vi .. just can't escape ^D. behaves like a line terminator.
X"map! ^V^D ^[la
X" Little use ... ^S is often trapped by terminal emulators. as is ^Q ..hurts ws.
Xmap! ^S ^[ha
Xmap! ^A ^[ba
Xmap! ^F ^[wa
X" Find and Find+replace  ===================================================
Xmap! ^Qf ^[/<find_pattern>^H^H^H^H^H^H^H^H^H^H^H^H^H^H
Xmap! ^Qa ^[:1,$s/<find_pattern>/<replace_by>/gc^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H
Xmap! ^L ^[/^M^Ga
X" Chapter: Quick Tricks ====================================================
Xmap! ^Kf ^[:!ls -sglC^M
Xmap! ^Kj ^[:!rm -i <filename>^H^H^H^H^H^H^H^H^H^H 
X" Chapter: Styles and Habits ===============================================
Xmap! ^Qe ^[H^Ga
Xmap! ^Qs ^[^^Ga
Xmap! ^Qd ^[$^Ga
Xmap! ^Qy ^[d$^Ga
xxEOFxx
echo done.
echo 'The above file has been piped thru cat -v for transmission.'
echo 'Replace any occurance of Caret-X by the control character.'
echo Extracting wsmsgs.ovr | tr -d '\012'
sed 's/^X//' << 'xxEOFxx' > wsmsgs.ovr
X           not editing
X                 < < <  O P E N I N G    M E N U  > > >
X   ----Preliminary Commands-----  | --File Commands-- | -- System Commands--
X L  Change logged directory       |                   |   R  Run a Program
X F  File Directory (always ON)    |  P PRINT a file   |   X  Exit to system
X H  Set Help Level (always max)   |                   |
X   ----Commands to open a file--- |  E RENAME a file  | --WordStar Options---
X    D Open a document file        |  O COPY a file    |   M  Run Mailmerge
X    N Open a non-document file    |  Y DELETE a file  |   S  Run Spellstar
X 
X [ DONT hit any cursor key in menu screen. (antidote: hit ESCAPE)          ]
X [ For SANITY during File Edit - hit CURSOR KEYS often.                    ]
X [ This crime committed by (c)shri@ncst.in H.Shrikumar on Tue Aug 21 12:33 ]
X 
X Currently Logged directory:
X   Finding out, just a sec ......
xxEOFxx
echo done.
cat << xxEOFxx > READ.ME
1. Put the contents of ws.alias in your .cshrc file.
2. mv ws.exrc YourWSDirectory/.exrc
3. Patch .exrc using an editor to replace all Caret-X by control-X,
   and also set the path for wsmsgs.ovr file according to your convention.
   (Chicken and egg problem here, eh ? :-)
4. put wsmsgs.ovr in some suitable directory. Edit .exrc to reflect this.
5. Enjoy! (If at all possible with ws :-)

-- shrikumar ( shri@ncst.in )
No bug reports, no suggestions, no support.
Extensions, bug-fixes comments welcome.
xxEOFxx
echo Extracting ws.sh | tr -d '\012'
sed 's/^X//' << 'xxEOFxx' > ws.sh
X#!/bin/csh
X
Xalias ws 'vi "+source ~shri/src/sh/wsovly.ovl" ~shri/src/sh/wsmsgs.ovr'
Xexec ws !*
xxEOFxx
echo done.
echo 'Enjoy!'
exit 0


----:<------