Emacs Mastery

Emacs Mastery

Attaining Coding Supremacy

About the Book

Emacs is the ultimate extensible editing environment. There's a reason it's been around for so long and is used by so many programmers.

Like with any flexible, powerful tool, learning Emacs is a major investment. Emacs Mastery will help by covering basic, intermediate, and advanced topics that will improve your effectiveness and by showing you some things Emacs can do that you might not know about. Tetris, anyone?

This book is a personal meandering through Emacs. It's a collection of tips and hints I've collected over decades of using Emacs, organized and expanded into a useful compendium of ideas for you to try and make your own.

Emacs Mastery is not a tutorial, though it does cover some basic things because I've found even some experienced Emacs users don't always remember some of the simpler, easier ways to do things like navigate on the page.

Current Table of Contents (subject to change):

  • Introduction
    • About This Book
      • The Code
      • Conventions
      • Copyright
    • Credits and Thanks
  • Installing and Running Emacs
    • Installing
      • OS X
      • Linux
      • Windows
        • Cygwin
    • Running Emacs
  • Terminology
    • Keys
    • The Emacs Interface
      • Frame
      • Buffer
        • The Minibuffer
      • Window
    • Point, Mark, and the Region
  • Getting Help
    • Info
      • Adding Info Nodes
      • Jumping to Info Nodes
      • Opening Any Info File
    • Help
    • The Internet
    • The Emacs Lisp Source Code
  • Basic Editing
    • Open, Save, Quit
      • Opening a File
        • Entering File Names
        • Compressed Files and Archives
      • Saving a File
        • Autosave and Lock Files
      • Quitting Emacs
    • Inserting Characters
    • Movement
      • Line Numbers and Jumping to Specific Lines
    • Killing and Yanking Text
      • Killing
      • Yanking
      • The Kill Ring
      • More Ways to Kill
      • The System Clipboard
    • Transposing Text
    • Searching and Replacing
      • Incremental Search
        • Non-Incremental Search
      • Searching and Replacing
      • Regular Expressions
    • Changing Case
    • Point and Mark
    • Transient Mark Mode
    • Window, Buffer, and Frame Manipulation
      • Windows
      • Buffers
      • Frames
    • Suspending Emacs
    • Numeric Prefix ("Universal Argument")
    • Extended Commands
  • Emacs Lisp
    • Character Constants
    • defvar and `defcustom`
    • Buffer Local Variables
    • Evaluating an Expression
      • The Minibuffer
      • The Scratch Buffer
      • ielm
    • Anonymous Functions
    • Interactive Functions
    • Aliases
    • Macros
    • mapcar and Friends
    • Common Lisp Extensions
      • EIEIO
    • Dynamic vs. Lexical Binding
    • Compiling
    • Browsing Emacs Code
    • Advice
    • Testing Emacs Lisp Code
    • String Manipulation
    • Miscellaneous
  • Customizing Emacs
    • The Initialization File
    • Loading Files and the Load Path
    • Modes
      • Using Modes
        • Loading the Code
        • Associating Files With a Mode
        • Hooks
    • ELPA
    • Killing the Menu Bar and Toolbar
    • Customizing Your Customizations
    • File-Local Variables
    • Per-Directory Settings
  • Key Bindings
    • Bound Functions Must Be Interactive
    • Defining Prefix Key Combinations
    • Remapping Keyboard Keys
      • Caps Lock -> Control
      • Command/Alt Key -> Meta
        • OS X
      • The Hyper and Super Keys
  • Intermediate Editing
    • Finding Text Across Files and Buffers
      • grep
      • rgrep
      • grep-find
      • find-grep-dired
      • deft
    • Finding, Counting, and Deleting All Lines Containing Text
    • Undoing changes
      • Undo
      • Reverting Buffer Changes
    • Additional Movement Commands
    • Bookmarks
    • More Editing Commands
    • What Is That Character?
    • What Did I Just Type?
    • Indentation
    • Recentering Lines On the Page
      • Moving the Cursor Instead
    • Zapping to Char
    • Deleting Extra Spaces and Empty Lines
    • Filling and Fill Prefix
    • Unicode
    • Rectangles
    • Hooks
  • Finding Files
    • Dired
    • find-dired
    • Ido
    • find-file-at-point
    • locate-dominating-file
    • ef
    • Tramp
    • ff-find-other-file
  • Registers
    • Strings and Numbers
    • Rectangles
    • Positions and Window Layouts
    • Keyboard Macros
    • Manipulating Registers Programmatically
  • Just Another Pretty Face
    • Terminals
    • Font Lock Mode
      • State of Confusion
    • Displaying Colors
    • Font Names
    • Customizing Font Faces
    • Themes
    • Embiggening
  • Even More Arbitrarily Collected Subjects
    • Narrowing
    • Encryption
      • The EasyPG Assistant
        • A Tip: Entering Passwords in Emacs
      • pgg
      • crypt++
    • Executable Molasses? Advantage: Client / Server
      • Shell Interaction
      • emacsclient Tricks
    • Comparing Files
      • compare-windows
      • diff-buffer-with-file
      • ediff
      • Diff Mode
    • Info About the Character at Point
    • smex
    • Wrapping Text
      • Long Lines
    • Read-Only and View Modes
    • Reading PDFs
    • Displaying Images
    • Bar Charts
    • Amusements
    • Screen Saver
    • Calc
    • SES
  • Type Less, Output More
    • Dabbrev Expand
    • YASnippet
    • Keyboard Macros
      • Inserting Numbers
      • Editing Keyboard Macros
    • Abbreviations
    • Skeletons
    • Yes or No?
  • Programming: Editing, Running, and Debugging Code
    • Programming Language Modes
      • Random Mode Thoughts
        • web-mode
    • Flymake and Flycheck
    • Compiling
    • Running Scripts
    • Tags and find-tag
    • Intellisense, CEDET
    • Showing and Hiding Code (Folding)
    • REPLs and Inferior Modes
      • Lisp
        • Emacs Lisp
        • Clojure
        • SBCL and CLisp
      • Ruby / Python
    • HTTP-Twiddle and restclient
      • HTTP-Twiddle
      • restclient.el
    • Single Shell Commands
    • SQL
    • Tailing Log Files
    • Man Pages
    • Looking Up Javadocs
    • Source Code Control
    • Hex Editor
  • Org Mode
    • Overview
    • Outlining
    • Markup
    • To Do Lists
    • Agenda
    • Blocks
    • Tables
    • Links
      • Your Own Link Types
    • Encryption
    • Exporting
    • Publishing
    • Running Code
    • Macros
    • Sparse Tree
    • Random Notes
  • Publishing
    • ispell
    • LaTeX
    • Markdown and Textile
    • Org Mode
    • Slides
  • Shells
    • Environment Variables
      • Mac OS X and Environment Variables
    • Eshell Mode
    • Shell Mode
    • Term Mode
    • Ansi-Term
  • Dates and Times
    • Calendar
    • Diary
    • Time Zone, Latitude, and Longitude
    • Timed Events
  • Writing New Modes
    • Generic
    • Major Mode
  • The Outside World
    • Email
      • Sending Email
    • The World Wide Web
    • RSS
      • Gnus for RSS
      • Elfeed
    • IRC
    • OS X and AppleScript
    • Emacs Multimedia System
  • Enumerated Miscellaneous Advice, Collected Sporadically
    • Emacs Modes Are Copious, Serviceable
    • Eight Megabytes And Constantly Swapping
    • Emacs Meanderings Are Concluded Suddenly

About the Author

Jim Menard
Jim Menard

Jim Menard has been coding for over 30 years, and still loves it. He's an Emacs user and a language maven. Though slowly slipping over to the dark side of tech management, Jim hopes not to become completely useless.

Jim is also a family man and a musician. He has played in bands on and off since the late 1970's.

Feel free to reach out to Jim at jim@jimmenard.com.

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub