[comp.editors] Append vs. Insert

jallen@libserv1.ic.sunysb.edu (Joseph Allen) (04/06/91)

Which is better append or insert?  :-)

Actually, does anyone know the history of ed...  why is it so oriented
towards appending?  The two styles are very different:

Append:
	Can't put cursor past end of line or end of file
	Must have zero-eth line so we can insert at beginning of file
Insert:
	The possibly imaginary places of end of line and end of file exist

Back when I was a teenager I used an editor called 'E' for a Motorola Exorciser
6800 developement system which was an insert oriented line editor.  When
I began using UNIX I was very disgusted with ed/ex/vi because they're append
oriented.

So which came first? Insert or append? And why does ed use append when
everyone else uses insert?

(Oh and does anyone know why they made ed so that the it leaves you at the
the end of the previous range instead of requiring you to explicitly
reposition yourself?)

(if anyone is interested in an insert (and maintain current position whenever
possible) version of ed let me know.  I was bored one day you see and...)

--
#define h 23 /* Height */         /* jallen@ic.sunysb.edu (129.49.12.74) */
#define w 79 /* Width */                       /* Amazing */
int i,r,b[]={-w,w,1,-1},d,a[w*h];m(p){a[p]=2;while(d=(p>2*w?!a[p-w-w]?1:0:0)|(
p<w*(h-2)?!a[p+w+w]?2:0:0)|(p%w!=w-2?!a[p+2]?4:0:0)|(p%w!=1?!a[p-2]?8:0:0)){do
i=3&(r=(r*57+1))/d;while(!(d&(1<<i)));a[p+b[i]]=2;m(p+2*b[i]);}}main(){r=time(
0L);m(w+1);for(i=0;i%w?0:printf("\n"),i!=w*h;i++)printf(a[i]+"#\0 ");}

peter@ficc.ferranti.com (Peter da Silva) (04/09/91)

If you're interested in the design decisions in "ed", I would recommend
"Software Tools" by Kernighan and Plauger. In fact I'd recommend it in
any case. Excellent book. Just don't get the wimpy Pascal version: it's
just a line-for-line translation of the ratfor code.
-- 
Peter da Silva.  `-_-'  peter@ferranti.com
+1 713 274 5180.  'U`  "Have you hugged your wolf today?"

new@ee.udel.edu (Darren New) (04/10/91)

In article <2SLABY7@xds13.ferranti.com> peter@ficc.ferranti.com (Peter da Silva) writes:
>If you're interested in the design decisions in "ed", I would recommend
>"Software Tools" by Kernighan and Plauger. In fact I'd recommend it in
>any case. Excellent book. Just don't get the wimpy Pascal version: it's
>just a line-for-line translation of the ratfor code.

I second that recommendation.  Actually, I would recommend getting *both* books,
since they are not very expensive and they do implement different tools.
	     -- Darren
-- 
--- Darren New --- Grad Student --- CIS --- Univ. of Delaware ---
----- Network Protocols, Graphics, Programming Languages, FDTs -----
  +=+=+ My time is very valuable, but unfortunately only to me +=+=+
+ When you drive screws with a hammer, screwdrivers are unrecognisable +