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.

9 of 334 comments (clear)

  1. Could people actualy be RTFA? by budgenator · · Score: 2, Insightful

    Intersting the author appears to be presenting the "atheist" point of view, into a subject the stirs religious rants amongst the editor's loyalist.

    What I'd like to find and or write is a good PHP/HTML mode for emacs, or even a CPAN/CTAN clone for emacs modes and scripts.

    --
    Apocalypse Cancelled, Sorry, No Ticket Refunds
  2. emacs is awesome... by Anonymous Coward · · Score: 3, Insightful

    ..yet I hardly ever use it.

    I used to use Emacs for development, vi for sysadmin, but once I discovered Vim, I've started using Emacs less and less for dev, except when hacking Lisp (using SLIME.. you just can't do Lisp effectively without an editor at least as powerful as Emacs).

    I can really appreciate Emacs, and I love Lisp (being able to code some quick Lisp right in the middle of an email reply is pretty damn cool for instance), but I just don't *need* that kind of flexibility. And the lack of consistency with Meta keys is frustrating (on my Mac, Carbon Emacs uses command, the terminal uses option, but on other machines I have to fall back on Esc).

    I noticed the new Emacs has a built-in spreadsheet, by the way (M-x ses-mode). It's actually pretty cool (the cells are Lisp expressions, and the code is checked for dangerous operations before being excecuted). It's also a sign that maybe Emacs is a little TOO flexible???

    Anyway, I'm not sure the point of this post, except that everybody should at least give Emacs a try.

  3. Re:I've tried to learn emacs to no avail by sammy+baby · · Score: 3, Insightful
    (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.

    Except that for plenty of us, Ctrl-Z is already mapped in our heads to "Undo." So while we're stabbing at Ctrl-Z to undo what we just did, Emacs will helpfully be doing it again.

    (Sorry - I'm sure it works well for you, but for someone just learning Emacs, it might not be the best idea. ;) )
  4. 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

  5. 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.

  6. Emacs doesn't do email well...what?!? by Bob+Uhl · · Score: 2, Insightful
    For example, while Emacs does have the capability to function as an email client, other applications have long superseded its ability.

    I'll have the reviewer know that I use gnus for my email and news reading, and it's perfect for the task. I've still yet to find a program which has as many features, and yet to find one which is accessible over a command-line as well as through a GUI.

  7. 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...
  8. Re:IDE vs Emacs vs Jove all have their place by Christianfreak · · Score: 1, Insightful

    Full blown IDEs like Eclipse are really worth the power, especially since they are able to semantically understand source code.

    So can vim, and it does it better. About the only thing Eclipse can do that vim can't (as far as i know) is context help (like hover over a function and get an annoying pop-up as to what it does), an annoying and useless "feature" for someone like me who's been programming enough years to know what most of the functions are by now, and by the time Eclipse's help finally stops causing my harddrive to help I can have it looked up in the man page or Google or whatever.

    I have a ton of other problems with Eclipse but I won't get into it here. I just wish someone could tell me why I need some huge bloated thing that takes over my entire screen and needs a gig of RAM to do the same thing I've been doing for nearly 10 years with a program that typically uses less than 100k.

  9. Re:I've tried to learn emacs to no avail by Fahrenheit+450 · · Score: 2, Insightful

    For the record, how can something be both unintuitive and logical? :)

    Because intuition and logic aren't the same thing. For a simple example take the birthday paradox (which isn't a paradox, but I didn't name it so don't blame me). It is completely unintuitive that a random set of 23 people has a greater than 50% chance of containing at two people who share a birthday. However, a straightforward proof shows that this is indeed the case.

    Another logical, yet unintuitive thing is that the cardinality of the integers and rational numbers is the same...

    --
    -30-