[comp.editors] Folding Editor

michael@trigraph.UUCP (Michael Winser) (02/02/88)

Does anyone out there have source to a folding editor?
Ideally I would like changes to jove or some other emacs
like editor.

Michael.

-- 
...utscri!trigraph!michael            Michael Winser
michael@trigraph.UUCP                 Trigraph Inc.
                                      5 Lower Sherbourne St. #201
(416) 363-8841                        Toronto,Ontario M5R 3H8

michael@trigraph.UUCP (Michael Winser) (02/05/88)

In article <358@trigraph.UUCP> michael@trigraph.UUCP (Michael Winser) writes:
							that's me! :-)
>Does anyone out there have source to a folding editor?
...

Judging by the response received ("What's a folding editor"), I guess I should
explain:

A folding editor allows you to "fold" several lines of text into a single line
(usually displayed as the first folded line).  Many outline processors (if not
all) use a similar approach.  The difference between an outline processor and
a folding editor is that the folding editor imposes no knowledge of structure
upon the folded text.

I believe that one of the original folding editors was at cmu, but I could be
wrong. 

I hope this clarifies my request.

Michael

-- 
...utscri!trigraph!michael            Michael Winser
michael@trigraph.UUCP                 Trigraph Inc.
                                      5 Lower Sherbourne St. #201
(416) 363-8841                        Toronto,Ontario M5R 3H8

dupuy@westend.columbia.edu (Alexander Dupuy) (02/09/88)

In article <362@trigraph.UUCP> michael@trigraph.UUCP (Michael Winser) writes:
>A folding editor allows you to "fold" several lines of text into a single line
>(usually displayed as the first folded line).

You might want to look at outline-mode in Gnu Emacs.  Folded lines are marked
by ^M (CR) where ordinary lines are marked with ^J (NL).  Setting the elisp
variable selective-display to t turns this feature on.  The outline mode which
uses this supports an outline-regexp variable that allows you to specify the
format of header vs. body lines.  This allows you to customize the outlines for
the particular structure you are using.

@alex
---
arpanet: dupuy@columbia.edu
uucp:	...!rutgers!columbia!dupuy

jkh@pcsbst.UUCP (jkh) (04/23/89)

Hmmm. Ok, I guess I can give you what amounts to a 2 part comment
since my initial reaction to your posting was somewhat bi-partisan.

First off, I like the basic concepts quite a bit. The implementation
will no doubt leave a few things to be desired, but that can be
remedied in time. My first thought was that FOLDED would be highly
useful for viewing various large unix packages that we all know
and love that make heavy use of #ifdefs for portability. Wouldn't
it be nice if you only saw the code that would actually be compiled
for your machine... Well, it seems from reading your document that
folds can only be created interactively, which kind of queers that.
If you had, say, some mechanism for invoking a process on the
current file/buffer that would return a list of regions to "fold"
(say a starting and ending line) I could then whip up a shell script
that would do something like:

	Run the current file through cpp with all the important macros
	*undefined*.

        Duplicate the output and run cpp on the duplicate copy
	with all macros defined.

        Chew through the original output and the new output with diff -c.

	Generate the "folds" based on which lines diff has marked with '-'.

Several years later (:-) I would get a buffer with all the failing
#ifdef's folded out. One could even put each #include in a fold, to be
expanded if the user actually needed to see what was pulled in.

Naturally, I'm not proposing that you add this *exact* type of mechanism,
only that you provide some means of interacting with the outside world
so that such mechanisms can be implemented.

If you've ever worked with a program as heavily #ifdef'd as, say, kcl
or GNU emacs you'll know that this feature can make the difference between
solving a problem or just throwing up your hands in disgust as your
brain's stack overflows.

A generalized communications mechanism would also allow other utilities to make
join/relation decisions for FOLDED as well. I realize that you also want
this to run on your atari ST (which didn't have multi-tasking last I looked),
but it seems a shame to hamstring UNIX sites for that reason alone.. You
could always, uh, #ifdef it in.


My second and more predictable reaction was: "What?? What for you want
me to learn *another* editor?? Get Real!". Naturally, this subsided after
awhile, but this is going to be a major stumbling block. I currently
use GNU emacs which does 99.5% of everything I want to do. My first
(and possibly my final) reaction was to ponder how to implement the same
functionality in E-Lisp. However, if you can't bring the mountain to
Mohammed, why not strive for greater EMACS (or at least vi) compatibility
in FOLDED? It seems that its major strengths lie in additional functionailty,
not clever new ways of binding the keys. I don't see how you would lose
much (or anything) by following the beaten path. I don't think the fact
that it uses the quarter-plane text model or text panning rather than
wrapping will be a serious problem, I'm more interested in just having
the basic keystrokes work.

I'm curious. Other than learning, what motivated you to write an entire
new editor rather than just adding the relation/folding code to an existing
one? It's what I would have done (can you imagine the splash that a folding
version of vi would have made? Yow).

					Jordan Hubbard
					PCS Computer Systems
					Munich, West Germany

				UUCP:   {pyramid,unido}!pcsbst!jkh
				ARPA:	jkh@violet.berkeley.edu

garg@hplabsz.HPL.HP.COM (Pankaj Garg) (06/22/89)

 Sometime ago a news article on this group advertized the existence
of a folding editor. Can someone please let me know where this editor
now exists.

 Thanx...

			...pankaj


Pankaj Garg, HP Labs, 1501 Page Mill Rd., CA 94303 (415)857-4709

trb@stag.UUCP ( Todd Burkey ) (07/18/90)

In article <436@keele.keele.ac.uk> cca04@.uk.ac.keele (P.J. Mitchell) writes:
>So does anybody out there know of a version of the folding editor that
>will work on ASCII files rather than the odd format that the one supplied
>by Meiko/Sension/Inmos does ?

I posted a version of my folding editor (FOLDED) to the net over a
year ago, so it is probably still bouncing around the archive servers.
I have a slightly newer version that I should probably post soon
that supports the IBM PC (Turbo C), the Atari ST (MWC), and a variety
of Unix flavors. I haven't had to make any code changes to it for a year
now, so it is pretty stable. It will work on any type of text file and also
supports multi-file relations, simple to understand multi-buffer
operations, etc. Let me know if you have trouble getting hold of the
posted version.  I just finished porting my HDSCAN package to the PC,
so will probably find time to re-post folded to comp.sources.misc in
the coming months.

  -Todd Burkey
   pwcs!stag!trb

einari@rhi.hi.is (Einar Indridason) (07/20/90)

In article <1990Jul18.042817.9247@stag.UUCP> trb@stag.UUCP ( Todd Burkey ) writes:
>I posted a version of my folding editor (FOLDED) to the net over a
>year ago, so it is probably still bouncing around the archive servers.

>now, so it is pretty stable. It will work on any type of text file and also
>supports multi-file relations, simple to understand multi-buffer



Please don't use the *8TH BIT* for commands or controls.  Please don't
mask the *8TH BIT*.  Please allow us here in Iceland to use it as well, 
(and the rest of Europe.)

If you allow the use of the *8TH BIT* then you have my gratitude in
advance, wheter I will use it or not.

--
I just learned a new curse: "You #$@! son of SCROLLBAR!"

Internet:       einari@rhi.hi.is   | 'Just give me my command line and throw
UUCP: ..!mcsun!isgate!rhi!einari   | the GUIs in the dust-bin!!!!!!!!!'