3 % Title: GNU Emacs Survival Card
4 % Author: Wlodek Bzyl <matwb@univ.gda.pl>
8 % User interface is `plain.tex' and macros described below
10 % \title{CARD TITLE}{for version 21}
12 % optional paragraphs separated with \askip amount of vertical space
13 % \key{KEY-NAME} description of key or
14 % \mkey{M-x LONG-LISP-NAME} description of Elisp function
16 % \kbd{ARG} -- argument is typed literally
18 \def\plainfmtname{plain
}
19 \ifx\fmtname\plainfmtname
21 \errmessage{This file requires `plain' format to be typeset correctly
}
25 % PDF output layout. 0 for A4, 1 for letter (US), a `l' is added for
31 % Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005,
32 % 2006, 2007, 2008 Free Software Foundation, Inc.
34 % This file is part of GNU Emacs.
36 % GNU Emacs is free software: you can redistribute it and/or modify
37 % it under the terms of the GNU General Public License as published by
38 % the Free Software Foundation, either version 3 of the License, or
39 % (at your option) any later version.
41 % GNU Emacs is distributed in the hope that it will be useful,
42 % but WITHOUT ANY WARRANTY; without even the implied warranty of
43 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44 % GNU General Public License for more details.
46 % You should have received a copy of the GNU General Public License
47 % along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
49 \def\versionnumber{1.0}
51 \def\year{2008} % latest copyright year
53 \def\copyrightnotice{\penalty-
1\vfill
54 \vbox{\smallfont\baselineskip=
0.8\baselineskip\raggedcenter
55 Copyright
\year\ Free Software Foundation, Inc.
\break
56 Version
\versionnumber{} for GNU Emacs
\versionemacs, April
2000\break
57 Project W
{\l}odek Bzyl (matwb@univ.gda.pl)
59 Permission is granted to make and distribute copies of
60 this card provided the copyright notice and this permission notice
61 are preserved on all copies.
\par}}
65 \font\titlefont=cmss10 scaled
1200
66 \font\headingfont=cmss10
84 \baselineskip=
0.8\baselineskip
86 \newdimen\intercolumnskip % horizontal space between columns
87 \intercolumnskip=
0.5in
90 \let\lr=L
\newbox\leftcolumn
92 \global\setbox\leftcolumn\columnbox \global\let\lr=R
94 \doubleformat \global\let\lr=L
\fi}
95 \def\doubleformat{\shipout\vbox{\makeheadline
96 \leftline{\box\leftcolumn\hskip\intercolumnskip\columnbox}
99 \def\columnbox{\leftline{\pagebody}}
101 \def\newcolumn{\vfil\eject}
103 \def\bye{\par\vfil\supereject
104 \if R
\lr \null\vfil\eject\fi
107 \outer\def\title#1#2{{\titlefont\centerline{#1}}\vskip 1ex plus
0.5ex
109 \vskip2\baselineskip}
111 \outer\def\section#1{\filbreak
113 \leftline{\headingfont #1}
115 \def\bskip{\vskip 2.5ex plus
0.25ex
}
116 \def\askip{\vskip 0.75ex plus
0.25ex
}
118 \newdimen\defwidth \defwidth=
0.25\hsize
119 \def\hang{\hangindent\defwidth}
121 \def\textindent#1{\noindent\llap{\hbox to
\defwidth{\tt#1\hfil}}\ignorespaces}
122 \def\key{\par\hangafter=
0\hang\textindent}
124 \def\mtextindent#1{\noindent\hbox{\tt#1\quad}\ignorespaces}
125 \def\mkey{\par\hangafter=
1\hang\mtextindent}
127 \def\kbd#
{\bgroup\tt \let\next=
}
129 \newdimen\raggedstretch
130 \newskip\raggedparfill \raggedparfill=
0pt plus
1fil
132 {\hyphenpenalty10000\exhyphenpenalty10000\pretolerance10000}
134 {\spaceskip=
0.3333em
\relax
135 \xspaceskip=
0.5em
\relax}
139 \rightskip=
0pt plus
\raggedstretch
141 \parfillskip=
\raggedparfill
146 \rightskip=
0pt plus
\raggedstretch
157 \interlinepenalty=
10000
164 \title{GNU\ \ Emacs\ \ Survival\ \ Card
}{for version
\versionemacs}
166 In the following,
\kbd{C-z
} means hit the `
\kbd{z
}' key while
167 holding down the
{\it Ctrl
}\ \ key.
\kbd{M-z
} means hit the
168 `
\kbd{z
}' key while hitting the
{\it Meta\/
} (labeled
{\it Alt\/
}
169 on some keyboards) or after hitting
{\it Esc\/
} key.
171 \section{Running Emacs
}
173 To enter GNU Emacs, just type its name:
\kbd{emacs
}.
174 Emacs divides the frame into several areas:
176 buffer area with the edited text,
177 mode line describing the buffer in the window above it,
178 and a minibuffer/echo area in the last line.
180 \key{C-x C-c
} quit Emacs
181 \key{C-x C-f
} edit file; this command uses the minibuffer to read
182 the file name; use this to create new files by entering the name
184 \key{C-x C-s
} save the file
185 \key{C-x k
} kill a buffer
186 \key{C-g
} in most context: cancel, stop, abort partially typed or
190 \section{Moving About
}
192 \key{C-l
} scroll current line to center of window
193 \key{C-x b
} switch to another buffer
194 \key{M-<
} move to beginning of buffer
195 \key{M->
} move to end of buffer
196 \key{M-x goto-line
} go to a given line number
198 \section{Multiple Windows
}
200 \key{C-x
0} remove the current window from the display
201 \key{C-x
1} make active window the only window
202 \key{C-x
2} split window horizontally
203 \key{C-x
3} split window vertically
204 \key{C-x o
} move to other window
208 Emacs defines a `region' as the space between the
{\it mark\/
} and
209 the
{\it point
}. A mark is set with
\kbd{C-
{\it space
}}.
210 The point is at the cursor position.
212 \key{M-h
} mark entire paragraph
213 \key{C-x h
} mark entire buffer
215 \section{Killing and Copying
}
217 \key{C-w
} kill region
218 \key{M-w
} copy region to kill-ring
219 \key{C-k
} kill from the cursor all the way to the end of the line
220 \key{M-DEL
} kill word
221 \key{C-y
} yank back the last kill (
\kbd{C-w C-y
} combination could be
222 used to move text around)
223 \key{M-y
} replace last yank with previous kill
227 \key{C-s
} search for a string
228 \key{C-r
} search for a string backwards
229 \key{RET
} quit searching
230 \key{M-C-s
} regular expression search
231 \key{M-C-r
} reverse regular expression search
233 Use
\kbd{C-s
} or
\kbd{C-r
} again to repeat the search in either direction.
237 Tags tables files record locations of function and
238 procedure definitions, global variables, data types and anything
239 else convenient. To create a tags table file, type
240 `
{\tt etags
} {\it input
\_files}' as a shell command.
242 \key{M-.
} find a definition
243 \key{C-u M-.
} find next occurrence of definition
244 \key{M-*
} pop back to where
\kbd{M-.
} was last invoked
245 \mkey{M-x tags-query-replace
} run query-replace on all files
246 recorded in tags table
247 \key{M-,
} continue last tags search or query-replace
251 \key{M-x compile
} compile code in active window
252 \key{C-c C-c
} go to the next compiler error, when in
253 the compile window or
254 \key{C-x `
} when in the window with source code
256 \section{Dired, the Directory Editor
}
258 \key{C-x d
} invoke Dired
259 \key{d
} flag this file for deletion
260 \key{\~
{}} flag all backup files for deletion
261 \key{u
} remove deletion flag
262 \key{x
} delete the files flagged for deletion
264 \key{g
} update the Dired buffer
265 \key{f
} visit the file described on the current line
266 \key{s
} switch between alphabetical date/time order
268 \section{Reading and Sending Mail
}
270 \key{M-x rmail
} start reading mail
271 \key{q
} quit reading mail
273 \key{d
} mark the current message for deletion
274 \key{x
} remove all messages marked for deletion
276 \key{C-x m
} begin composing a message
277 \key{C-c C-c
} send the message and switch to another buffer
278 \key{C-c C-f C-c
} move to the `CC' header field, creating one
281 \section{Miscellaneous
}
283 \key{M-q
} fill paragraph
284 \key{M-/
} expand previous word dynamically
285 \key{C-z
} iconify (suspend) Emacs when running it under X or
287 \mkey{M-x revert-buffer
} replace the text being edited with the
288 text of the file on disk
290 \section{Query Replace
}
292 \key{M-\%
} interactively search and replace
293 \key{M-C-\%
} using regular expressions
295 Valid responses in query-replace mode are
297 \key{SPC
} replace this one, go on to next
298 \key{,
} replace this one, don't move
299 \key{DEL
} skip to next without replacing
300 \key{!
} replace all remaining matches
301 \key{\^
{}} back up to the previous match
302 \key{RET
} exit query-replace
303 \key{C-r
} enter recursive edit (
\kbd{M-C-c
} to exit)
305 \section{Regular Expressions
}
307 \key{.
{\rm(dot)
}} any single character except a newline
308 \key{*
} zero or more repeats
309 \key{+
} one or more repeats
310 \key{?
} zero or one repeat
311 \key{[$
\ldots$
]} denotes a class of character to match
312 \key{[\^
{}$
\ldots$
]} negates the class
314 \key{\\
{\it c
}} quote characters otherwise having a special
315 meaning in regular expressions
317 \key{$
\ldots$\\|$
\ldots$\\|$
\ldots$
} matches one of
318 the alternatives (``or'')
319 \key{\\( $
\ldots$ \\)
} groups a series of pattern elements to
321 \key{\\
{\it n
}} same text as
{\it n\/
}th group
323 \key{\^
{}} matches at line beginning
324 \key{\$
} matches at line end
326 \key{\
\w} matches word-syntax character
327 \key{\
\W} matches non-word-syntax character
328 \key{\\<
} matches at word beginning
329 \key{\\>
} matches at word end
330 \key{\
\b} matches at word break
331 \key{\
\B} matches at non-word break
335 \key{C-x r s
} save region in register
336 \key{C-x r i
} insert register contents into buffer
338 \key{C-x r SPC
} save value of point in register
339 \key{C-x r j
} jump to point saved in register
343 \key{C-x r r
} copy rectangle to register
344 \key{C-x r k
} kill rectangle
345 \key{C-x r y
} yank rectangle
346 \key{C-x r t
} prefix each line with a string
348 \key{C-x r o
} open rectangle, shifting text right
349 \key{C-x r c
} blank out rectangle
353 \key{M-x shell
} start a shell within Emacs
354 \key{M-!
} execute a shell command
355 \key{M-|
} run a shell command on the region
356 \key{C-u M-|
} filter region through a shell command
358 \section{Spelling Check
}
360 \key{M-\$
} check spelling of word at the cursor
361 \mkey{M-x ispell-region
} check spelling of all words in region
362 \mkey{M-x ispell-buffer
} check spelling of entire buffer
364 \section{International Character Sets
}
366 \key{C-x RET C-\\
} select and activate input method for
368 \key{C-\\
} enable or disable input method
369 \mkey{M-x list-input-methods
} show all input methods
370 \mkey{M-x set-language-environment
} specify principal language
372 \key{C-x RET c
} set coding system for next command
373 \mkey{M-x find-file-literally
} visit file with no conversion
376 \mkey{M-x list-coding-systems
} show all coding systems
377 \mkey{M-x prefer-coding-system
} choose preferred coding system
379 \section{Keyboard Macros
}
381 \key{C-x (
} start defining a keyboard macro
382 \key{C-x )
} end keyboard macro definition
383 \key{C-x e
} execute last-defined keyboard macro
384 \key{C-u C-x (
} append to last keyboard macro
385 \mkey{M-x name-last-kbd-macro
} name last keyboard macro
387 \section{Simple Customization
}
389 \key{M-x customize
} customize variables and faces
391 \section{Getting Help
}
393 Emacs does command completion for you. Typing
\kbd{M-x
}
394 {\it tab\/
} or
{\it space\/
} gives a list of Emacs commands.
397 \key{C-h t
} run the Emacs tutorial
398 \key{C-h i
} enter Info, the documentation browser
399 \key{C-h a
} show commands matching a string (apropos)
400 \key{C-h k
} display documentation of the function invoked by
403 Emacs gets into different
{\it modes
}, each of which customizes
404 Emacs for editing text of a particular sort. The mode line
405 contains names of the current modes, in parentheses.
407 \key{C-h m
} get mode-specific information
414 % compile-command: "pdftex survival"
417 % arch-tag: 4f9a0562-617b-4843-aee1-450c41d6b22c