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