[comp.sys.amiga] Looking for editor which hides lines indented more than x levels

lphillips@lpami.wimsey.bc.ca (Larry Phillips) (10/04/89)

In <3909@blake.acs.washington.edu>, dlarson@blake.acs.washington.edu (Dale Larson) writes:
> I would like to find an editor which will allow me to look at just the
> top level routines in a program by hiding lines with more than a certain
> number of tabs at the begining.  I think that I have seen such an editor
> before, but do not have any idea what it was.

Well, it isn't exactly an editor, but Flow, from New Horizon's, will do
something akin to that. In case you aren't familiar with it, it is an 'idea
processor', something that definitely fits in with the concept of developing
and writing a program.  I was toying with the thought of using Flow to write
and keep a copy of the code, and having a separate program that would take a
Flow data file and build a stripped-down source file (sans comments), that
could be compiled.  Another program might build a doc file from special
'comment blocks' that need not fit the format of the comments in the language
you are using.

-larry

--
The Mac? Oh, that's just like a computer, only slower.
+-----------------------------------------------------------------------+ 
|   //   Larry Phillips                                                 |
| \X/    lphillips@lpami.wimsey.bc.ca -or- uunet!van-bc!lpami!lphillips |
|        COMPUSERVE: 76703,4322  -or-  76703.4322@compuserve.com        |
+-----------------------------------------------------------------------+

dlarson@blake.acs.washington.edu (Dale Larson) (10/04/89)

[eat this!!!]

I would like to find an editor which will allow me to look at just the
top level routines in a program by hiding lines with more than a certain
number of tabs at the begining.  I think that I have seen such an editor
before, but do not have any idea what it was.

All email responses will be appreciated.
-- 
	    A lack of prior planning on the part of any programmer 
		       always constitutes an emergency.
	
           Digital Teddy Bear      dlarson@blake.acs.washington.edu

jellson@stsusa.com (10/06/89)

In <3909@blake.acs.washington.edu>, dlarson@blake.acs.washington.edu (Dale Larson) writes:
> I would like to find an editor which will allow me to look at just the
> top level routines in a program by hiding lines with more than a certain
> number of tabs at the begining.  I think that I have seen such an editor
> before, but do not have any idea what it was.
 
XEDIT on IBM mainframes had the ability to selectively hide lines.  Then with
the aid of REXX you could write macros to hide lines according to any criterea
you liked, such as indentation.

I too would really like to see this feature in an Amiga editor such as TxEd or
CygnusED.

I used it all the time to display only those lines in a file that
contained a given string so that I could see that stringin context before
selectively making changes.


John Ellson              602-395-5281     //
ellson@ontap.stsusa.com                  // 
Siemens Transmission Systems, Inc.   \\ //  All opinions are my own and may   
8620 North 22nd Ave. Phoenix AZ 85021 \X/   not correspond with my employer's.

cmcmanis%pepper@Sun.COM (Chuck McManis) (10/07/89)

In <3909@blake.acs.washington.edu>, (Dale Larson) writes:
> I would like to find an editor which will allow me to look at just the
> top level routines in a program by hiding lines with more than a certain
> number of tabs at the begining.  
 
In article <3476@stsusa.com> jellson@stsusa.com writes:
>XEDIT on IBM mainframes had the ability to selectively hide lines.  Then with
>the aid of REXX you could write macros to hide lines according to any criterea
>you liked, such as indentation.

I got a similar response to my announcement of a beta MicroEMACS and looked
into this kind of thing for emacs. I wouldn't be to tough, except that it 
touches almost *everything* in the display/file routines. The easiest (??)
way to do it seems to be to modify the LINE structure such that it has a
"visible" attribute and then modify the display routine appropriately so
that instead of a line is displays something like  :
				<<<< Excluded Text >>>>
and of course all of the line movement routines have to be updated so
that they jump over excluded lines, and one probably wants two flags
one for making lines invisible and the other for forcing them to be
visible temporarily. The second comment about using REXX to pick which
lines are excluded is an excellent one. One might also want to add
a bunch of uemacs commands such as exclude-line, exclude-region, 
and unexclude-line/region. Some policy questions come up to, what happens
if you are asked to go to an excluded line? Do you force it to be visible ?
And is there a move-down-exactly-one-line such that you can move into
an excluded region and unexclude lines one at a time? XEDIT has these
wonderful little mode bits in the right hand column, which emacs doesn't
have a parallel for. Any discussion would be enlightening for sure.

--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.
"If I were driving a Macintosh, I'd have to stop before I could turn the wheel."

jellson@stsusa.com (10/09/89)

In article <125967@sun.Eng.Sun.COM>, cmcmanis%pepper@Sun.COM (Chuck McManis) writes:
> In <3909@blake.acs.washington.edu>, (Dale Larson) writes:
>> I would like to find an editor which will allow me to look at just the
>> top level routines in a program by hiding lines with more than a certain
>> number of tabs at the begining.  
>  
> In article <3476@stsusa.com> jellson@stsusa.com writes:
>>XEDIT on IBM mainframes had the ability to selectively hide lines.  Then with
>>the aid of REXX you could write macros to hide lines according to any criterea
>>you liked, such as indentation.
> 
> I got a similar response to my announcement of a beta MicroEMACS and looked
> into this kind of thing for emacs. I wouldn't be to tough, except that it 
> touches almost *everything* in the display/file routines. 

