DOC PREVIEW
Berkeley COMPSCI 61B - Highlights of GNU Emacs

This preview shows page 1-2-3-4-5-6 out of 17 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Basic ConceptsImportant special-purpose commandsBasic EditingSimple text.Navigation within a buffer.Context searches.Deletion, insertion, and text movementUsing the mouseReplacementModesFiles, buffers, and windowsOn-line documentationThe info browserThe shellCompiling, debugging, and tagsCompilationUsing GDB and GJDB under EmacsTagsUse with SubversionBut wait; there's more!UNIVERSITY OF CALIFORNIADepartment of Electrical Engineeringand Computer SciencesComputer Science DivisionCS61B P. N. HilfingerFall 2011Highlights of GNU EmacsThis document describes the major f eatures of GNU Emacs (called “Emacs” hereafter), a cus-tomizable, self-documenting text editor. There are versions available for all our UNIX systems, aswell as Windows 95 and Windows NT. In the interests of truth , beauty, and justice—and to undo, insome small part, the damage Berkeley has done by foisting vi on an already-unhappy world—Emacswill be the official CS61B alternative text editor this semester. I have spoken.Emacs carries with it on-line documentation of most of its commands, along with a tutorialfor first-time users. Section 5 describes h ow to use these facilities. Because this documentation isavailable, I have not made attempted to present a complete Emacs reference manual here.To run Emacs, simply enter the command emacs to the shell. If you are on a Sun, it is best tobe running under X, so as to get full advantage of the window system. Within Emacs, as describedbelow, you can edit any number of files simultaneously. On UNIX and NT systems, you can also runUNIX shells, and compile, execute, and debug programs. As a result, it should seldom be necessaryto leave Emacs before you are ready to logout.1 Basic ConceptsAt any given time, Emacs maintains one or more buffers containing text. Each buffer may, but neednot, be associated with a file. A buffer may be associated with a UNIX process, in which case thebuffer generally contains input and output pr oduced by that process (see, for example, sections 6and 7). Within each buffer, there is a position called the point, where most of the action takes place.Emacs displays one or more windows into its buffers, each showing some portion of the text ofsome buffer. A buffer’s text is retained even when no window displays it; it can be displayed at anytime by giving it a window. Each window has its own point (as just described); when only one windowdisplays a buffer, its point is the same as the buffer’s point. Two windows can simultaneously displaytext (not necessarily the same text) fr om the same buffer with a different point in each window,although it is most often usefu l to use multiple windows to display multiple files. At the bottom ofeach window, Emacs displays a mode line, which generally identifies the buffer being displayed and(if applicable) the file associated with it. At any given time, the cursor, which generally marks thepoint of text insertion, is in one of the windows (called the current window) at that window’s point.At the bottom of Emacs’ display is a single ec ho area, displaying the contents of the minibuffer.This is a one-line buffer in which one types commands. It is, for many purposes, an ordinary E macsbuffer; standard Emacs text-editing commands for moving left or right and for inserting or d eletingcharacters generally work in it. To issue a command by name, one types M-x (“meta-x”; this notationis described below) followed by the name of the command and RET (the return key); the echo areadisplays the command as it is typed. It is only n ecessary to type as much of the command nameas suffices to identify it uniquely. For example, to run the command for looking at a UNIX manual12 P. N. Hilfingerentry—for which the full command is M-x manual-entry—it suffices to type M-x man, followed by aRET.All Emacs commands have names, and you can issue them with M-x. You’ll invoke most com-mands, however, by using control characters and escape sequences to which these commands arebound. Almost every character typed to Emacs actually executes a command. By default, typing anyof the pr intable ch aracters executes a command that inserts th at character at the cursor. Many of thecontrol characters are bound to commonly-used commands (see the quick-reference guide at the endfor a summary of particularly important ones). At any time, it is possible to bind an arbitrary keyor sequence of keys to an arbitrary command, thus customizing Emacs to your own tastes. Hence,all descriptions of key bindings in this docu ment are actually descriptions of standard or defaultbindings.In referring to non-graphic keys (control characters and the like), we’ll use the following notations.ESC denotes the escape character.DEL denotes the delete character. On HP workstations, the ‘Backspace’ key has the same effect.SPC denotes the space character.RET denotes the result of pressing th e ‘Return’ key. (Confusingly, the result of typing this into a fileis not a return character (ASCII code 13), but rather a linefeed character (ASCII code 10).Nevertheless, Emacs distinguishes the two keys.)LFD denotes the result of typing the linefeed key.TAB denotes the tab (also C-i) key.C-x denotes the result of control-shifting a character x.M-α denotes the result of meta-shifting a character α (on our HP workstations when running theX window system, either ‘Alt’ key serves as a meta-shift key; it is held down while typing x).Alternatively, one may type M-α as the two-character sequence ESC f ollowed by α.C-M-α denotes the result of simultaneously control- and meta-shifting x (on HP workstations whenrunnin g X, hold down the Alt and Control keys simultaneously with typing α). Alternatively,one may type ESC C-α.The binding of keys to commands depends on the buffer that currently contains the cursor. Thisallows d ifferent buffers to respond to characters in different ways. In this document, we will r eferto the set of key bindings in effect within a given buffer as the (major) mode of that buffer (theterm “mode” is actually somewhat ill-defined in Emacs). There are certain standard modes that aredescribed in section 3.7.Certain commands take arguments, and take these arguments f rom a variety of sources. Anycommand may be given a numeric argum ent. To enter the number comprising the digits d0d1· · · dnas a numeric argument (d0may also be a minus s ign), type either ‘M-d0d1· · · dn’ or ‘C-ud0d1· · · dn’before the command. When


View Full Document

Berkeley COMPSCI 61B - Highlights of GNU Emacs

Documents in this Course
Lab

Lab

4 pages

Matrix

Matrix

3 pages

Numbers

Numbers

14 pages

Lectures

Lectures

12 pages

Project 1

Project 1

24 pages

Exam

Exam

8 pages

Load more
Download Highlights of GNU Emacs
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Highlights of GNU Emacs and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Highlights of GNU Emacs 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?