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.

10 of 334 comments (clear)

  1. I've tried to learn emacs to no avail by winkydink · · Score: 2, Interesting

    I've been using vi for over 20 years. From time to time, I have tried to learn emacs (seeing the benefits) but the learning curve seems so steep, relative to just sticking with the statuis quote. Short of taking a couple of months off to focus on this extensiveley, what's the best way?

    --

    "I'd rather be a lightning rod than a seismometer." -Ken Kesey

  2. Hand hurts after using Emacs all day by zomper514 · · Score: 1, Interesting

    I have noticed when I use Emacs for extended periods of time my right hand hurts at the end of the day.

    I upgraded to a Microsoft Wireless Comfort Keyboard to try and aleviate the problem but it doesn't seem to be helping all that much.

    Any suggestions from the Slashdot crowd. Are their any emacs friendly keyboards?

    1. Re:Hand hurts after using Emacs all day by EvanED · · Score: 2, Interesting

      Agreed. I flop caps and ctrl (even in Windows) and have never looked back.

      The Sun layout with respect to that is, IMO, vastly superior to the PC layout even w/o the Emacs benefit.

      (Of course, I suggest you don't actually get a Sun keyboard, because the location of backspace (no longer at the corner) is an abomination. If you have to use one, may I suggest the following:
      (global-set-key "`" 'backward-delete-char-untabify)

      (Add that to ~/.emacs) That will fix that braindead decision. I've been known to run a shell from inside Emacs when I'm working on a Sun just so that I can press backspace in the normal location and it will work.

      I'd have moded you up but I wanted to take that pot shot at the Sun layout.)

  3. A lot of words by Red+Flayer · · Score: 2, Interesting

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

    Do the authors discuss the relative benefits and drawbacks of each method? Do they discuss when it is and isn't appropriate for each? More info on this would be helpful.

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

    This is not muscle memory. This can be called learning through use. If the reader were to repeat the intended action 5,000 times, then maybe it could be called muscle memory.

    My impression from the review is that the book will:

    Give me the basics of Emacs use, and how they differ sometimes on different platforms;
    Give me mnemonics to memorize keyboard shortcuts;
    Show me multiple ways of doing some things;
    Show me how to use basic Emacs with different languages, in some common situations.

    So, my understanding from reading the review is that this is an fairly thorough introduction to Emac use that is easy to understand and doesn't bother with extraneous material.

    Am I off base here?

    --
    "Trolls they were, but filled with the evil will of their master: a fell race..." -- J.R.R. Tolkien on Olog-hai
  4. The king of editors by beforewisdom · · Score: 1, Interesting

    I used gnu emacs all throughout and college and thought it was the best thing since sliced bread.

    Then a boss introduced me to slickedit.

    It is EXPENSIVE, but it is worth every penny.

    Imagine the power of emacs, more power, and an elegant, easy interface.

    No offense to anyone, just my two cents worth.

    Steve

  5. Re:IDE vs Emacs vs Jove all have their place by Anonymous Coward · · Score: 1, Interesting

    Are you talking about Vim's semantic colouring? If so, it most certainly does *not* do it better than eclipse and if not then I'd really like to know what feature of vim you *are* talking about! :-)

  6. Faster starting by meowsqueak · · Score: 2, Interesting

    Emacs has a feature where it can save it's entire state to disk as an executable binary. If you subsequently invoke this binary, Emacs starts up extremely quickly with the restored state, bypassing the usual initialisation and dot-emacs processing. A very neat feature IMO.

  7. Re:Try Aquamacs Emacs on Mac OS X by hardcoreUFO · · Score: 2, Interesting

    I think the Aqua and Carbon emacs are both terrible. If you are going to have an Aqua version of emacs, you could at *least* not use gnome icons in the toolbar. I'm not sure what the motivation for doing Aqua was if it ends up that ugly.

  8. GNU Emacs Manual Is Long, but not Excellent by Darkforge · · Score: 2, Interesting

    There's no reason why learning Emacs has to be intimidating, but it's misleading comments like this that make people believe that they don't understand Emacs.

    Do us all a favor and compare the Emacs Manual Table of Contents with the Learning GNU Emacs Table of Contents.

    The Emacs manual begins with an encyclopedic glossary of Emacs terms. 17 pages of terms, according to "Print Preview" in Firefox. Afterwards, you get index pages: a list of all the default keys, a list of all the default options (without even a link to a chapter explaining how to tweak an option), a command index (again, no info on how to run a command), a variable index (same deal), and a "concept index" full of links all over the manual. Finally you get to a very abstract section about how to interpret what's on the Screen, but still no information on how to actually use Emacs.

    The O'Reilly book begins with "Emacs Basics", an easy-to-follow guide to the beginnings of Emacs. It looks more like the Emacs tutorial in a plain text format.

    The Emacs "Manual" is a gigantic man page. It's not a "manual" in the sense that you're supposed to sit down and read it as a first introduction to Emacs. It's not a guide for people to read. It's a reference guide for you to go find information you already knew was there.

    I'll admit, the built-in tutorial is a much better introduction, but it leaves you at the novice level. You know how to push the cursor around, but you know *nothing* about how to set options, what a variable is, how to set them, etc. To get from here to there requires hours of reading random info pages to try to find what you're looking for. Nothing like reading a clear manual.

    Never recommend that a newbie to Emacs read the Emacs Manual. The Manual is for Intermediate users wishing to become Advanced. The Tutorial is for novices. For those wishing to get to the Intermediate level, this O'Reilly book isn't a half bad choice.

    --

    When I moderate, I only use "-1, Overrated". That way, I never get meta-moderated!

  9. Why I Use Emacs. by BBF_BBF · · Score: 2, Interesting

    Why I Started:
    1. I was forced to learn EMACS as the *only* text editor for CPSC200 by a Nazi like professor and his TA henchmen eons ago.
    1a. I was a unix newbie, so when told to use emacs and told nothing about vi... guess which one I'll use. Anyways when one is clueless [ESC]:q! is as incomprehensible as [CTRL]x-c. (Anyways cursor movement without using cursor keys sucked with both vi and emacs: the vi "hjkl" movement keys that worked only in certain modes vs. emacs' mnemonic [CTRL]bnpf movement keys... thank {place a deity here, or "DEC" you're athiest or an uber gEEk} for creating VT100 terminals and with it the defacto standard for cursor keycodes, and full screen cursor placement.)
    2. I actually used Wordstar before learning emacs, so incomprehensible control key commands were nothing new.

    Why I Continued to Use EMACS after CPSC 200 while in University:
    1. Unix boxes actually had a control button in a place that made control commands almost ergonomic.
    2. One only has so much time to learn other editors when one's busy trying to avoid studying by playing/tweaking MUD's, xtrek, xtank, compiling and trying out beta versions of NCSA Mosaic.

    Why I Still Use Emacs Today in an Embedded Development Environment Hosted Off MS Windoze:
    1. Same reason I use Linux, Firefox, etc: It's Open Source software so there are alot of gEEks smarter and have more spare time than me developing plugins, extensions, Emacs major modes, etc, etc, so as a result
    a) I have access to extensions that would take me forever to write myself, that's assuming I could even come close to implementing such feats of software prowess even if given an infinite number of monkeys to work with,
    b) I have the source code for the tool and the extensions, so I can modify and reconfigure them as I like if they don't exactly fit my needs,
    c) I don't have to beg to get some purchase order from the accountants to avoid getting the company into trouble with lawsuits for using *my* favourite commercial editor and conversely can use the same editor at home.
    2. I have the evolved my .emacs configuration from my university days and have transmuted from apollo Domain to SunOS to HP/UX to VMS and finally to Windoze XP with linux slotted in there for home use.
    3. It's entertaining watching your coworkers get all pissed off when trying to cut and paste on your Windoze computer because you've swapped the key mapping for CAPS LOCK and CTRL on the Windoze Keyboard and didn't bother to relabel the keys. Note it can get dangerous if your coworkers are near the end of their ropes because everybody's been working way too many hours to meet some artificial deadline that management has decreed upon the peons.
    4. Last but not least, Has anybody mentioned the easy macro programming? Without learning a line of lisp, one can create complex macros... and by just learning a smattering of lisp, make macros that will amaze your co-workers (except the unix gods that use only "ed" because they believe that "vi" is not light weight enough, let alone an editor that includes a lisp interpreter and many megabytes of elisp scripts... anyways who needs to see more than one line of text at a time.)
    5. Anyways it's gEEky to use Gnu Emacs ([flame suit on] not XEmacs, only weirdo's use that [flame suit off]). What other reason does a nerd need to do anything?