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