Xref: utzoo comp.editors:491 comp.sys.transputer:567 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!csd4.milw.wisc.edu!bionet!ames!amdcad!sun!pitstop!sundc!seismo!uunet!mcvax!ukc!harrier.ukc.ac.uk!raven.ukc.ac.uk!arc1 From: arc1@ukc.ac.uk (A.R.Curtis) Newsgroups: comp.editors,comp.sys.transputer Subject: Re: SCREEN (and a new editor) Keywords: occam, editor, folds Message-ID: <1385@raven.ukc.ac.uk> Date: 31 Jan 89 13:47:57 GMT References: <703@stag.UUCP> <1036@bacchus.dec.com> Reply-To: arc1@ukc.ac.uk (A.R.Curtis) Organization: Computing Lab, University of Kent at Canterbury, UK. Lines: 64 In article <1036@bacchus.dec.com> gringort@decwrl.dec.com (Joel Gringorten) writes: >In article <703@stag.UUCP> trb@stag.UUCP ( Todd Burkey ) writes: >> >>About two years ago, I proposed a folding editor on the net... >> >>I will be releasing the sources for the folding editor in a month or so... >> My primary goal was simply to >> see how hard it would be to write an editor that had folding capability. > >At the risk of seeming incredibly naive, what is "Folding?" A fold is way of wrapping up bits of text inside a hidden area, which can either be closed, entered or open (using the occam editor as an example). When closed, all you see is "... " When open, the fold expands in situ and you can see its contents opened up in the current window/buffer/screen, e.g. {{{ declarations VAL fred IS 9 : INT beep, zoop: BOOL abong : }}} SEQ .. blah blah .. When entered, the fold contents assume a new context on the screen, so that all you see is the contents and nothing of the external code/text (the fold may of course contain other folds...). Folds can be filed, so that in fact they point to a file. When opening/entering a fold, the file is read into the editor as if it were there all the time. So much for the explanation. One thing about all this as far as occam goes is the use of non-printing ASCII characters for fold markers. This means (along with other non-free-text things) that you can't use your favourite editor (vi, emacs whatever) to edit it. The idea then for a free-text folding editor is great. I wrote something very quick and nasty a couple of years ago for GNU emacs, which just hid text between patterns. Which isn't very useful. INMOS have a copy of this, and in fact should be doing a full version of the folding editor (but I haven't heard anything more from them). GNU emacs might be a good starting point in fact, since we can use text maps to define the fold structure (no nasty BEL characters etc) and then OPEN FOLD/ENTER FOLD invoke functions to manipulate this map. The map could either prefix the file (as is done in emacs rmail and news interfaces) or be a separate file altogether (cf. the MAC folding editor which I think uses separate files). Defining and selecting regions would give a nice way of representing the folds. Anyone interested in taking this up? Tony Curtis Disclaimer: my views are not necessarily those of my employer. -- ------------------------------------------------------------------------------- Tony Curtis, Computing Lab. | Phone 0227 764000 Univ. Kent at Canterbury | Ext. 3812 or 7617 Canterbury, Kent CT2 7NF | arc1@uk.ac.ukc