Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!seismo!mcvax!enea!liuida!obelix!p_e From: p_e@obelix.UUCP Newsgroups: comp.emacs Subject: Re: Hierarchical program editing Message-ID: <1041@obelix.liu.se> Date: Thu, 7-May-87 05:08:23 EDT Article-I.D.: obelix.1041 Posted: Thu May 7 05:08:23 1987 Date-Received: Sat, 9-May-87 07:57:53 EDT References: <8705051614.AA01839@cadillac> Organization: University of Linkoping, Sweden Lines: 61 eero%cadillac@MEDIA-LAB.MEDIA.MIT.EDU (Eero Simoncelli) writes: > ... >I am suggesting a sort of Dired Outline mode >in which one could Dired a subdirectory and have its contents >appear in the same buffer under the line containing the >subdirectory name, indented. In code files, there could >also be an outline mode. Upon first entering the file, only >top level lines (ie defuns and defvars for LISP, typedefs and >functions for C, etc.) would be visible. The subforms of any >function could be expanded hierarchically. An option to hide >all comments would also be useful. > ... >Replies to eero@media-lab.mit.edu (I'm not on any Emacs mailing lists). This is a great idea. The concept of hierarchical editing of files has been implemented in a number of different editors. I always wished Emacs would have something similar. If someone is going to hack it up, then maybe I can suggest something. I don't really see the advantage in presenting one level of C code at a time. No, the distinction should be logically based, not physically. This also implies that Emacs must store hierarchical information in the source code. This is normally done in special comments which are hidden from the user. Preferrably, there should also be some character at the end of a line, indicating that it has descendants. To make this really useful, it should be possible to write pseudo code and have Emacs strip this off before compilation. Emacs could make a file out of every leaf and this should be pure C code. Everything else is pseudo code. On the top level it could look like: Includes > Declarations > main(argc, argv) Declarations > Take care of args > ... Moving the cursor to the 'Includes' line and giving an 'OPEN' command would yield: Includes > #include #include Declarations > main(argc, argv) Declarations > Take care of args > ... The line is "expanded" and the underlying nodes become visible. Of course, these could also have descendants. It would be nice if it was possible to have the "opened" line highlighted, or something. I can foresee some difficulty to implement this in Emacs, but with all the thousands of hackers out there... -- "Be sure brain is in gear before engaging mouth." Dept of Comp and Info Science (seismo!mcvax!enea!liuida!obelix!p_e) Univ of Linkoping, Sweden (p_e@obelix.liu.se , p_e@obelix.UUCP)