wohler@sri-spam.ARPA (Bill Wohler) (10/03/86)
Distribution: [oops, this got long so i put in section headers. they are: INTRO, PROGRAMMING, TEXT, MISC --bw] INTRO one gentleman (in net.emacs) asked why we use emacs, but there are many out there who use other editors who might wonder about emacs. i used vi at the university of california at davis where we pronounced it 'vi' with a long i, and i continued to be a staunch vi proponent here at sri. well, i was introduced to the mh interface that gnuemacs offered and found it the best way to read mail, but continued to use vi for all other purposes. several months went by and i still refused to use emacs for anything but mail, but by then i was becoming familiar with it and the bonds were breaking. having gotten used to the control characters and the stateless mode, i began exploring it further. in the following discussion i use the terms "window" and "buffer" loosely. if you're not familiar with emacs, a buffer contains text and is not necessarily visable, and a window is what you can see, and displays one of the current buffers. PROGRAMMING i found out about the c mode and how helpful it was. you could set variables so that the c-mode would emulate your coding style. for example, a tab indents the current line properly. a line feed acts like vi in "autoindent" mode, except that if the next line needs to be indented it will do that for you, or if you just typed a '}' it'll put the } in the right place (that is, you don't have to hit ^D to back up) or if you're in the middle of an argument list when you cause a line break, it'll place you in the right place under the previous line. emacs compiles your code for you, putting the errors in a separate window. you can then step through the errors and emacs will put your cursor on the same line as the current error. and if the error was in another file, it'll open up that other file and place it in a new window if necessary. oh, then you add or remove a nested section of code. in vi you would use a careful use of ">" or "<". emacs can do this plus a little more. i missed the 'f' option in vi until i wrote a quickie function in lisp to do it for me, and i don't know much lisp. so far, i have all the functionality of vi in emacs plus some more. emacs uses tags also. READING MAIL emacs has its own mailer but i have not used it. it's probably very good. i got turned onto mh when i first got here and so it was natural for me to use the emacs interface to mh. this interface initially provides a small window with the message headers (as in berkeley mail) and another window for reading messages. for purely browsing through mail, it is similar to berkeley mail except that the mail headers remain in the small window so that you can immediately delete messages based on the subject. the single thing which gives this mailer and advantage over all other mailers is when you reply to messages. the message you are replying to is displayed in another window so that you can grab sections of it to include in your message. you don't have to include the whole message and then delete what you don't want. there are numerous other little details that i also use during the course of the day that help me send and read my mail faster and keep it better organized. WRITING TEXT it has the automatic wraparound that vi has (set wrapmargin) but unlike vi, filling is built in. with a couple of keystrokes, you can fill a region of text with ragged or straight margins instantly. after using this feature, using !Gfmt or !Gnroff in vi is intolerably slow. you can check the spelling of a window as well. instead of generating a list of badly spelled words and manually searching a replacing them, emacs will put your cursor at the first misspelled word, allow you to fix the misspelling (and then fix it throughout the text), and then place your cursor at the next misspelling. MISCELLANIOUS FEATURES you can run regions of text through unix pipes, or put the output of the shell command in a window, or create a window and run a shell in it, which can then be used later, like using script(1). emacs is used slightly differently than vi. rather than calling up vi every time you need to edit a file, you start up a emacs process and leave it there, finding files as necessary. after a while you'll have many different buffers containing files that you use a lot--switching buffers is quick and easy. you use registers to store text in vi. you use buffers in emacs. you can obtain your last 10 deletions in vi. same in emacs, but you are not limited to the last 10 kills. undo? you've got only one in vi, but you can undo the last n changes in emacs--i have not yet hit the value of 'n'. you can quickly read man pages inside emacs, browse through directories and files, remap keys to your liking, create abbreviations. if you feel the need, you can write lisp functions and then bind them to keys to customize your editing. i've seen lisp functions to visually play the towers of hanoi problem inside emacs, convert one table of data to a differently formatted table--adding and multiplying two columns to generate a new column while he was at it. that's flexibility! needless to say, i now live inside my emacs window since it can do so much for me. i guess that's what prompted someone to create an icon (for suns) which is an image of a kitchen sink! DISADVANTAGES it is bigger and depends on library files during run time. there is a shorter learning curve for getting basic editing done, but then it does take longer to get a lot of finer details mastered. there are several emacs out there and you have to decide which one to use. it starts up slightly slower than vi (some emacs are worse than others in this regard). hence, you usually leave a emacs process running as mentioned above. some people don't need the functionality, or the extensibility of emacs. this list is hardly exhaustive, but has touched upon the reasons why i switched. i resisted emacs for such a long time, so i find it surprising that i completely ignore vi now, and that is why i wrote this piece. i used the generic "emacs" throughout the text. i use gnuemacs and some of the functionality mentioned above is not found in other emacses. i easily converted many ccaemacs users to gnuemacs. it took a little longer to convert a gosling emacs user, but he saw the benefits of gnuemacs and simply changed the bindings of the keys to what he was used to. can't do that in vi. --b "i saw the light" w ps. i included newsgroup general for the mail information, and net.lang for the c-mode information. my apologies if you don't think that this message was appropriate for this newgroup.
mujica@neptune.cs.ucla.edu (Sergio Mujica) (10/03/86)
In article <7726@sri-spam.ARPA> wohler@sri-spam.UUCP (Bill Wohler) writes: > >INTRO > >one gentleman (in net.emacs) asked why we use emacs, but >there are many out there who use other editors who might >wonder about emacs. > >i used vi at the university of california at davis where we >pronounced it 'vi' with a long i, and i continued to be a >staunch vi proponent here at sri. well, i was introduced to >the mh interface that gnuemacs offered and found it the >best way to read mail, but continued to use vi for all other >purposes. > I used to be very fond of vi for a long time, then started using emacs for the same reasons that Bill Wohler points out. I learned how to use it, and started tuning details, like writing small pieces of lisp code to make life easier. But... I missed the orthogonality and simple design of vi. I also found that I felt more comfortable using unix to do my things. I decided that emacs was very powerful a tool, maybe too much even for complex tasks. Overwhelmingly powerful! Sooo... I returned to vi. Using emacs for some 8 months was very interesting, I had a lot of fun and learned many things. But I am using vi. ---- Sergio Mujica, Computer Science Department, UCLA mujica@cs.ucla.edu ...!{sdcrdcf,ihnp4,trwspp,ucbvax}!ucla-cs!mujica