Slashdot Mirror


Learning GNU Emacs, 3rd Edition

barryhawkins writes "It's safe to assume that people who are thinking of learning GNU Emacs or improving their Emacs skills are motivated. These people probably know their way around a command prompt, and likely know that Lisp is more than just a speech impediment. They need a book that offers expert advice without wasting time or insulting the intelligence of the reader: Learning GNU Emacs, 3rd Edition is that book." Read on for the rest of Hawkins' review. Learning GNU Emacs, 3rd Edition author Debra Cameron, James Elliott, Marc Loy, Eric Raymond & Bill Rosenblatt pages 534 publisher O'Reilly Publishing rating 9 reviewer Barry Hawkins ISBN 0596006489 summary An intelligent, graded treatment of the landscape of useful Emacs skills and how to internalize them

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.

You can purchase Learning GNU Emacs, 3rd Edition from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

17 of 334 comments (clear)

  1. VI can't we have this thread without someone... by djh101010 · · Score: 5, Funny

    ...doing just what I just did? I mean, just once?

    1. Re:VI can't we have this thread without someone... by freshman_a · · Score: 5, Funny

      Since you've already started...

      The only 3 commands any Emacs user needs to know:

      Ctrl-x
      Ctrl-c
      vi

      Let the flame wars begin! :)

      (for the record, I use both Emacs and vi...)

    2. Re:VI can't we have this thread without someone... by Sponge+Bath · · Score: 4, Funny
      for the record, I use both Emacs and vi...

      We need a mod option '+1, poor bastard'

  2. Reviewed 9 months after publication! by GLevangelist · · Score: 5, Funny

    But given Emacs' startup time, you're forgiven.

  3. GNU Emacs Manual Is Excellent by Anonymous Coward · · Score: 5, Informative

    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.

    1. Re:GNU Emacs Manual Is Excellent by grumbel · · Score: 4, Informative

      ### Emacs also comes with a built-in tutorial that is a good interactive introduction to Emacs.

      It not only comes with a tutorial, the editor itself is completly self-documenting.

      Don't know what a key combo means: 'C-h k' then enter the combo
      Don't know what a function means: 'C-h f' then the function name
      Don't know whats available: 'C-h a' to search through all commands
      Wanna know what other commands are hiding behind 'C-x ...': 'C-x C-h' to get a list

      All the stuff you get as results is hyperlinked and Emacs even allows you to let you click through all that docu down the the actual line of source that performs the function. This self-documentation is something that I miss in almost every other app that is around these days and shows that Emacs, for all its problems, is still quite a few years ahead in some areas bejoint other 'state of the art' applications that people use these days.

  4. Re:I've tried to learn emacs to no avail by panda · · Score: 4, Informative

    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.
  5. Refcards.com by bokumo · · Score: 5, Informative

    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!
  6. Tim O'Reilly on vi or emacs by Noksagt · · Score: 4, Informative
    Reference:
    Despite emacs' higher profile as a free software poster child, I think more people actually use vi than emacs. We sell more copies of our vi book than of our emacs book -- almost twice as many each year. This could be because emacs has a free manual that is distributed with it. But I saw a matching statistic at Linux Expo, where O'Reilly sponsors a vi vs. emacs paintball game each year. I happened to check the signup list, and noticed that there were about twice as many people signed up for the vi team as for the emacs team. (Maybe they just like the vi t-shirt -- the team "uniform" -- more than the emacs t-shirt, but I don't think so.
  7. Re:I've tried to learn emacs to no avail by soloport · · Score: 4, Informative
    what's the best way?

    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:
    (global-set-key "\C-z" 'call-last-kbd-macro)
    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.
  8. Hefty tome by Dachannien · · Score: 5, Funny

    534 pages, 437 of which contain a table of all the keyboard shortcuts.

  9. EMACS for Development by ewhac · · Score: 4, Insightful
    One of the things I've often noted about EMACS users is that they seem so effective. A couple former colleages of mine would flip around at amazing speed, getting to the exact point in the code they needed, make a change, launch a build in a separate EMACS window, and the error output would take them to the correct line in the broken file where they'd fix it.

    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

  10. Re:I've tried to learn emacs to no avail by hwestiii · · Score: 5, Insightful

    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.

  11. emacs's ultimate power.. the shell by acomj · · Score: 4, Informative

    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)

  12. outdated joke by namekuseijin · · Score: 4, Insightful

    "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...
  13. Re:Hand hurts after using Emacs all day by trash+eighty · · Score: 4, Funny

    stop using Emacs to surf porn then

  14. Re:What is Emacs? by HermanAB · · Score: 4, Funny

    EMACS is a text mode desktop environment. Sorta like KDE on chemotherapy. Strictly for masochists only.

    --
    Oh well, what the hell...