[comp.sys.mac] Editing large

ge@phoibos.UUCP (Ge Weijers) (03/15/89)

What is the best way to go when writing a text editor in the Mac that
needs only normal, basic features as style-less TextEdit provides.
The catch is that the editor must be able to edit files that are
quite a bit larger than 32K. I can imagine two approaches:

- write a simple TextEdit replacement (a lot of work reinventing the wheel)
- try to use multiple TEHandles, a tricky ClickLoop etc.

Could anyone 'enlighten' me on the subject. My colleagues and me
are writing a programming environment around our functional language
and graph rewriting system, but the environment does not have to be
as fancy as Think Cs. Using MPW is not practical, because one cannot
enroll every student using it into APDA, and we want to attract interest
outside the Mac programming community.

Any comments are appreciated,

Ge' Weijers
Faculty of Mathematics and Computer Science
Nijmegen University,
Nijmegen
the Netherlands

UUCP: ge@cs.kun.nl -or- {backbone}!kunivv1!phoibos!ge

earleh@eleazar.dartmouth.edu (Earle R. Horton) (03/23/89)

In article <538@phoibos.UUCP> ge@phoibos.UUCP (Ge Weijers) writes:
>What is the best way to go when writing a text editor in the Mac that
>needs only normal, basic features as style-less TextEdit provides.
>The catch is that the editor must be able to edit files that are
>quite a bit larger than 32K. I can imagine two approaches:
>
>- write a simple TextEdit replacement (a lot of work reinventing the wheel)
>- try to use multiple TEHandles, a tricky ClickLoop etc.
>

     The first solution is the only way to go.  You have to go right
down to the QuickDraw level, and reimplement all of the TextEdit
stuff, only do it better.  This is NOT reinventing the wheel, because
there are things missing from TextEdit which you will have to put in
your text editor:

     a)  Large files.
     b)  Sensible data structures to hold text in memory.
     c)  The hooks for your specialized application (which is why you
         are writing it in the first place.)

     Reading Technical Note # 203, "Don't Abuse the Managers," should
convince anyone that TextEdit is not meant for heavy-duty stuff.

earleh:xyzzy:32768:7:Earle R. Horton,,,6434109:/hackers/earleh:/bin/rn

oster@dewey.soe.berkeley.edu (David Phillip Oster) (03/23/89)

If you can find a copy of Think C's CAPPS', it will do what you want. I
bought a copy, and I've been happy with it.  It is perfectly appropriate
for implementing editors that edit program text.  Even if you don't use
it, you might consider examining a copy just to compare the data
structures with Text Edits.

It is also quite reasonable to use a group of text edit records: treat
Text Edit as a paragraph engine.  At one time, Apple recommended
this approach when the Mac was released, and so long as you don't try to
use the hooks to force it past the breaking point, you'll be fine.

In particular, if you want unix style tabs, don't use text edit (unless
you do what I do: use a private font of spacing characters to simulate
tabs.)

--- David Phillip Oster            --"When we replace the mouse with a pen,
Arpa: oster@dewey.soe.berkeley.edu --3 button mouse fans will need saxophone
Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu --lessons." - Gasee

svc@well.UUCP (Leonard Rosenthol) (03/25/89)

In article <538@phoibos.UUCP>, ge@phoibos.UUCP (Ge Weijers) writes:
> What is the best way to go when writing a text editor in the Mac that
> needs only normal, basic features as style-less TextEdit provides.
> The catch is that the editor must be able to edit files that are
> quite a bit larger than 32K. I can imagine two approaches:
> 
> - write a simple TextEdit replacement (a lot of work reinventing the wheel)
	This is always a good solution, but you are right it is reinventing
the wheel.

> - try to use multiple TEHandles, a tricky ClickLoop etc.
	This should work, I have recommended it to people before and they have
have been able to implement it, but I personally have not tried it.

> other suggestions
	If Symantec had not removed it's CAPPS' package from the market, I would
have recommended it, and if you can find a copy - BUY IT!   It is a nice TE
replacment for programming tasks as it does not word wrap.
	
-- 
+--------------------------------------------------+
Leonard Rosenthol        |  GEnie : MACgician
Lazerware, inc.          |  MacNet: MACgician
UUCP: svc@well.UUCP      |  ALink : D0025