Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!gatech!unmvax!bbx!stsabq!jellson From: jellson@stsusa.com Newsgroups: comp.sys.amiga Subject: Re: Looking for editor which hides lines indented more than x levels Message-ID: <3589@stsusa.com> Date: 9 Oct 89 11:31:39 GMT References: <785@lpami.wimsey.bc.ca> <3476@stsusa.com> <125967@sun.Eng.Sun.COM> Organization: Siemens Transmission Systems, Albuquerque, NM Lines: 98 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 and UNHIDE where 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.