Path: utzoo!attcan!uunet!mcvax!ukc!stl!idec!marlow!fox From: fox@marlow.uucp (Paul Fox) Newsgroups: comp.editors Subject: CRISP (yet again) Message-ID: <587@alice.marlow.uucp> Date: 10 Mar 89 20:07:03 GMT Organization: Reuters Ltd PLC, Marlow, England Lines: 176 This message is to compare some of the features of CRISP vs. vi for example. It is in request to a mail message by irv@happym.wa.com. He points out that a lot of people may not appreciate why yet another editor is foistered on the world at large and wanted me to make some comments to maybe show you vi-hackers what you are missing. So here goes. CRISP is similar in many respects to Emacs. It is very far removed from vi. The single most advantageous point about CRISP and editors like it is that they avoid you having to print out listings. Let me try to explain why. When you use an editor like vi, it has a pretty sophisticated set of capabilities, but you unrealisingly end up manually doing things which the editor should help you out with. A lot of people - especially programmers etc can spend 50% or more of their working time inside an editor. Vi presents you with a 24+ line window around the current cursor position. Often you may be editing a file and you need to look at the top of the file, eg for the declarations, or you need to look at a .h file to see some structure information, etc. Vi offers you commands like to flip between files and various registers to save your current cursor position. However vi's idea of editing multiple files really only extends to two files at a time - the current one and the last one. Vi has many nice little features which make programming a joy - my personal best are the '%' command for matching brackets coupled with the various shift-in and shift-out features, and the tags command which will take you to any function definition. This is where it ends - people have complained about modes and modelessness as being a good/bad thing. I dont want to start a religious war - but to a certain extent you either love vi or you hate it. Most newcomers hate it until they learn it really well. CRISP and editors like crisp take you out of this and allow you to design your own editor. CRISP, EMACS and the other variants have a fully fledged programming langugae for customising the editor to your liking. Unfortunately no one is really interested in my language - you all have work to do. Learning an editing language is a chore at best. So the idea is that CRISP and Emacs come with a base set of macros to help those newcomers get to grips with editor within MINUTES of starting to use them. After that its up to you to decide whether you want to delve into the depths etc. Now what makes CRISP and BRIEF so good are the following features. Some are shared with Emacs. Remember I ventured on the design of CRISP because _I_ didnt know how to use Emacs at the time. Had I had the full GNU Emacs I wouldnt have ventured to start this. I only had MicroEmacs at the time and _no_ manual. If you are a well versed Emacs user, then you can probably ignore CRISP you may find it limiting. If you are a vi user then read on: 1. Vi has great problems in moving text around. If you want to delete a block of text you usually have to count lines. You can use the registers of vi to mark the block and then cut the text - but you usually make a mistake and have to rely on the U or u commands to get it right. CRISP hilites the area you are about to cut/copy. On monochrome displays its standard reverse video. On a color display you can make the highlited text any color you like. You are not limited to cutting words or lines but can have rectangualr regions, etc. 2. Color. Vi has no concept of color. To those of you who only have monochrome terminals skip this bit. For those of you running Unix on a PC type machine and usually have EGA or VGA, then color is a godsend. It makes the user interface look really sexy - although its all a matter of taste and color offers no functionality enhancement except possibly the human brain can focus its attention on the text display rather than the status lines, or whatever. 3. CRISP supports the tags and brace matching facility via its macros. If you dont like the way I've done it feel free to change it. 4. CRISP allows you to have as many windows onto as many different files as you want (subject to a minimum window width of about 16 characters and a window height of 3 lines). The current user interface is mostly tiled based, but there is nothing stopping anyone having overlapping windows. I keep thinking about writing macros to support this. 5. CRISP supports sub-processes in windows. Coupled with (4) above, CRISP could be seen as a superior (in some ways) version of the 'screen' program recently posted on the net. You can run multiple sub-processes. CRISPs support of sub-processes is limited in various ways, eg you cannot run a 'vi' session in one of these windows, but for 95% of the things you might want to do, eg compilation, list directory etc, it suffices. CRISP does NOT support the pty device but uses normal pipes to a sub-shell. This is done for maximal portability and because of laziness on my part to read the manual pages for the pty device. I hate sprinkling my code with too many #ifdefs. 6. CRISP supports multiple keyboard macros - similar to the vi map command but not as difficult to use. CRISP does not support abbreviations. 7. CRISP supports an indefinite level of undo. The undo facility is a nuisance. Vi supports only a single level of undo - if you make a mistake - you can undo it. If you didnt mean to undo it, you can undo the undo. In the present version of CRISP if you undo something you have lost that information forever. You cannot undo an undo. People have asked for a 'redo' facility, and I am experimenting with one now. However the semantics of a redo are pretty nasty. 8. You can execute a grep command and have the output go to a pop-up window. You can move around this window and when you hit return, CRISP takes you to that line in the appropriate file. No more ':!grep fred *.c' and then immediately forgetting what grep printed when you redraw vi's screen. A make and lint macro avoid the necessity for leaving crisp to do compilations. Any errors in your files are indicated by allowing you to skip to each file with an error in turn. There are many of these 'nice' little macros. Emacs has more. 9. Lots more features that probably arent worth talking about. The point is, if you are a pure vi user, then CRISP/Emacs, etc offer you a programmers dream environment, where by you never need to leave the editor. You never need a printout. Ask yourself why you print out listings - its usually so you can see a large fraction of the code at once eg 66 lines on a page. You usually want to see large portions because you want to check that two places in your code agree with each other, eg a function declaration and definition. With multiple windows you have each in its own window. If you are looking at someone elses code, you can use the tags facility to wander aronud the source code from function to function. CRISP has an index function which produces a pop-up window of all functions in the current .c file, or all typedef/struct definitions in a .h file (plus many more variants). If you use nroff/troff a lot, there is an index function for the sections in a document - a bit like a poor man's outline facility, but it does avoid you needing to keep printing things out and losing your train of thought. I've said too much already. CRISP was originally designed to be a BRIEF editor clone, but I've extended it more to be much more functional. Some aspects of it really need experimenting with because the documentation (as with all p.d. software) is not as good as it should be. But everyone I know who has used CRISP or BRIEF hates to be with out it. -- ===================== Paul Fox Tel: +44 628 891313 x. 212 ..................... UUCP: fox%marlow.uucp@idec.stc.co.uk