callable guile procs
[bpt/emacs.git] / etc / refcards / survival.tex
CommitLineData
59f534e9 1%&tex
59f534e9 2% Title: GNU Emacs Survival Card
0b5546d6 3
ba318903 4% Copyright (C) 2000-2014 Free Software Foundation, Inc.
0b5546d6 5
59f534e9 6% Author: Wlodek Bzyl <matwb@univ.gda.pl>
0b5546d6
GM
7
8% This file is part of GNU Emacs.
9
10% GNU Emacs is free software: you can redistribute it and/or modify
11% it under the terms of the GNU General Public License as published by
12% the Free Software Foundation, either version 3 of the License, or
13% (at your option) any later version.
14
15% GNU Emacs is distributed in the hope that it will be useful,
16% but WITHOUT ANY WARRANTY; without even the implied warranty of
17% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18% GNU General Public License for more details.
19
20% You should have received a copy of the GNU General Public License
21% along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22
59f534e9
KH
23%**start of header
24
25% User interface is `plain.tex' and macros described below
26%
ece53951 27% \title{CARD TITLE}{for version 23}
59f534e9
KH
28% \section{NAME}
29% optional paragraphs separated with \askip amount of vertical space
30% \key{KEY-NAME} description of key or
31% \mkey{M-x LONG-LISP-NAME} description of Elisp function
177c0ea7 32%
59f534e9
KH
33% \kbd{ARG} -- argument is typed literally
34
35\def\plainfmtname{plain}
36\ifx\fmtname\plainfmtname
37\else
38 \errmessage{This file requires `plain' format to be typeset correctly}
39 \endinput
177c0ea7 40\fi
59f534e9 41
81ec0bb3
MC
42% PDF output layout. 0 for A4, 1 for letter (US), a `l' is added for
43% a landscape layout.
81ec0bb3
MC
44\input pdflayout.sty
45\pdflayout=(1)
46
dcf8834b 47\input emacsver.tex
59f534e9
KH
48
49\def\copyrightnotice{\penalty-1\vfill
50 \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter
0b5546d6
GM
51 Copyright \copyright\ \year\ Free Software Foundation, Inc.\break
52 For GNU Emacs version \versionemacs\break
53 Author W{\l}odek Bzyl (matwb@univ.gda.pl)
59f534e9
KH
54
55 Permission is granted to make and distribute copies of
56 this card provided the copyright notice and this permission notice
57 are preserved on all copies.\par}}
58
59\hsize 3.2in
60\vsize 7.95in
61\font\titlefont=cmss10 scaled 1200
62\font\headingfont=cmss10
63\font\smallfont=cmr6
64\font\smallsy=cmsy6
65\font\eightrm=cmr8
66\font\eightbf=cmbx8
67\font\eightit=cmti8
68\font\eighttt=cmtt8
69\font\eightmi=cmmi8
70\font\eightsy=cmsy8
71\font\eightss=cmss8
72\textfont0=\eightrm
73\textfont1=\eightmi
74\textfont2=\eightsy
75\def\rm{\eightrm} \rm
76\def\bf{\eightbf}
77\def\it{\eightit}
78\def\tt{\eighttt}
79\def\ss{\eightss}
80\baselineskip=0.8\baselineskip
81
82\newdimen\intercolumnskip % horizontal space between columns
83\intercolumnskip=0.5in
84
85% The TeXbook, p. 257
86\let\lr=L \newbox\leftcolumn
177c0ea7 87\output={\if L\lr
59f534e9
KH
88 \global\setbox\leftcolumn\columnbox \global\let\lr=R
89 \else
90 \doubleformat \global\let\lr=L\fi}
91\def\doubleformat{\shipout\vbox{\makeheadline
92 \leftline{\box\leftcolumn\hskip\intercolumnskip\columnbox}
93 \makefootline}
94 \advancepageno}
95\def\columnbox{\leftline{\pagebody}}
96
97\def\newcolumn{\vfil\eject}
98
99\def\bye{\par\vfil\supereject
100 \if R\lr \null\vfil\eject\fi
177c0ea7 101 \end}
59f534e9
KH
102
103\outer\def\title#1#2{{\titlefont\centerline{#1}}\vskip 1ex plus 0.5ex
104 \centerline{\ss#2}
105 \vskip2\baselineskip}
106
107\outer\def\section#1{\filbreak
108 \bskip
109 \leftline{\headingfont #1}
110 \askip}
111\def\bskip{\vskip 2.5ex plus 0.25ex }
112\def\askip{\vskip 0.75ex plus 0.25ex}
113
114\newdimen\defwidth \defwidth=0.25\hsize
115\def\hang{\hangindent\defwidth}
116
117\def\textindent#1{\noindent\llap{\hbox to \defwidth{\tt#1\hfil}}\ignorespaces}
118\def\key{\par\hangafter=0\hang\textindent}
119
120\def\mtextindent#1{\noindent\hbox{\tt#1\quad}\ignorespaces}
121\def\mkey{\par\hangafter=1\hang\mtextindent}
122
123\def\kbd#{\bgroup\tt \let\next= }
124
125\newdimen\raggedstretch
126\newskip\raggedparfill \raggedparfill=0pt plus 1fil
127\def\nohyphens
128 {\hyphenpenalty10000\exhyphenpenalty10000\pretolerance10000}
129\def\raggedspaces
177c0ea7 130 {\spaceskip=0.3333em\relax
59f534e9
KH
131 \xspaceskip=0.5em\relax}
132\def\raggedright
133 {\raggedstretch=6em
134 \nohyphens
135 \rightskip=0pt plus \raggedstretch
136 \raggedspaces
137 \parfillskip=\raggedparfill
138 \relax}
139\def\raggedcenter
140 {\raggedstretch=6em
141 \nohyphens
142 \rightskip=0pt plus \raggedstretch
143 \leftskip=\rightskip
144 \raggedspaces
145 \parfillskip=0pt
146 \relax}
147
148\chardef\\=`\\
149
150\raggedright
151\nopagenumbers
152\parindent 0pt
153\interlinepenalty=10000
154\hoffset -0.2in
155%\voffset 0.2in
156
157%**end of header
158\f
159
bfcddba0 160\title{GNU\ \ Emacs\ \ Survival\ \ Card}{for version \versionemacs}
59f534e9
KH
161
162In the following, \kbd{C-z} means hit the `\kbd{z}' key while
163holding down the {\it Ctrl}\ \ key. \kbd{M-z} means hit the
164`\kbd{z}' key while hitting the {\it Meta\/} (labeled {\it Alt\/}
165on some keyboards) or after hitting {\it Esc\/} key.
166
167\section{Running Emacs}
168
169To enter GNU Emacs, just type its name: \kbd{emacs}.
177c0ea7 170Emacs divides the frame into several areas:
59f534e9
KH
171 menu line,
172 buffer area with the edited text,
173 mode line describing the buffer in the window above it,
174 and a minibuffer/echo area in the last line.
175\askip
176\key{C-x C-c} quit Emacs
177\key{C-x C-f} edit file; this command uses the minibuffer to read
178 the file name; use this to create new files by entering the name
179 of the new file
180\key{C-x C-s} save the file
181\key{C-x k} kill a buffer
182\key{C-g} in most context: cancel, stop, abort partially typed or
177c0ea7 183 executing command
59f534e9
KH
184\key{C-x u} undo
185
186\section{Moving About}
187
188\key{C-l} scroll current line to center of window
189\key{C-x b} switch to another buffer
190\key{M-<} move to beginning of buffer
191\key{M->} move to end of buffer
ece53951 192\key{M-g M-g} go to a given line number
59f534e9
KH
193
194\section{Multiple Windows}
195
196\key{C-x 0} remove the current window from the display
197\key{C-x 1} make active window the only window
198\key{C-x 2} split window horizontally
199\key{C-x 3} split window vertically
200\key{C-x o} move to other window
201
202\section{Regions}
203
204Emacs defines a `region' as the space between the {\it mark\/} and
205the {\it point}. A mark is set with \kbd{C-{\it space}}.
206The point is at the cursor position.
207\askip
208\key{M-h} mark entire paragraph
209\key{C-x h} mark entire buffer
210
211\section{Killing and Copying}
212
213\key{C-w} kill region
214\key{M-w} copy region to kill-ring
215\key{C-k} kill from the cursor all the way to the end of the line
216\key{M-DEL} kill word
217\key{C-y} yank back the last kill (\kbd{C-w C-y} combination could be
218 used to move text around)
219\key{M-y} replace last yank with previous kill
220
221\section{Searching}
222
223\key{C-s} search for a string
224\key{C-r} search for a string backwards
225\key{RET} quit searching
226\key{M-C-s} regular expression search
227\key{M-C-r} reverse regular expression search
228\askip
229Use \kbd{C-s} or \kbd{C-r} again to repeat the search in either direction.
230
231\section{Tags}
232
233Tags tables files record locations of function and
234procedure definitions, global variables, data types and anything
177c0ea7 235else convenient. To create a tags table file, type
59f534e9
KH
236`{\tt etags} {\it input\_files}' as a shell command.
237\askip
238\key{M-.} find a definition
239\key{C-u M-.} find next occurrence of definition
240\key{M-*} pop back to where \kbd{M-.} was last invoked
241\mkey{M-x tags-query-replace} run query-replace on all files
242 recorded in tags table
243\key{M-,} continue last tags search or query-replace
244
245\section{Compiling}
246
247\key{M-x compile} compile code in active window
177c0ea7 248\key{C-c C-c} go to the next compiler error, when in
59f534e9
KH
249 the compile window or
250\key{C-x `} when in the window with source code
251
252\section{Dired, the Directory Editor}
253
254\key{C-x d} invoke Dired
255\key{d} flag this file for deletion
256\key{\~{}} flag all backup files for deletion
257\key{u} remove deletion flag
258\key{x} delete the files flagged for deletion
259\key{C} copy file
260\key{g} update the Dired buffer
261\key{f} visit the file described on the current line
262\key{s} switch between alphabetical date/time order
263
264\section{Reading and Sending Mail}
265
266\key{M-x rmail} start reading mail
267\key{q} quit reading mail
268\key{h} show headers
269\key{d} mark the current message for deletion
270\key{x} remove all messages marked for deletion
271
272\key{C-x m} begin composing a message
273\key{C-c C-c} send the message and switch to another buffer
177c0ea7 274\key{C-c C-f C-c} move to the `CC' header field, creating one
59f534e9
KH
275 if there is none
276
277\section{Miscellaneous}
278
279\key{M-q} fill paragraph
280\key{M-/} expand previous word dynamically
281\key{C-z} iconify (suspend) Emacs when running it under X or
282 shell, respectively
283\mkey{M-x revert-buffer} replace the text being edited with the
284 text of the file on disk
285
286\section{Query Replace}
287
288\key{M-\%} interactively search and replace
289\key{M-C-\%} using regular expressions
290\askip
291Valid responses in query-replace mode are
292\askip
293\key{SPC} replace this one, go on to next
294\key{,} replace this one, don't move
295\key{DEL} skip to next without replacing
296\key{!} replace all remaining matches
297\key{\^{}} back up to the previous match
298\key{RET} exit query-replace
299\key{C-r} enter recursive edit (\kbd{M-C-c} to exit)
300
301\section{Regular Expressions}
302
303\key{. {\rm(dot)}} any single character except a newline
304\key{*} zero or more repeats
305\key{+} one or more repeats
306\key{?} zero or one repeat
307\key{[$\ldots$]} denotes a class of character to match
308\key{[\^{}$\ldots$]} negates the class
309
310\key{\\{\it c}} quote characters otherwise having a special
177c0ea7 311 meaning in regular expressions
59f534e9 312
177c0ea7 313\key{$\ldots$\\|$\ldots$\\|$\ldots$} matches one of
59f534e9
KH
314 the alternatives (``or'')
315\key{\\( $\ldots$ \\)} groups a series of pattern elements to
316 a single element
317\key{\\{\it n}} same text as {\it n\/}th group
318
319\key{\^{}} matches at line beginning
320\key{\$} matches at line end
321
322\key{\\w} matches word-syntax character
323\key{\\W} matches non-word-syntax character
324\key{\\<} matches at word beginning
325\key{\\>} matches at word end
326\key{\\b} matches at word break
327\key{\\B} matches at non-word break
328
329\section{Registers}
330
331\key{C-x r s} save region in register
332\key{C-x r i} insert register contents into buffer
333
334\key{C-x r SPC} save value of point in register
335\key{C-x r j} jump to point saved in register
336
337\section{Rectangles}
338
339\key{C-x r r} copy rectangle to register
340\key{C-x r k} kill rectangle
341\key{C-x r y} yank rectangle
342\key{C-x r t} prefix each line with a string
343
344\key{C-x r o} open rectangle, shifting text right
345\key{C-x r c} blank out rectangle
346
347\section{Shells}
348
349\key{M-x shell} start a shell within Emacs
350\key{M-!} execute a shell command
351\key{M-|} run a shell command on the region
352\key{C-u M-|} filter region through a shell command
353
354\section{Spelling Check}
355
356\key{M-\$} check spelling of word at the cursor
357\mkey{M-x ispell-region} check spelling of all words in region
358\mkey{M-x ispell-buffer} check spelling of entire buffer
359
360\section{International Character Sets}
361
177c0ea7 362\key{C-x RET C-\\} select and activate input method for
59f534e9
KH
363 the current buffer
364\key{C-\\} enable or disable input method
365\mkey{M-x list-input-methods} show all input methods
366\mkey{M-x set-language-environment} specify principal language
367
368\key{C-x RET c} set coding system for next command
177c0ea7 369\mkey{M-x find-file-literally} visit file with no conversion
59f534e9
KH
370 of any kind
371
372\mkey{M-x list-coding-systems} show all coding systems
373\mkey{M-x prefer-coding-system} choose preferred coding system
374
375\section{Keyboard Macros}
376
377\key{C-x (} start defining a keyboard macro
378\key{C-x )} end keyboard macro definition
379\key{C-x e} execute last-defined keyboard macro
380\key{C-u C-x (} append to last keyboard macro
381\mkey{M-x name-last-kbd-macro} name last keyboard macro
382
383\section{Simple Customization}
384
385\key{M-x customize} customize variables and faces
386
387\section{Getting Help}
388
177c0ea7 389Emacs does command completion for you. Typing \kbd{M-x}
59f534e9
KH
390{\it tab\/} or {\it space\/} gives a list of Emacs commands.
391\askip
392\key{C-h} Emacs help
393\key{C-h t} run the Emacs tutorial
394\key{C-h i} enter Info, the documentation browser
395\key{C-h a} show commands matching a string (apropos)
396\key{C-h k} display documentation of the function invoked by
397 keystroke
398\askip
399Emacs gets into different {\it modes}, each of which customizes
400Emacs for editing text of a particular sort. The mode line
401contains names of the current modes, in parentheses.
402\askip
403\key{C-h m} get mode-specific information
404
405\copyrightnotice
406
407\bye
408\f
409% Local variables:
81ec0bb3 410% compile-command: "pdftex survival"
59f534e9 411% End:
ab5796a9 412