]> code.delx.au - gnu-emacs/blob - etc/refcards/refcard.tex
6ca9856085d787e905f50e829ce68a38510e5efb
[gnu-emacs] / etc / refcards / refcard.tex
1 % Reference Card for GNU Emacs
2
3 % Copyright (C) 1987, 1993, 1996-1997, 2001-2012
4 % Free Software Foundation, Inc.
5
6 % Author: Stephen Gildea <gildea@stop.mail-abuse.org>
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
23
24 % This file is intended to be processed by plain TeX (TeX82).
25 %
26 % The final reference card has six columns, three on each side.
27 % This file can be used to produce it in any of three ways:
28 % 1 column per page
29 % produces six separate pages, each of which needs to be reduced to 80%.
30 % This gives the best resolution.
31 % 2 columns per page
32 % produces three already-reduced pages.
33 % You will still need to cut and paste.
34 % 3 columns per page
35 % produces two pages which must be printed sideways to make a
36 % ready-to-use 8.5 x 11 inch reference card.
37 % For this you need a dvi device driver that can print sideways.
38 % Which mode to use is controlled by setting \columnsperpage.
39 %
40 % To compile and print this document:
41 % tex refcard.tex
42 % dvips -t landscape refcard.dvi
43 %
44 % Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik
45 % for their many good ideas.
46
47 %**start of header
48 \newcount\columnsperpage
49 \newcount\letterpaper
50
51 % This file can be printed with 1, 2, or 3 columns per page.
52 % Specify how many you want here.
53 \columnsperpage=3
54
55 % Set letterpaper to 0 for A4 paper, 1 for letter (US) paper. Useful
56 % only when columnsperpage is 2 or 3.
57 \letterpaper=1
58
59 % PDF output layout. 0 for A4, 1 for letter (US), a `l' is added for
60 % a landscape layout.
61 \input pdflayout.sty
62 \pdflayout=(1l)
63
64 % Nothing else needs to be changed below this line.
65
66 \input emacsver.tex
67
68 \def\shortcopyrightnotice{\vskip 1ex plus 2 fill
69 \centerline{\small \copyright\ \year\ Free Software Foundation, Inc.
70 Permissions on back.}}
71
72 \def\copyrightnotice{
73 \vskip 1ex plus 2 fill\begingroup\small
74 \centerline{Copyright \copyright\ \year\ Free Software Foundation, Inc.}
75 \centerline{For GNU Emacs version \versionemacs}
76 \centerline{Designed by Stephen Gildea}
77
78 Permission is granted to make and distribute modified or unmodified
79 copies of this card provided the copyright notice and this permission
80 notice are preserved on all copies.
81
82 For copies of the GNU Emacs manual, see:
83
84 {\tt http://www.gnu.org/software/emacs/\#Manuals}
85 \endgroup}
86
87 % make \bye not \outer so that the \def\bye in the \else clause below
88 % can be scanned without complaint.
89 \def\bye{\par\vfill\supereject\end}
90
91 \newdimen\intercolumnskip %horizontal space between columns
92 \newbox\columna %boxes to hold columns already built
93 \newbox\columnb
94
95 \def\ncolumns{\the\columnsperpage}
96
97 \message{[\ncolumns\space
98 column\if 1\ncolumns\else s\fi\space per page]}
99
100 \def\scaledmag#1{ scaled \magstep #1}
101
102 % This multi-way format was designed by Stephen Gildea October 1986.
103 % Note that the 1-column format is fontfamily-independent.
104 \if 1\ncolumns %one-column format uses normal size
105 \hsize 4in
106 \vsize 10in
107 \voffset -.7in
108 \font\titlefont=\fontname\tenbf \scaledmag3
109 \font\headingfont=\fontname\tenbf \scaledmag2
110 \font\smallfont=\fontname\sevenrm
111 \font\smallsy=\fontname\sevensy
112
113 \footline{\hss\folio}
114 \def\makefootline{\baselineskip10pt\hsize6.5in\line{\the\footline}}
115 \else %2 or 3 columns uses prereduced size
116 \hsize 3.2in
117 \if 1\the\letterpaper
118 \vsize 7.95in
119 \else
120 \vsize 7.65in
121 \fi
122 \hoffset -.75in
123 \voffset -.745in
124 \font\titlefont=cmbx10 \scaledmag2
125 \font\headingfont=cmbx10 \scaledmag1
126 \font\smallfont=cmr6
127 \font\smallsy=cmsy6
128 \font\eightrm=cmr8
129 \font\eightbf=cmbx8
130 \font\eightit=cmti8
131 \font\eighttt=cmtt8
132 \font\eightmi=cmmi8
133 \font\eightsy=cmsy8
134 \textfont0=\eightrm
135 \textfont1=\eightmi
136 \textfont2=\eightsy
137 \def\rm{\eightrm}
138 \def\bf{\eightbf}
139 \def\it{\eightit}
140 \def\tt{\eighttt}
141 \if 1\the\letterpaper
142 \normalbaselineskip=.8\normalbaselineskip
143 \else
144 \normalbaselineskip=.7\normalbaselineskip
145 \fi
146 \normallineskip=.8\normallineskip
147 \normallineskiplimit=.8\normallineskiplimit
148 \normalbaselines\rm %make definitions take effect
149
150 \if 2\ncolumns
151 \let\maxcolumn=b
152 \footline{\hss\rm\folio\hss}
153 \def\makefootline{\vskip 2in \hsize=6.86in\line{\the\footline}}
154 \else \if 3\ncolumns
155 \let\maxcolumn=c
156 \nopagenumbers
157 \else
158 \errhelp{You must set \columnsperpage equal to 1, 2, or 3.}
159 \errmessage{Illegal number of columns per page}
160 \fi\fi
161
162 \intercolumnskip=.46in
163 \def\abc{a}
164 \output={% %see The TeXbook page 257
165 % This next line is useful when designing the layout.
166 %\immediate\write16{Column \folio\abc\space starts with \firstmark}
167 \if \maxcolumn\abc \multicolumnformat \global\def\abc{a}
168 \else\if a\abc
169 \global\setbox\columna\columnbox \global\def\abc{b}
170 %% in case we never use \columnb (two-column mode)
171 \global\setbox\columnb\hbox to -\intercolumnskip{}
172 \else
173 \global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi}
174 \def\multicolumnformat{\shipout\vbox{\makeheadline
175 \hbox{\box\columna\hskip\intercolumnskip
176 \box\columnb\hskip\intercolumnskip\columnbox}
177 \makefootline}\advancepageno}
178 \def\columnbox{\leftline{\pagebody}}
179
180 \def\bye{\par\vfill\supereject
181 \if a\abc \else\null\vfill\eject\fi
182 \if a\abc \else\null\vfill\eject\fi
183 \end}
184 \fi
185
186 % we won't be using math mode much, so redefine some of the characters
187 % we might want to talk about
188 \catcode`\^=12
189 \catcode`\_=12
190
191 \chardef\\=`\\
192 \chardef\{=`\{
193 \chardef\}=`\}
194
195 \hyphenation{mini-buf-fer}
196
197 \parindent 0pt
198 \parskip 1ex plus .5ex minus .5ex
199
200 \def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip}
201
202 % newcolumn - force a new column. Use sparingly, probably only for
203 % the first column of a page, which should have a title anyway.
204 \outer\def\newcolumn{\vfill\eject}
205
206 % title - page title. Argument is title text.
207 \outer\def\title#1{{\titlefont\centerline{#1}}\vskip 1ex plus .5ex}
208
209 % section - new major section. Argument is section name.
210 \outer\def\section#1{\par\filbreak
211 \vskip 3ex plus 2ex minus 2ex {\headingfont #1}\mark{#1}%
212 \vskip 2ex plus 1ex minus 1.5ex}
213
214 \newdimen\keyindent
215
216 % beginindentedkeys...endindentedkeys - key definitions will be
217 % indented, but running text, typically used as headings to group
218 % definitions, will not.
219 \def\beginindentedkeys{\keyindent=1em}
220 \def\endindentedkeys{\keyindent=0em}
221 \endindentedkeys
222
223 % paralign - begin paragraph containing an alignment.
224 % If an \halign is entered while in vertical mode, a parskip is never
225 % inserted. Using \paralign instead of \halign solves this problem.
226 \def\paralign{\vskip\parskip\halign}
227
228 % \<...> - surrounds a variable name in a code example
229 \def\<#1>{{\it #1\/}}
230
231 % kbd - argument is characters typed literally. Like the Texinfo command.
232 \def\kbd#1{{\tt#1}\null} %\null so not an abbrev even if period follows
233
234 % beginexample...endexample - surrounds literal text, such a code example.
235 % typeset in a typewriter font with line breaks preserved
236 \def\beginexample{\par\leavevmode\begingroup
237 \obeylines\obeyspaces\parskip0pt\tt}
238 {\obeyspaces\global\let =\ }
239 \def\endexample{\endgroup}
240
241 % key - definition of a key.
242 % \key{description of key}{key-name}
243 % prints the description left-justified, and the key-name in a \kbd
244 % form near the right margin.
245 \def\key#1#2{\leavevmode\hbox to \hsize{\vtop
246 {\hsize=.75\hsize\rightskip=1em
247 \hskip\keyindent\relax#1}\kbd{#2}\hfil}}
248
249 \newbox\metaxbox
250 \setbox\metaxbox\hbox{\kbd{M-x }}
251 \newdimen\metaxwidth
252 \metaxwidth=\wd\metaxbox
253
254 % metax - definition of a M-x command.
255 % \metax{description of command}{M-x command-name}
256 % Tries to justify the beginning of the command name at the same place
257 % as \key starts the key name. (The "M-x " sticks out to the left.)
258 \def\metax#1#2{\leavevmode\hbox to \hsize{\hbox to .75\hsize
259 {\hskip\keyindent\relax#1\hfil}%
260 \hskip -\metaxwidth minus 1fil
261 \kbd{#2}\hfil}}
262
263 % threecol - like "key" but with two key names.
264 % for example, one for doing the action backward, and one for forward.
265 \def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&\kbd{#2}\hfil\quad
266 &\kbd{#3}\hfil\quad\cr}
267
268 %**end of header
269 \f
270
271 \title{GNU Emacs Reference Card}
272
273 \centerline{(for version \versionemacs)}
274
275 \section{Starting Emacs}
276
277 To enter GNU Emacs \versionemacs, just type its name: \kbd{emacs}
278
279 \section{Leaving Emacs}
280
281 \key{suspend Emacs (or iconify it under X)}{C-z}
282 \key{exit Emacs permanently}{C-x C-c}
283
284 \section{Files}
285
286 \key{{\bf read} a file into Emacs}{C-x C-f}
287 \key{{\bf save} a file back to disk}{C-x C-s}
288 \key{save {\bf all} files}{C-x s}
289 \key{{\bf insert} contents of another file into this buffer}{C-x i}
290 \key{replace this file with the file you really want}{C-x C-v}
291 \key{write buffer to a specified file}{C-x C-w}
292 \key{toggle read-only status of buffer}{C-x C-q}
293
294 \section{Getting Help}
295
296 The help system is simple. Type \kbd{C-h} (or \kbd{F1}) and follow
297 the directions. If you are a first-time user, type \kbd{C-h t} for a
298 {\bf tutorial}.
299
300 \key{remove help window}{C-x 1}
301 \key{scroll help window}{C-M-v}
302
303 \key{apropos: show commands matching a string}{C-h a}
304 \key{describe the function a key runs}{C-h k}
305 \key{describe a function}{C-h f}
306 \key{get mode-specific information}{C-h m}
307
308 \section{Error Recovery}
309
310 \key{{\bf abort} partially typed or executing command}{C-g}
311 \metax{{\bf recover} files lost by a system crash}{M-x recover-session}
312 \metax{{\bf undo} an unwanted change}{C-x u, C-_ {\rm or} C-/}
313 \metax{restore a buffer to its original contents}{M-x revert-buffer}
314 \key{redraw garbaged screen}{C-l}
315
316 \section{Incremental Search}
317
318 \key{search forward}{C-s}
319 \key{search backward}{C-r}
320 \key{regular expression search}{C-M-s}
321 \key{reverse regular expression search}{C-M-r}
322
323 \key{select previous search string}{M-p}
324 \key{select next later search string}{M-n}
325 \key{exit incremental search}{RET}
326 \key{undo effect of last character}{DEL}
327 \key{abort current search}{C-g}
328
329 Use \kbd{C-s} or \kbd{C-r} again to repeat the search in either direction.
330 If Emacs is still searching, \kbd{C-g} cancels only the part not matched.
331
332 \shortcopyrightnotice
333
334 \newcolumn
335 \section{Motion}
336
337 \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr
338 \threecol{{\bf entity to move over}}{{\bf backward}}{{\bf forward}}
339 \threecol{character}{C-b}{C-f}
340 \threecol{word}{M-b}{M-f}
341 \threecol{line}{C-p}{C-n}
342 \threecol{go to line beginning (or end)}{C-a}{C-e}
343 \threecol{sentence}{M-a}{M-e}
344 \threecol{paragraph}{M-\{}{M-\}}
345 \threecol{page}{C-x [}{C-x ]}
346 \threecol{sexp}{C-M-b}{C-M-f}
347 \threecol{function}{C-M-a}{C-M-e}
348 \threecol{go to buffer beginning (or end)}{M-<}{M->}
349 }
350
351 \key{scroll to next screen}{C-v}
352 \key{scroll to previous screen}{M-v}
353 \key{scroll left}{C-x <}
354 \key{scroll right}{C-x >}
355 \key{scroll current line to center, top, bottom}{C-l}
356
357 \key{goto line}{M-g g}
358 \key{back to indentation}{M-m}
359
360 \section{Killing and Deleting}
361
362 \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr
363 \threecol{{\bf entity to kill}}{{\bf backward}}{{\bf forward}}
364 \threecol{character (delete, not kill)}{DEL}{C-d}
365 \threecol{word}{M-DEL}{M-d}
366 \threecol{line (to end of)}{M-0 C-k}{C-k}
367 \threecol{sentence}{C-x DEL}{M-k}
368 \threecol{sexp}{M-- C-M-k}{C-M-k}
369 }
370
371 \key{kill {\bf region}}{C-w}
372 \key{copy region to kill ring}{M-w}
373 \key{kill through next occurrence of {\it char}}{M-z {\it char}}
374
375 \key{yank back last thing killed}{C-y}
376 \key{replace last yank with previous kill}{M-y}
377
378 \section{Marking}
379
380 \key{set mark here}{C-@ {\rm or} C-SPC}
381 \key{exchange point and mark}{C-x C-x}
382
383 \key{set mark {\it arg\/} {\bf words} away}{M-@}
384 \key{mark {\bf paragraph}}{M-h}
385 \key{mark {\bf page}}{C-x C-p}
386 \key{mark {\bf sexp}}{C-M-@}
387 \key{mark {\bf function}}{C-M-h}
388 \key{mark entire {\bf buffer}}{C-x h}
389
390 \section{Query Replace}
391
392 \key{interactively replace a text string}{M-\%}
393 % query-replace-regexp is bound to C-M-% but that can't be typed on
394 % consoles.
395 \metax{using regular expressions}{M-x query-replace-regexp}
396
397 Valid responses in query-replace mode are
398
399 \key{{\bf replace} this one, go on to next}{SPC {\rm or} y}
400 \key{replace this one, don't move}{,}
401 \key{{\bf skip} to next without replacing}{DEL {\rm or} n}
402 \key{replace all remaining matches}{!}
403 \key{{\bf back up} to the previous match}{^}
404 \key{{\bf exit} query-replace}{RET}
405 \key{enter recursive edit (\kbd{C-M-c} to exit)}{C-r}
406
407 \newcolumn
408 \section{Multiple Windows}
409
410 When two commands are shown, the second is a similar command for a
411 frame instead of a window.
412
413 {\setbox0=\hbox{\kbd{0}}\advance\hsize by 0\wd0
414 \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr
415 \threecol{delete all other windows}{C-x 1\ \ \ \ }{C-x 5 1}
416 \threecol{split window, above and below}{C-x 2\ \ \ \ }{C-x 5 2}
417 \threecol{delete this window}{C-x 0\ \ \ \ }{C-x 5 0}
418 }}
419 \key{split window, side by side}{C-x 3}
420
421 \key{scroll other window}{C-M-v}
422
423 {\setbox0=\hbox{\kbd{0}}\advance\hsize by 2\wd0
424 \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr
425 \threecol{switch cursor to another window}{C-x o}{C-x 5 o}
426
427 \threecol{select buffer in other window}{C-x 4 b}{C-x 5 b}
428 \threecol{display buffer in other window}{C-x 4 C-o}{C-x 5 C-o}
429 \threecol{find file in other window}{C-x 4 f}{C-x 5 f}
430 \threecol{find file read-only in other window}{C-x 4 r}{C-x 5 r}
431 \threecol{run Dired in other window}{C-x 4 d}{C-x 5 d}
432 \threecol{find tag in other window}{C-x 4 .}{C-x 5 .}
433 }}
434
435 \key{grow window taller}{C-x ^}
436 \key{shrink window narrower}{C-x \{}
437 \key{grow window wider}{C-x \}}
438
439 \section{Formatting}
440
441 \key{indent current {\bf line} (mode-dependent)}{TAB}
442 \key{indent {\bf region} (mode-dependent)}{C-M-\\}
443 \key{indent {\bf sexp} (mode-dependent)}{C-M-q}
444 \key{indent region rigidly {\it arg\/} columns}{C-x TAB}
445 \key{indent for comment}{M-;}
446
447 \key{insert newline after point}{C-o}
448 \key{move rest of line vertically down}{C-M-o}
449 \key{delete blank lines around point}{C-x C-o}
450 \key{join line with previous (with arg, next)}{M-^}
451 \key{delete all white space around point}{M-\\}
452 \key{put exactly one space at point}{M-SPC}
453
454 \key{fill paragraph}{M-q}
455 \key{set fill column to {\it arg}}{C-x f}
456 \key{set prefix each line starts with}{C-x .}
457
458 \key{set face}{M-o}
459
460 \section{Case Change}
461
462 \key{uppercase word}{M-u}
463 \key{lowercase word}{M-l}
464 \key{capitalize word}{M-c}
465
466 \key{uppercase region}{C-x C-u}
467 \key{lowercase region}{C-x C-l}
468
469 \section{The Minibuffer}
470
471 The following keys are defined in the minibuffer.
472
473 \key{complete as much as possible}{TAB}
474 \key{complete up to one word}{SPC}
475 \key{complete and execute}{RET}
476 \key{show possible completions}{?}
477 \key{fetch previous minibuffer input}{M-p}
478 \key{fetch later minibuffer input or default}{M-n}
479 \key{regexp search backward through history}{M-r}
480 \key{regexp search forward through history}{M-s}
481 \key{abort command}{C-g}
482
483 Type \kbd{C-x ESC ESC} to edit and repeat the last command that used the
484 minibuffer. Type \kbd{F10} to activate menu bar items on text terminals.
485
486 \newcolumn
487 \title{GNU Emacs Reference Card}
488
489 \section{Buffers}
490
491 \key{select another buffer}{C-x b}
492 \key{list all buffers}{C-x C-b}
493 \key{kill a buffer}{C-x k}
494
495 \section{Transposing}
496
497 \key{transpose {\bf characters}}{C-t}
498 \key{transpose {\bf words}}{M-t}
499 \key{transpose {\bf lines}}{C-x C-t}
500 \key{transpose {\bf sexps}}{C-M-t}
501
502 \section{Spelling Check}
503
504 \key{check spelling of current word}{M-\$}
505 \metax{check spelling of all words in region}{M-x ispell-region}
506 \metax{check spelling of entire buffer}{M-x ispell-buffer}
507
508 \section{Tags}
509
510 \key{find a tag (a definition)}{M-.}
511 \key{find next occurrence of tag}{C-u M-.}
512 \metax{specify a new tags file}{M-x visit-tags-table}
513
514 \metax{regexp search on all files in tags table}{M-x tags-search}
515 \metax{run query-replace on all the files}{M-x tags-query-replace}
516 \key{continue last tags search or query-replace}{M-,}
517
518 \section{Shells}
519
520 \key{execute a shell command}{M-!}
521 \key{run a shell command on the region}{M-|}
522 \key{filter region through a shell command}{C-u M-|}
523 \key{start a shell in window \kbd{*shell*}}{M-x shell}
524
525 \section{Rectangles}
526
527 \key{copy rectangle to register}{C-x r r}
528 \key{kill rectangle}{C-x r k}
529 \key{yank rectangle}{C-x r y}
530 \key{open rectangle, shifting text right}{C-x r o}
531 \key{blank out rectangle}{C-x r c}
532 \key{prefix each line with a string}{C-x r t}
533
534 \section{Abbrevs}
535
536 \key{add global abbrev}{C-x a g}
537 \key{add mode-local abbrev}{C-x a l}
538 \key{add global expansion for this abbrev}{C-x a i g}
539 \key{add mode-local expansion for this abbrev}{C-x a i l}
540 \key{explicitly expand abbrev}{C-x a e}
541
542 \key{expand previous word dynamically}{M-/}
543
544 \section{Miscellaneous}
545
546 \key{numeric argument}{C-u {\it num}}
547 \key{negative argument}{M--}
548 \key{quoted insert}{C-q {\it char}}
549
550 \newcolumn
551 \section{Regular Expressions}
552
553 \key{any single character except a newline}{. {\rm(dot)}}
554 \key{zero or more repeats}{*}
555 \key{one or more repeats}{+}
556 \key{zero or one repeat}{?}
557 \key{quote regular expression special character {\it c\/}}{\\{\it c}}
558 \key{alternative (``or'')}{\\|}
559 \key{grouping}{\\( {\rm$\ldots$} \\)}
560 \key{same text as {\it n\/}th group}{\\{\it n}}
561 \key{at word break}{\\b}
562 \key{not at word break}{\\B}
563
564 \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr
565 \threecol{{\bf entity}}{{\bf match start}}{{\bf match end}}
566 \threecol{line}{^}{\$}
567 \threecol{word}{\\<}{\\>}
568 \threecol{buffer}{\\`}{\\'}
569
570 \threecol{{\bf class of characters}}{{\bf match these}}{{\bf match others}}
571 \threecol{explicit set}{[ {\rm$\ldots$} ]}{[^ {\rm$\ldots$} ]}
572 \threecol{word-syntax character}{\\w}{\\W}
573 \threecol{character with syntax {\it c}}{\\s{\it c}}{\\S{\it c}}
574 }
575
576 \section{International Character Sets}
577
578 \key{specify principal language}{C-x RET l}
579 \metax{show all input methods}{M-x list-input-methods}
580 \key{enable or disable input method}{C-\\}
581 \key{set coding system for next command}{C-x RET c}
582 \metax{show all coding systems}{M-x list-coding-systems}
583 \metax{choose preferred coding system}{M-x prefer-coding-system}
584
585 \section{Info}
586
587 \key{enter the Info documentation reader}{C-h i}
588 \key{find specified function or variable in Info}{C-h S}
589 \beginindentedkeys
590
591 Moving within a node:
592
593 \key{scroll forward}{SPC}
594 \key{scroll reverse}{DEL}
595 \key{beginning of node}{. {\rm (dot)}}
596
597 Moving between nodes:
598
599 \key{{\bf next} node}{n}
600 \key{{\bf previous} node}{p}
601 \key{move {\bf up}}{u}
602 \key{select menu item by name}{m}
603 \key{select {\it n\/}th menu item by number (1--9)}{{\it n}}
604 \key{follow cross reference (return with \kbd{l})}{f}
605 \key{return to last node you saw}{l}
606 \key{return to directory node}{d}
607 \key{go to top node of Info file}{t}
608 \key{go to any node by name}{g}
609
610 Other:
611
612 \key{run Info {\bf tutorial}}{h}
613 \key{look up a subject in the indices}{i}
614 \key{search nodes for regexp}{s}
615 \key{{\bf quit} Info}{q}
616
617 \endindentedkeys
618
619 \newcolumn
620 \section{Registers}
621
622 \key{save region in register}{C-x r s}
623 \key{insert register contents into buffer}{C-x r i}
624
625 \key{save value of point in register}{C-x r SPC}
626 \key{jump to point saved in register}{C-x r j}
627
628 \section{Keyboard Macros}
629
630 \key{{\bf start} defining a keyboard macro}{C-x (}
631 \key{{\bf end} keyboard macro definition}{C-x )}
632 \key{{\bf execute} last-defined keyboard macro}{C-x e}
633 \key{append to last keyboard macro}{C-u C-x (}
634 \metax{name last keyboard macro}{M-x name-last-kbd-macro}
635 \metax{insert Lisp definition in buffer}{M-x insert-kbd-macro}
636
637 \section{Commands Dealing with Emacs Lisp}
638
639 \key{eval {\bf sexp} before point}{C-x C-e}
640 \key{eval current {\bf defun}}{C-M-x}
641 \metax{eval {\bf region}}{M-x eval-region}
642 \key{read and eval minibuffer}{M-:}
643 \metax{load from standard system directory}{M-x load-library}
644
645 \section{Simple Customization}
646
647 \metax{customize variables and faces}{M-x customize}
648
649 % The intended audience here is the person who wants to make simple
650 % customizations and knows Lisp syntax.
651
652 Making global key bindings in Emacs Lisp (example):
653
654 \beginexample%
655 (global-set-key (kbd "C-c g") 'search-forward)
656 (global-set-key (kbd "M-\#") 'query-replace-regexp)
657 \endexample
658
659 \section{Writing Commands}
660
661 \beginexample%
662 (defun \<command-name> (\<args>)
663 "\<documentation>" (interactive "\<template>")
664 \<body>)
665 \endexample
666
667 An example:
668
669 \beginexample%
670 (defun this-line-to-top-of-window (line)
671 "Reposition current line to top of window.
672 With ARG, put point on line ARG."
673 (interactive "P")
674 (recenter (if (null line)
675 0
676 (prefix-numeric-value line))))
677 \endexample
678
679 The \kbd{interactive} spec says how to read arguments interactively.
680 Type \kbd{C-h f interactive} for more details.
681
682 \copyrightnotice
683
684 \bye
685 \f
686 % Local variables:
687 % compile-command: "pdftex refcard"
688 % End:
689