Randy Kramer <[EMAIL PROTECTED]> writes: > On Wednesday 05 March 2008 08:59 pm, Aaron Hsu wrote: >> For sure, I would find per-line folding in NEdit almost useless for me, >> because I edit deeply nested sets of parentheses (Lisp/Scheme code), >> which means that I need to be able to fold against nested parentheses >> regardless of where they are in a line. If a whole line is blocked out >> there isn't enough granularity for me to do real work. > > Interesting, I never thought of the problem with Lisp/Scheme.
This is actually some of the most annoying parts about NEdit, is that it, as well as many other editors, is built on ideas which assume code is in the form of normal line based block structures, which completely ignores the Lisp family of languages. Now, the only two editors that really do this well are Emacs and Edwin, and I think it no coincidence that both of them are written in varients of Lisp, the first being E-Lisp and the second Scheme. Both also happen to have an editing mode called paredit, which allows pseudo-structured editing of source code based on the parentheses. At the moment I can hack some of this in with NEdit's macros and such, and it works admirably well, actually, which is a testament to NEdit's power. However, if one were to add Line based code folding, the entire paradigm would just die. :-P Which brings up another thing to beware of. When creating these code folding routines, it should not break existing macros which scan through and check for pieces. That is, you should be able to scan through the folded code even though it's not shown, if so desired. You should also be able to skip over it. To give a practical example, I might rebind the delete or ( and ) keys on my keyboard to do pseudo-structured editing based on the context. If, that macro needs to track the depth of its parentheses, it can either assume that all parentheses are balanced inside a fold (which is okay) or it may need to go into that fold to make sure that things are alright. -- Aaron Hsu <[EMAIL PROTECTED]> | Jabber: [EMAIL PROTECTED] ``Government is the great fiction through which everybody endeavors to live at the expense of everybody else.'' - Frederic Bastiat -- NEdit Develop mailing list - [email protected] http://www.nedit.org/mailman/listinfo/develop
