The joy of an integrated environment

Most of my GNU Emacs learning time has continued to be spent writing elisp. I am very slowly starting to retrain myself on a couple of basic keystrokes: M-g M-g (goto-line) and M-% (query-replace) are two biggies, because my use of ido-ubquitous mode actually means that my default use of M-x to get to both of those is disrupted—the minibuffer no longer autocompletes in the same way, so if I’m going to have to relearn how to get to them, I should really re-learn the short versions.

Anyway, I did want to take a moment to sing the praises of the GNU Emacs Help facility, because it has been invaluable. Specifically C-h f (describe-function) and C-h v (describe-variable). While the help they give is necessarily brief, it’s often enough for someone like me, who just needs a gentle prod about something now and again. I even used C-h f to look up the documentation for if a few minutes ago, because I couldn’t remember if you had to do progn to do a multi-statement else block.

So that’s it for today. Learn the rich set of commands that let you get right to what you need in the documentation—it will be invaluable for exploring emacs.

Building blocks

The two tasks I do most in Emacs (which are two of the three tasks I do most at the computer) are read email and write programs.

I probably spend far more of my time in those tasks editing than I ever do writing—that is, I may write a first draft of a paragraph in an email, or a function in a program, in five minutes, and then spend fifteen getting it right.

A large part of that process will involve moving stuff around, sometimes in large chunks—because the flow of a program or a document isn’t just about one sentence coming after the other, but about how the ideas embodied in whatever you’re writing flow through the entire construct. If you don’t edit your emails and programs a lot, if you don’t spend more time in the refinement than the first draft then, well…I don’t know if I want to read your emails or source code.

Anyway, it’s important to me to be able to cut and paste stuff efficiently, and, again, this is one of those things where my knowledge isn’t as comprehensive as I would like. I’ve known about C-x h (mark-whole-buffer) for roughly forever, but that’s about it besides the normal set-mark-and-move behavior. I’ve got a bunch of new things to work with now.

M-@ (mark-word) is one I hope to get down pretty quickly. To have the cursor stay where it is, but have the region extend itself quickly should make a lot of email-y sorts of tasks much simpler.

Similarly, M-h (mark-paragraph) will be a nice addition to the toolbox when writing emails, or when writing things like blog posts—I often decide to reorder stuff on a paragraph-by-paragraph basis to help the flow of my ideas.

I don’t know how much use I’ll get out of C-M-@ (mark-sexp) in the short term. I will try to remember it when I’m working with lisp, but honestly, I don’t do so much of that, at least not yet—I have ambitions. So perhaps it will come in handy.

C-x C-p (mark-page) probably isn’t going to see a lot of use from me—I don’t use the whole ^L-delimited pages thing at all, really.

C-M-h (mark-defun) has some potential. As long as its implementation is up to snuff with regards to CPerl or Haskell modes—that is, in those modes, it has a sensible idea of what constitutes a function definition—I could see myself finding a lot of use for these things.