Starting to use Aquamacs

Here we give a short description of some features that we have found useful for editing and lemmatising ATF in Aquamacs (Emacs for Mac), apart from those provided by ATF Mode.

Emacs is a very powerful piece of software, but its documentation is dense, difficult to navigate, and usually assumes that you are working in Unix without a mouse. And it doesn't help that Aquamacs has its own little quirks. This page aims to make working with Emacs as intuitive and Mac-like as possible.

Setting the default font

In Aquamacs, you can open up (and close) a Fonts window with the command ⌘⇧T. In that window, you can choose a font, size, colour, as you would normally, and save different combinations as favourites. To ensure you have all the necessary transliteration and normalisation characters, we recommend that you install the DejaVu font and set it as the default. Two different ways of typing transliteration characters are described on other pages. You can use either or both, as you like.

Menus and the Toolbar

When you first install Aquamacs, it is worth looking through the menus to locate the basic commands. Much is where you would expect it, though Emacs terminology can seem rather strange to Mac users. A "buffer" is essentially a view of a document, which is displayed in one or more "frames" (windows). A frame may have more than one tab, each containing a different buffer, in the same way that a web browser can several web pages open at once in different tabs.You may also be unfamiliar with the Aquamacs terms "directory" (folder) and "search" (find).

Apart from the ATF menu, the File, Edit, Options, and Windows menus will be most useful to you. You are unlikely to need anything in Tools, and the Help menu lists far too many different sorts of help to be useful for a beginner. Even on the File, Edit, Options, and Windows menus there are many items that you will never need, so do not worry if they seem mostly incomprehensible to you for now.

There is also a toolbar at the top of each Emacs frame, with clickable icons for basic editing and file commands. You can add items to the toolbar, and remove them from it, by selecting and deselecting them from the Options > View > Toolbar Items menu item.

Menus and toolbars are comforting and intuitive, especially when you are first learning to use a new piece of software. But for more efficient working it is useful to learn as many keyboard shortcuts as possible. Next to most menu items you will see the equivalent keyboard shortcut, and there are many hundreds more. But almost everything you will need can be found through the menus or is described on this page.

The Control and Meta keys

Almost all Emacs keyboard shortcuts are combinations with the Control or Meta keys. You'll see them written as, for instance, C-g or M-x.

The minibuffer is Emacs's name for the little window that appears at the bottom of a frame when you type a command and where, for instance, you type text that you want to find or replace. If you find your cursor there accidentally C-g will get you out of it with no harm done.

On Macs the Control key is marked ctrl and is often found near the fn, alt and (Apple/command) keys near the bottom of the keyboard. When you see a command such as C-g, this means that you should hold down the Control key and then press the g key simultaneously. Many keyboard shortcuts involve sequences of commands, so that for instance C-c C-c means that you type Control-and-c twice.

The Meta key is the esc key (usually top left on the keyboard). For, say, M-u you type esc first and then the u key, not the two simultaneously.

As you will see on the menus, the key also retains much of its functionality in Aquamacs, so that for instance you can save files with ⌘S, just as usual.

To make sure that the alt key works properly in Aquamacs, go to the Option Key item on the Options menu, and select Standard Mac characters.

Keyboard shortcuts

Word wrapping

Changing case

Deleting text

Swapping and sorting text

Going to a particular line

Searching for text

Systematically replacing text

To start a global search-and-replace within a file, type M-%. In the minibuffer type the search term (e.g., teh) and press return, then type the replacement term (e.g., the) and press return again. Aquamacs will highlight the first occurrence of the search term.

Search and replace with special characters (regular expressions)

If you want to search for text that only occurs in a particular context, then you will need to learn a little bit about Emac's so-called regular expressions. For instance you can specify that text is a whole word, or occurs at the end of a line.

^ = start of line
For instance, ^the finds "the" at the beginning of a line.
$ = end of line
Similarly, the$ finds "the" at the end of a line.
\< = start of word
Then \<the finds "the" at the start of a word (e.g., in "there" but not in "lithe")
\> = end of word
the\> finds "the" at the end of a word (e.g., in "lithe" but not in "there"). Thus \<the\> finds whole-word "the" (but not words like "there" or "lithe".

You can also use regular expressions to make more generalised search terms.

[ ] can contain any set of characters
For instance, th[aeiou] will find the characters "th" followed by any short vowel. You can put any combination of characters inside the square brackets.
. = any single character
Also, t.e will find the characters "t" and "e" separated by any single character (e.g., "the" but also "tee", "tre" "t-e", etc.)
.* = any number of characters
t.*e will find the characters "t" and "e" separated by any number of characters (e.g., "te" but also "treasure").

To use these regular expressions in a search, you need to:

Searching in multiple files at once

Working with windows and buffers

Almost everything on the File and Windows menus is self-explanatory. You can almost always open, save, close, and print buffers using menu items, toolbar items, and normal Mac keyboard shortcuts just as you would normally.

It's often useful to have two views of the same file at once, especially if you are lemmatising and translating at the same time. C-x 2 splits a buffer in half horizontally and C-x 1 removes the split. C-x 5 2 opens the same buffer in a new frame, so that you can put them side by side.

If you have several buffers open at once, you can keep track of them, and move between them through the list in the Windows menu. A * after a file name means that it has been edited since it was last saved.

When Emacs starts up, it automatically opens a buffer called *scratch*, which you can use as a dumping ground for notes, to-do lists and text (such as ATF protocol lines) that you frequently re-use. If you don't want to use *scratch*, just ignore it: you can't get rid of it but it's harmless.

The Mode Line

Just above the minibuffer is a grey line (called the Mode Line, for what it's worth) with lots of useful information in it. It probably says something like:

\u:** filename.atf 68% of 43k (334,48) [(ATF Outl)]

Exploring more of Emacs's capabilities

The GNU Emacs manual [http://www.gnu.org/software/emacs/manual/emacs.html] is exhaustive and useful (if you are patient) but is geared to Unix users and/or programmers. Similarly, Debra Cameron et al.'s book, Learning GNU Emacs, 3rd ed., O'Reilly (2005) starts too slowly and then covers far more ground than you will need. But it does include a very handy detachable reference card inside the back cover listing dozens of useful keyboard shortcuts. In the end, a search in your web browser for "Emacs thing command" (where "thing" is whatever you are looking for) is almost always the quickest way to find what you want to know.

More documentation on Emacs

18 Dec 2019 osc at oracc dot org

Eleanor Robson

Eleanor Robson, 'Starting to use Aquamacs', Oracc: The Open Richly Annotated Cuneiform Corpus, Oracc, 2019 [http://oracc.museum.upenn.edu/doc/help/nammuandemacs/aquamacs/]

 
Back to top ^^
 

Released under a Creative Commons Attribution Share-Alike license 3.0, 2014. [http://www.facebook.com/opencuneiform] [http://oracc.blogspot.com] [http://www.twitter.com/oracctivity]
Oracc uses cookies only to collect Google Analytics data. Read more here; see the stats here [http://www.seethestats.com/site/oracc.museum.upenn.edu]; opt out here.

http://oracc.museum.upenn.edu/doc/help/nammuandemacs/aquamacs/