7.2 Changing the Location of Point
If you use Linux or Mac OS, Emacs comes pre-installed and all you have to do is call it via Terminal by typing emacs. From there, the best way to start with Emacs is to get familiar with navigation, basic commands, key bindings, adding and deleting text by running the tutorial and typing “C-h t, that is, Ctrl-h followed by t”. I can use emacs commands everywhere on macOS, which is good. For example, in forms in Safari, I can use ctl-a, ctl-k, etc. I can use them in Note.app, too. My guess is they are actually. (In this post, I will abbreviate Emacs for Mac as McE, and Emacs via Terminal.app as TME, short for 'text-mode Emacs'.) Let me start with the case of, by way of example. According to describe-bindings ( C-h b ) for Org Mode, should be bound to org-metaright. Make emacs textfield keybindings a pref aka, conflicting key bindings on linux/unix (Ctrl+W doesn't close empty tabs).
To do more than insert characters, you have to know how to movepoint (see Point). The keyboard commands C-f, C-b,C-n, and C-p move point to the right, left, down, and up,respectively. You can also move point using the arrow keyspresent on most keyboards: <RIGHT>, <LEFT>,<DOWN>, and <UP>; however, many Emacs users findthat it is slower to use the arrow keys than the control keys, becauseyou need to move your hand to the area of the keyboard where thosekeys are located.
You can also click the left mouse button to move point to theposition clicked. Emacs also provides a variety of additionalkeyboard commands that move point in more sophisticated ways.
forward-char
). right-char
) behaves like C-f, except whenpoint is in a right-to-left paragraph (see Bidirectional Editing). backward-char
). left-char
) behaves like C-b, except if thecurrent paragraph is right-to-left (see Bidirectional Editing). next-line
). This command attemptsto keep the horizontal position unchanged, so if you start in themiddle of one line, you move to the middle of the next. previous-line
). This commandpreserves position within the line, like C-n. move-beginning-of-line
). move-end-of-line
). forward-word
). See Words. right-word
) behaves like M-f, except itmoves backward by one word if the current paragraph isright-to-left. See Bidirectional Editing. backward-word
). See Words. left-word
) behaves like M-b, except itmoves forward by one word if the current paragraph isright-to-left. See Bidirectional Editing. move-to-window-line-top-bottom
). A numeric argument says which screen line to place point on, countingdownward from the top of the window (zero means the top line). Anegative argument counts lines up from the bottom (−1 means thebottom line). See Arguments, for more information on numericarguments.
beginning-of-buffer
). Withnumeric argument n, move to n/10 of the way from the top. On graphical displays, C-<HOME> does the same. end-of-buffer
). On graphicaldisplays, C-<END> does the same. scroll-up-command
). See Scrolling. scroll-down-command
). See Scrolling. goto-line
). Line 1 is the beginning of the buffer. Ifpoint is on or just after a number in the buffer, that is the defaultfor n. Just type <RET> in the minibuffer to use it. You canalso specify n by giving M-g M-g a numeric prefix argument. See Select Buffer, for the behavior of M-g M-g when you give ita plain prefix argument. set-goal-column
) in the currentbuffer. When a semipermanent goal column is in effect, those commandsalways try to move to this column, or as close as possible to it,after moving vertically. The goal column remains in effect untilcanceled. When a line of text in the buffer is longer than the width of thewindow, Emacs usually displays it on two or more screen lines. For convenience, C-n and C-p move point by screen lines,as do the equivalent keys <down> and <up>. Youcan force these commands to move according to logical lines(i.e., according to the text lines in the buffer) by setting thevariable
line-move-visual
to nil
; if a logical lineoccupies multiple screen lines, the cursor then skips over theadditional screen lines. For details, see Continuation Lines. See Variables, for how to set variables such asline-move-visual
. Unlike C-n and C-p, most of the Emacs commands that workon lines work on logical lines. For instance, C-a(
move-beginning-of-line
) and C-e(move-end-of-line
) respectively move to the beginning and endof the logical line. Whenever we encounter commands that work onscreen lines, such as C-n and C-p, we will point theseout. When
line-move-visual
is nil
, you can also set thevariable track-eol
to a non-nil
value. Then C-nand C-p, when starting at the end of the logical line, move tothe end of the next logical line. Normally, track-eol
isnil
. C-n normally stops at the end of the buffer when you use it onthe last line in the buffer. However, if you set the variable
next-line-add-newlines
to a non-nil
value, C-n onthe last line of a buffer creates an additional line at the end andmoves down into it. I came late into this game. I didn’t write python scripts when I was in kindergarten. I didn’t hack into my high school’s camera security system. My aim in this post is to show you that you equally don’t need to be a master hacker or whiz coder to get closer to your writing machine. This isn’t a how-to.
It merely points to the free software and packages you can get to start compiling text into amazing, quality files, into whichever format you want. But to get there keep in mind:
- Be patient. This can be a transformative experience if you let it happen.
- You’ll have a lot of looking-up online to do, especially if you’re just starting out. Issues will come up. Yet there are wonderful, dedicated groups of people helping out each other online. So far I haven’t had a problem for which there wasn’t at least a hint of a solution proposed.
My main impulses to do this came from
- Frustration with Microsoft Word, Scrivener and Adobe InDesign for Mac
- Will to productive procrastination.
I liked writing in Scrivener. I followed the tutorial to the “t” with the trial version, then bought my license a couple years ago and never looked back to Microsoft Word. But annoyance still crept up when I exported my dissertation files to a Word document my supervisor could read. Footnote alignment was this bottom of a page hell place. Bibliography management with Zotero was so-so. Active partition recovery. And images. Don’t even get me started on laying out photos on either Scrivener or Word.
My frustration grew to the point I’m now convinced it must be the mother of all invention — or, to make that statement a little less grandiose: of most free software. That’s also when a genial flash of imperative came in the mental thought form “you must learn Emacs and LaTeX”.
Why Emacs?
Emacs is one of the most stable, extensible text editors out there. It’s been around for more than 30 years and it’s also “free as in freedom” software, meaning among other things that you can customize it to your liking and share those customizations with communities of dedicated peers. Those customizations are the predecessors of things like “preferences” and “settings” menus on most software. Whereas the latter still lock you in by giving you a few options to choose from, with Emacs sky is the limit.
Once you switch to Emacs and realize that the world of super file conversion is at your fingertips with Pandoc, you can write text in the simplest of interfaces and convert it to any of the 40 or so different export formats Pandoc handles. If you write in Markdown, this will give you incredible flexibility. No more fussing with style formatting on any text editor.
First Steps
If you use Linux or Mac OS, Emacs comes pre-installed and all you have to do is call it via Terminal by typing
emacs
. From there, the best way to start with Emacs is to get familiar with navigation, basic commands, key bindings, adding and deleting text by running the tutorial and typing “C-h t, that is, Ctrl-h followed by t”.It will take time. The learning curve is steep if you compare this to Microsoft Word or any other graphical text editor. But once you get a few typing habits down and a few packages installed, it all starts going smoother and faster. You don’t have to reach for the mouse as often as you did, and you can start editing all sorts of documents out of one place. As I went on — and will keep — learning emacs, I realized typing with a different system meant I didn’t think the same way about things.
Choosing your Emacs
If you decide you like it, you can choose from any of the many Emacs distributions out there instead of your pre-installed version on Mac OS. I use Aquamacs. I like the way it behaves as an app in Mac OS, I like how it integrates the Mac OS spell-check, and I liked how it came with AUCTeX pre-installed (more on that later).
Emacs Mac Port
Pandoc
I’m not sure I would have switched to Emacs for my writing without Pandoc. This “swiss-army knife” of markup conversion does wonders. There are many ways to install it (I downloaded the package. If you’re not sure where it’s been installed once you did that type
which pandoc
on Terminal and it’ll give you its location in your system). And the commands running it are initially simple.Mac Emacs 27
Going Further
If you’re in grad school, you’ll want to play with LaTeX and get initiated to the wonderful world of type-setting and layout. To do this download MacTeX — the full 3gb version, not the light one. This will get you playing with Emacs and Pandoc very nicely and in little time.
With more looking up online and figuring out, you’ll be able to create templates for every kind of writing and correspondance format you’ll need, and you’ll be able to change these templates however you see fit. This also means you’ll be able to distinguish content from format in new and powerful ways.
It doesn’t mean you have to forego proprietary software forever. But It’ll open up on ways you can create more thinking space for yourself, and on more than one way of doing things on a computer.