I'm not surprised that such a feature would be tough to implement in existing
editors.  But then from a user's perspective it can be a really valuable 
feature.  I would like to offer some more thoughts on how it should appear
to the user - mostly based on XEDIT experiences.  I will leave the
implementation to others.
     
> The easiest (??)
> way to do it seems to be to modify the LINE structure such that it has a
> "visible" attribute and then modify the display routine appropriately so
> that instead of a line is displays something like  :
> 				<<<< Excluded Text >>>>
> and of course all of the line movement routines have to be updated so
> that they jump over excluded lines, and one probably wants two flags
> one for making lines invisible and the other for forcing them to be
> visible temporarily. 

This is probably obvious but there should be only one <<< Excluded Text >>> 
indication for multiple consecutive hidden lines, not one per line otherwise 
nothing has been gained. Also it should be optionally possible to omit even 
the indication since in many applications there is excluded text between every
displayed line and the indication just adds clutter to the display.

Not sure that I understand the necessity for two flags.  Seems to me that
a line is either visible or hidden.

> The second comment about using REXX to pick which
> lines are excluded is an excellent one. One might also want to add
> a bunch of uemacs commands such as exclude-line, exclude-region, 
> and unexclude-line/region. 

The editor must support the basic facility with can then be customized by REXX.
XEDIT, as I recall, uses a more general facility like HIDE <range> 
and UNHIDE <range> where <range> can be a single line or multiple lines
specified by line numbers or regular expressions. (I think XEDIT called the
commands something other than (UN)HIDE but I don't recall exactly what.)

> Some policy questions come up to, what happens
> if you are asked to go to an excluded line? Do you force it to be visible ?

I think XEDIT gave a warning message to the effect that the line was not
currently displayed.  I am sure that it didn't force the line to be
visible.  I think line visibility should only be affected by the (UN)HIDE
commands otherwise the feature would become too confusing.

> And is there a move-down-exactly-one-line such that you can move into
> an excluded region and unexclude lines one at a time? 

All movements should be modified to only refer to visible lines.  
This includes regular expression searches which also should only be
applied to visible lines. Thus move-down-1 would skip hidden lines.  
This permits an arbitrary selection of lines from a file to be edited 
in isolation of the rest of the file.

If it was useful the ability to unhide and move to a next line could be 
supported by a REXX command which did something like:
	UNHIDE +1
	MOVE +1                                     

> XEDIT has these
> wonderful little mode bits in the right hand column, which emacs doesn't
> have a parallel for. 

I agree that those bits were nice but I think this feature still has value
in editors without them when driven from REXX.  The mode bits column isn't
essential to the ability to hide lines although, as you point out, the
ability of the editor to maintain a "visible" attribute on a per-line basis is
necessary.

I wonder if a similar visible attribute on file column ranges would be useful 
so that you could hide columns 10 to 50 say? I don't think XEDIT had this but
it sure would be useful for modifying tables. 

> Any discussion would be enlightening for sure.
> 
> --Chuck McManis

Agreed.

-- 
John Ellson              602-395-5281     //
ellson@ontap.stsusa.com                  // 
Siemens Transmission Systems, Inc.   \\ //  All opinions are my own and may   
8620 North 22nd Ave. Phoenix AZ 85021 \X/   not correspond with my employer's.

waggoner@dtg.nsc.com (Mark Waggoner) (10/11/89)

In article <3589@stsusa.com> jellson@stsusa.com writes:
>In article <125967@sun.Eng.Sun.COM>, cmcmanis%pepper@Sun.COM (Chuck McManis) writes:
>> In <3909@blake.acs.washington.edu>, (Dale Larson) writes:
>>> I would like to find an editor which will allow me to look at just the
>>> top level routines in a program by hiding lines with more than a certain
>>> number of tabs at the begining.  
>>  
>> In article <3476@stsusa.com> jellson@stsusa.com writes:
>>>XEDIT on IBM mainframes had the ability to selectively hide lines.  Then with
>>>the aid of REXX you could write macros to hide lines according to any criterea
>>>you liked, such as indentation.
<lots more stuff about XEDIT and wishes deleted>

XEDIT maintains some sort of a 'level' parameter for each line, which
can be set by the user.  You can then select what 'levels' you want to
be visable.  You can also select whether you want 'hidden line'
messages where lines are hidden or if you just don't want to see them
at all.  So, if you added an integer 'visability' attribute to every
line in an editor, you could have it assign the level attribute
depending on how many tabs are at the beginning of the line.  This is
more flexable than a simple visability attribute.

XEDIT builds on the visability attribute with commands or macros such
as ALL /target/ which displays only lines including the target
string.

>
>I wonder if a similar visible attribute on file column ranges would be useful 
>so that you could hide columns 10 to 50 say? I don't think XEDIT had this but
>it sure would be useful for modifying tables. 
>
You can also choose to only see particular columns of the data and can
even look at the same column more than once.  You use the command:
VERIFY c1 c2 [h] [c1 c2 ...]  (I think)
The h option means display those columns of data in hex.  I'm not sure
if I have the syntax exactly right, but it's close.

-- 
 ,------------------------------------------------------------------.
|  Mark Waggoner   (408) 721-6306           waggoner@dtg.nsc.com     |
 `------------------------------------------------------------------'