Learning GNU Emacs, 3rd Edition
For a programmer, it is reasonable to question whether or not a word processor or graphical IDE is the right tool to edit a simple script or properties file. IDEs like Eclipse have become universals hammers, and to some of their users, any file containing text looks like a nail. Specific tasks are rarely handled well by universal tools, and text editing is no exception. Dave Thomas and Andy Hunt, authors of The Pragmatic Programmer and founders of the Pragmatic Bookshelf series, recommend that programmers adopt a text editor as an essential utility in their collection of appropriately-suited tools. The tried-and-true text editor is enjoying a renaissance of sorts, and one of the most extensible and customizable applications among text editors is the venerable GNU Emacs.
Tutorials and documentation for Emacs are abundant, but they often prove time-consuming and ineffective for actually learning Emacs. The printed version of the official GNU Emacs manual reads more like an application programming interface (API) document than an instructional guide. This book is a refreshing break from the documentation many have come to expect. Imagine having a group of leading experts on Emacs at your disposal to teach you how to use it in a conversational, consultative style. That is what has been bundled into this book.
The extensibility of Emacs is considered both a key strength and a confusing weakness of the application. The Emacs community has created all sorts of additional capabilities for Emacs, ranging from the impressive to the absurd. The authors have done well to judiciously select which Emacs capabilities to cover. For example, while Emacs does have the capability to function as an email client, other applications have long superseded its ability. The authors have chosen not to cover this topic, and instead devote the available space to learning Emacs' core functionality -- powerful, efficient text editing.
This edition of the book uses the space gained by the removal of esoteric topics to flesh out areas of more common interest. Peripheral areas of Emacs, such as compatibility modes for programming languages (other than Java and Perl), have been left for the user to research after gaining a solid foundation on Emacs as editor and work environment. Integration with the major version control systems has been expanded to include Subversion alongside the age-old standards CVS, RCS, and SCCS. Coverage of support for Java and Perl has also improved, as well as sections for editing HTML and XML. Users wanting to tap into the power of Lisp programming for Emacs should find the coverage satisfying as well.
The pace of the material is comfortable, and the order in which topics are introduced allows the user to progress smoothly through the book. Users with some experience can skip past the first three chapters, but would be advised to read through them, particularly those who are self-taught (which applies to most Emacs users). Given the amount of time the average user spends in Emacs, picking up one or two time-saving shortcuts would be well worth an investment of a few hours. Instructions are given in a way that reflects the fact that there are multiple ways to achieve the same outcome; the authors do not attempt to foist "the only way" to accomplish something upon the reader. Some readers will find that bothersome, desiring instead a simple, straightforward heuristic for performing a task. However, the typical users of Emacs tend to be people who embrace the fact that the world is not a simple, straightforward abstraction. The book reflects the authors' awareness of this nuance.
Perhaps the most distinguishing feature of this book is the chapter devoted to the use of Emacs on different platforms. Unix, Windows and Mac OS X users receive equal acknowledgment. The precautions and insights regarding subtle differences in Emacs when used on particular platforms can reduce users' frustration when getting started.
The mnemonic devices and conventions used in the book allow users to
commit useful keyboard commands to memory. The memorization is further
solidified by the exercises sprinkled appropriately through each
chapter. Readers do not go for very many pages before it is time to be
at the keyboard again, harnessing the power of muscle memory to
reinforce the material presented. Those who spend any time at a shell
prompt or in console applications will find that their new mastery of
Emacs keyboard shortcuts translates into increased proficiency with
command-line operations as well.
...doing just what I just did? I mean, just once?
But given Emacs' startup time, you're forgiven.
The GNU Emacs Manual available for free at http://www.gnu.org/software/emacs/manual/ is excellent. Printed versions are available too.
Emacs also comes with a built-in tutorial that is a good interactive introduction to Emacs.
If you are considering learning Emacs, yes, it can seem like an intimidating task. The interface and commands are nothing like what people are used to today. But it is certainly worth the effort learning Emacs and getting used to it.
I've been using Emacs for 15 years and started using Emacs before I even knew that vi existed. I use vi when I must, i.e. no Emacs on the server or I'm going in on a slow remote connection, but don't want to use vi for my every day editing. I can do all the basic editing that I need in vi, but for the truly fancy stuff, I feel much more at home in Emacs.
;)
Automation of repetitive task can go way beyond recorded key strokes once you get a grip on Emacs lisp. This tool has saved me years of work over the time that I've used it.
The best way to learn Emacs is to just use it. Having this book will help you. I have the first edition now collecting dust on a shelf at home. The help, actually info, is very helpful. There's an interactive tutorial that comes with it, etc.
My favorite editor, though, must be sed.
Just be sure to wear the gold uniform when you beam down -- you know what happens when you wear the red one.
I learned emacs in school, but by far the most helpful thing was the PDF reference card I printed up and carried with me. You can get the emacs card at http://refcards.com/
Physicists do it with a big bang!
Start with the most basic navigation commands. Learn to use "Ctrl-H, A" and type words in to learn about other commands you may need (e.g. "Ctrl-H, A, page" yields backward-page, forward-page, etc.)
The most useful thing I've ever done for my productivity, when it comes to Emacs, is to add the following line to my ~/.emacs file: So, when I type Ctrl-Z, it doesn't drop me into the shell (very annoying), but instead executes the last macro. Creating a macro is so easy and executing a gazillion iterations of a macro is now that much easier.
I've tried to switch to IDEs, to Kate (very, very nice), Quanta+ and others. But the power of the easy, fast macro keeps me coming back to Emacs, every time.
534 pages, 437 of which contain a table of all the keyboard shortcuts.
Granted, most of the other editors do this, too. I've been using 'vi' variants for over 20 years, and have currently settled on VIM. Most of them have built-in help for parsing build output, but it just seems so much clunkier than when I watch an EMACS user do it.
What I'd really like is a book or HOWTO that's focused on effective software development using EMACS. The general-purpose "learning" books just don't get into that kind of narrow depth.
Schwab
Editor, A1-AAA AmeriCaptions
I used to work with a guy who used Emacs exclusively for everything, on WinNT even, and I used to think it was a joke. I'd tried learning the standard key-bindings but while they weren't completely non-intuitive, they seemed unneccearily difficult. I used to joke with him that Emacs needed foot pedals in addition to a keyboard.
Then I discovered VIPER mode and the way became clear. I'd taught myself vi a few years earlier while going to school, forcing myself to write my CS homework assignments using it on a Linux box.
Perhaps Emacs is really no more difficult to learn than vi, but it set up a sort of cognitive dissonance in me that I could not overcome. Of course vi can be difficult and cryptic with it single letter keystrokes and love affair with the escape key, but it simply seems so much smaller than emacs, with just that little blank window and blinking cursor.
Emacs on the otherhand just looks so feature rich with all its cascading menus and multiple modes and such that I felt intimidated only learning the basic editing commands. It made me feel stupid, and try as I might, it did not appear to get any more accessible with use.
VIPER is just the ticket for me. All the run-of-the-mill editing is there at the tips of my fingers with familiar commands, and the deeper emacs stuff is still available if and when I care to use it.
Honestly, I think the default key-bindings of Emacs are its greatest impediment to common use. Perhaps every copy of this book (I own the 2nd. edition as well as the manual and references from GNU) should come with a vi quick ref just for good measure.
I run a shell in emacs (esc-x shell). It works great for searching through reams of command line job output and is slightly easier the piping to a file then searching through it (less, more etc...)
Its better than xterm -sl XYZ (set scroll lines to XYZ)
"Eight Megs And Constantly Swapping"
next to the "Over Eighty Megs And Constantly Swapping" of nowadays heavy-duty IDEs, Emacs is as feather-weigth as vi.
I don't feel like it...
stop using Emacs to surf porn then
EMACS is a text mode desktop environment. Sorta like KDE on chemotherapy. Strictly for masochists only.
Oh well, what the hell...