3 % Title: GNU Emacs Survival Card
4 % Author: Wlodek Bzyl <matwb@univ.gda.pl>
7 % $Date: 2000/05/05 22:00:48 $
11 % User interface is `plain.tex' and macros described below
13 % \title{CARD TITLE}{for version 21}
15 % optional paragraphs separated with \askip amount of vertical space
16 % \key{KEY-NAME} description of key or
17 % \mkey{M-x LONG-LISP-NAME} description of Elisp function
19 % \kbd{ARG} -- argument is typed literally
21 \def\plainfmtname{plain
}
22 \ifx\fmtname\plainfmtname
24 \errmessage{This file requires `plain' format to be typeset correctly
}
28 % Copyright (c) 2000 Free Software Foundation, Inc.
30 % This file is part of GNU Emacs.
32 % GNU Emacs is free software; you can redistribute it and/or modify
33 % it under the terms of the GNU General Public License as published by
34 % the Free Software Foundation; either version 2, or (at your option)
37 % GNU Emacs is distributed in the hope that it will be useful,
38 % but WITHOUT ANY WARRANTY; without even the implied warranty of
39 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 % GNU General Public License for more details.
42 % You should have received a copy of the GNU General Public License
43 % along with GNU Emacs; see the file COPYING. If not, write to
44 % the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
45 % Boston, MA 02111-1307, USA.
47 \def\versionnumber{1.0}
50 \def\copyrightnotice{\penalty-
1\vfill
51 \vbox{\smallfont\baselineskip=
0.8\baselineskip\raggedcenter
52 Copyright
\year\ Free Software Foundation, Inc.
\break
53 Version
\versionnumber{} for GNU Emacs
21, April
2000\break
54 Project W
{\l}odek Bzyl (matwb@univ.gda.pl)
56 Permission is granted to make and distribute copies of
57 this card provided the copyright notice and this permission notice
58 are preserved on all copies.
\par}}
62 \font\titlefont=cmss10 scaled
1200
63 \font\headingfont=cmss10
81 \baselineskip=
0.8\baselineskip
83 \newdimen\intercolumnskip % horizontal space between columns
84 \intercolumnskip=
0.5in
87 \let\lr=L
\newbox\leftcolumn
89 \global\setbox\leftcolumn\columnbox \global\let\lr=R
91 \doubleformat \global\let\lr=L
\fi}
92 \def\doubleformat{\shipout\vbox{\makeheadline
93 \leftline{\box\leftcolumn\hskip\intercolumnskip\columnbox}
96 \def\columnbox{\leftline{\pagebody}}
98 \def\newcolumn{\vfil\eject}
100 \def\bye{\par\vfil\supereject
101 \if R
\lr \null\vfil\eject\fi
104 \outer\def\title#1#2{{\titlefont\centerline{#1}}\vskip 1ex plus
0.5ex
106 \vskip2\baselineskip}
108 \outer\def\section#1{\filbreak
110 \leftline{\headingfont #1}
112 \def\bskip{\vskip 2.5ex plus
0.25ex
}
113 \def\askip{\vskip 0.75ex plus
0.25ex
}
115 \newdimen\defwidth \defwidth=
0.25\hsize
116 \def\hang{\hangindent\defwidth}
118 \def\textindent#1{\noindent\llap{\hbox to
\defwidth{\tt#1\hfil}}\ignorespaces}
119 \def\key{\par\hangafter=
0\hang\textindent}
121 \def\mtextindent#1{\noindent\hbox{\tt#1\quad}\ignorespaces}
122 \def\mkey{\par\hangafter=
1\hang\mtextindent}
124 \def\kbd#
{\bgroup\tt \let\next=
}
126 \newdimen\raggedstretch
127 \newskip\raggedparfill \raggedparfill=
0pt plus
1fil
129 {\hyphenpenalty10000\exhyphenpenalty10000\pretolerance10000}
131 {\spaceskip=
0.3333em
\relax
132 \xspaceskip=
0.5em
\relax}
136 \rightskip=
0pt plus
\raggedstretch
138 \parfillskip=
\raggedparfill
143 \rightskip=
0pt plus
\raggedstretch
154 \interlinepenalty=
10000
161 \title{GNU\ \ Emacs\ \ Survival\ \ Card
}{for version
21}
163 In the following,
\kbd{C-z
} means hit the `
\kbd{z
}' key while
164 holding down the
{\it Ctrl
}\ \ key.
\kbd{M-z
} means hit the
165 `
\kbd{z
}' key while hitting the
{\it Meta\/
} (labeled
{\it Alt\/
}
166 on some keyboards) or after hitting
{\it Esc\/
} key.
168 \section{Running Emacs
}
170 To enter GNU Emacs, just type its name:
\kbd{emacs
}.
171 Emacs divides the frame into several areas:
173 buffer area with the edited text,
174 mode line describing the buffer in the window above it,
175 and a minibuffer/echo area in the last line.
177 \key{C-x C-c
} quit Emacs
178 \key{C-x C-f
} edit file; this command uses the minibuffer to read
179 the file name; use this to create new files by entering the name
181 \key{C-x C-s
} save the file
182 \key{C-x k
} kill a buffer
183 \key{C-g
} in most context: cancel, stop, abort partially typed or
187 \section{Moving About
}
189 \key{C-l
} scroll current line to center of window
190 \key{C-x b
} switch to another buffer
191 \key{M-<
} move to beginning of buffer
192 \key{M->
} move to end of buffer
193 \key{M-x goto-line
} go to a given line number
195 \section{Multiple Windows
}
197 \key{C-x
0} remove the current window from the display
198 \key{C-x
1} make active window the only window
199 \key{C-x
2} split window horizontally
200 \key{C-x
3} split window vertically
201 \key{C-x o
} move to other window
205 Emacs defines a `region' as the space between the
{\it mark\/
} and
206 the
{\it point
}. A mark is set with
\kbd{C-
{\it space
}}.
207 The point is at the cursor position.
209 \key{M-h
} mark entire paragraph
210 \key{C-x h
} mark entire buffer
212 \section{Killing and Copying
}
214 \key{C-w
} kill region
215 \key{M-w
} copy region to kill-ring
216 \key{C-k
} kill from the cursor all the way to the end of the line
217 \key{M-DEL
} kill word
218 \key{C-y
} yank back the last kill (
\kbd{C-w C-y
} combination could be
219 used to move text around)
220 \key{M-y
} replace last yank with previous kill
224 \key{C-s
} search for a string
225 \key{C-r
} search for a string backwards
226 \key{RET
} quit searching
227 \key{M-C-s
} regular expression search
228 \key{M-C-r
} reverse regular expression search
230 Use
\kbd{C-s
} or
\kbd{C-r
} again to repeat the search in either direction.
234 Tags tables files record locations of function and
235 procedure definitions, global variables, data types and anything
236 else convenient. To create a tags table file, type
237 `
{\tt etags
} {\it input
\_files}' as a shell command.
239 \key{M-.
} find a definition
240 \key{C-u M-.
} find next occurrence of definition
241 \key{M-*
} pop back to where
\kbd{M-.
} was last invoked
242 \mkey{M-x tags-query-replace
} run query-replace on all files
243 recorded in tags table
244 \key{M-,
} continue last tags search or query-replace
248 \key{M-x compile
} compile code in active window
249 \key{C-c C-c
} go to the next compiler error, when in
250 the compile window or
251 \key{C-x `
} when in the window with source code
253 \section{Dired, the Directory Editor
}
255 \key{C-x d
} invoke Dired
256 \key{d
} flag this file for deletion
257 \key{\~
{}} flag all backup files for deletion
258 \key{u
} remove deletion flag
259 \key{x
} delete the files flagged for deletion
261 \key{g
} update the Dired buffer
262 \key{f
} visit the file described on the current line
263 \key{s
} switch between alphabetical date/time order
265 \section{Reading and Sending Mail
}
267 \key{M-x rmail
} start reading mail
268 \key{q
} quit reading mail
270 \key{d
} mark the current message for deletion
271 \key{x
} remove all messages marked for deletion
273 \key{C-x m
} begin composing a message
274 \key{C-c C-c
} send the message and switch to another buffer
275 \key{C-c C-f C-c
} move to the `CC' header field, creating one
278 \section{Miscellaneous
}
280 \key{M-q
} fill paragraph
281 \key{M-/
} expand previous word dynamically
282 \key{C-z
} iconify (suspend) Emacs when running it under X or
284 \mkey{M-x revert-buffer
} replace the text being edited with the
285 text of the file on disk
287 \section{Query Replace
}
289 \key{M-\%
} interactively search and replace
290 \key{M-C-\%
} using regular expressions
292 Valid responses in query-replace mode are
294 \key{SPC
} replace this one, go on to next
295 \key{,
} replace this one, don't move
296 \key{DEL
} skip to next without replacing
297 \key{!
} replace all remaining matches
298 \key{\^
{}} back up to the previous match
299 \key{RET
} exit query-replace
300 \key{C-r
} enter recursive edit (
\kbd{M-C-c
} to exit)
302 \section{Regular Expressions
}
304 \key{.
{\rm(dot)
}} any single character except a newline
305 \key{*
} zero or more repeats
306 \key{+
} one or more repeats
307 \key{?
} zero or one repeat
308 \key{[$
\ldots$
]} denotes a class of character to match
309 \key{[\^
{}$
\ldots$
]} negates the class
311 \key{\\
{\it c
}} quote characters otherwise having a special
312 meaning in regular expressions
314 \key{$
\ldots$\\|$
\ldots$\\|$
\ldots$
} matches one of
315 the alternatives (``or'')
316 \key{\\( $
\ldots$ \\)
} groups a series of pattern elements to
318 \key{\\
{\it n
}} same text as
{\it n\/
}th group
320 \key{\^
{}} matches at line beginning
321 \key{\$
} matches at line end
323 \key{\
\w} matches word-syntax character
324 \key{\
\W} matches non-word-syntax character
325 \key{\\<
} matches at word beginning
326 \key{\\>
} matches at word end
327 \key{\
\b} matches at word break
328 \key{\
\B} matches at non-word break
332 \key{C-x r s
} save region in register
333 \key{C-x r i
} insert register contents into buffer
335 \key{C-x r SPC
} save value of point in register
336 \key{C-x r j
} jump to point saved in register
340 \key{C-x r r
} copy rectangle to register
341 \key{C-x r k
} kill rectangle
342 \key{C-x r y
} yank rectangle
343 \key{C-x r t
} prefix each line with a string
345 \key{C-x r o
} open rectangle, shifting text right
346 \key{C-x r c
} blank out rectangle
350 \key{M-x shell
} start a shell within Emacs
351 \key{M-!
} execute a shell command
352 \key{M-|
} run a shell command on the region
353 \key{C-u M-|
} filter region through a shell command
355 \section{Spelling Check
}
357 \key{M-\$
} check spelling of word at the cursor
358 \mkey{M-x ispell-region
} check spelling of all words in region
359 \mkey{M-x ispell-buffer
} check spelling of entire buffer
361 \section{International Character Sets
}
363 \key{C-x RET C-\\
} select and activate input method for
365 \key{C-\\
} enable or disable input method
366 \mkey{M-x list-input-methods
} show all input methods
367 \mkey{M-x set-language-environment
} specify principal language
369 \key{C-x RET c
} set coding system for next command
370 \mkey{M-x find-file-literally
} visit file with no conversion
373 \mkey{M-x list-coding-systems
} show all coding systems
374 \mkey{M-x prefer-coding-system
} choose preferred coding system
376 \section{Keyboard Macros
}
378 \key{C-x (
} start defining a keyboard macro
379 \key{C-x )
} end keyboard macro definition
380 \key{C-x e
} execute last-defined keyboard macro
381 \key{C-u C-x (
} append to last keyboard macro
382 \mkey{M-x name-last-kbd-macro
} name last keyboard macro
384 \section{Simple Customization
}
386 \key{M-x customize
} customize variables and faces
388 \section{Getting Help
}
390 Emacs does command completion for you. Typing
\kbd{M-x
}
391 {\it tab\/
} or
{\it space\/
} gives a list of Emacs commands.
394 \key{C-h t
} run the Emacs tutorial
395 \key{C-h i
} enter Info, the documentation browser
396 \key{C-h a
} show commands matching a string (apropos)
397 \key{C-h k
} display documentation of the function invoked by
400 Emacs gets into different
{\it modes
}, each of which customizes
401 Emacs for editing text of a particular sort. The mode line
402 contains names of the current modes, in parentheses.
404 \key{C-h m
} get mode-specific information
411 % compile-command: "tex survival"
414 % arch-tag: 4f9a0562-617b-4843-aee1-450c41d6b22c