1 % Reference Card for GNU Emacs
3 % Copyright (C) 1987, 1993, 1996-1997, 2001-2017 Free Software
6 % Author: Stephen Gildea <gildea@stop.mail-abuse.org>
8 % This document is free software: you can redistribute it and/or modify
9 % it under the terms of the GNU General Public License as published by
10 % the Free Software Foundation, either version 3 of the License, or
11 % (at your option) any later version.
13 % As a special additional permission, you may distribute reference cards
14 % printed, or formatted for printing, with the notice "Released under
15 % the terms of the GNU General Public License version 3 or later"
16 % instead of the usual distributed-under-the-GNU-GPL notice, and without
17 % a copy of the GPL itself.
19 % This document is distributed in the hope that it will be useful,
20 % but WITHOUT ANY WARRANTY; without even the implied warranty of
21 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 % GNU General Public License for more details.
24 % You should have received a copy of the GNU General Public License
25 % along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
28 % This file is intended to be processed by plain TeX (TeX82).
30 % The final reference card has six columns, three on each side.
31 % This file can be used to produce it in any of three ways:
33 % produces six separate pages, each of which needs to be reduced to 80%.
34 % This gives the best resolution.
36 % produces three already-reduced pages.
37 % You will still need to cut and paste.
39 % produces two pages which must be printed sideways to make a
40 % ready-to-use 8.5 x 11 inch reference card.
41 % For this you need a dvi device driver that can print sideways.
42 % Which mode to use is controlled by setting \columnsperpage.
44 % To compile and print this document:
46 % dvips -t landscape refcard.dvi
48 % Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik
49 % for their many good ideas.
52 \newcount\columnsperpage
55 % This file can be printed with 1, 2, or 3 columns per page.
56 % Specify how many you want here.
59 % Set letterpaper to 0 for A4 paper, 1 for letter (US) paper. Useful
60 % only when columnsperpage is 2 or 3.
63 % PDF output layout. 0 for A4, 1 for letter (US), a `l' is added for
68 % Nothing else needs to be changed below this line.
72 \def\shortcopyrightnotice{\vskip 1ex plus
2 fill
73 \centerline{\small \copyright\
\year\ Free Software Foundation, Inc.
74 Permissions on back.
}}
77 \vskip 1ex plus
2 fill
\begingroup\small
78 \centerline{Copyright
\copyright\
\year\ Free Software Foundation, Inc.
}
79 \centerline{For GNU Emacs version
\versionemacs}
80 \centerline{Designed by Stephen Gildea
}
82 Released under the terms of the GNU General Public License version
3 or later.
84 For more Emacs documentation, and the
\TeX{} source for this card,
85 see the Emacs distribution, or
{\tt http://www.gnu.org/software/emacs
}
88 % make \bye not \outer so that the \def\bye in the \else clause below
89 % can be scanned without complaint.
90 \def\bye{\par\vfill\supereject\end}
92 \newdimen\intercolumnskip %horizontal space between columns
93 \newbox\columna %boxes to hold columns already built
96 \def\ncolumns{\the\columnsperpage}
98 \message{[\ncolumns\space
99 column
\if 1\ncolumns\else s
\fi\space per page
]}
101 \def\scaledmag#1{ scaled
\magstep #1}
103 % This multi-way format was designed by Stephen Gildea October 1986.
104 % Note that the 1-column format is fontfamily-independent.
105 \if 1\ncolumns %one-column format uses normal size
109 \font\titlefont=
\fontname\tenbf \scaledmag3
110 \font\headingfont=
\fontname\tenbf \scaledmag2
111 \font\smallfont=
\fontname\sevenrm
112 \font\smallsy=
\fontname\sevensy
114 \footline{\hss\folio}
115 \def\makefootline{\baselineskip10pt\hsize6.5in
\line{\the\footline}}
116 \else %2 or 3 columns uses prereduced size
118 \if 1\the\letterpaper
125 \font\titlefont=cmbx10
\scaledmag2
126 \font\headingfont=cmbx10
\scaledmag1
142 \if 1\the\letterpaper
143 \normalbaselineskip=
.8\normalbaselineskip
145 \normalbaselineskip=
.7\normalbaselineskip
147 \normallineskip=
.8\normallineskip
148 \normallineskiplimit=
.8\normallineskiplimit
149 \normalbaselines\rm %make definitions take effect
153 \footline{\hss\rm\folio\hss}
154 \def\makefootline{\vskip 2in
\hsize=
6.86in
\line{\the\footline}}
159 \errhelp{You must set
\columnsperpage equal to
1,
2, or
3.
}
160 \errmessage{Illegal number of columns per page
}
163 \intercolumnskip=
.46in
165 \output=
{% %see The TeXbook page 257
166 % This next line is useful when designing the layout.
167 %\immediate\write16{Column \folio\abc\space starts with \firstmark}
168 \if \maxcolumn\abc \multicolumnformat \global\def\abc{a
}
170 \global\setbox\columna\columnbox \global\def\abc{b
}
171 %% in case we never use \columnb (two-column mode)
172 \global\setbox\columnb\hbox to -
\intercolumnskip{}
174 \global\setbox\columnb\columnbox \global\def\abc{c
}\fi\fi}
175 \def\multicolumnformat{\shipout\vbox{\makeheadline
176 \hbox{\box\columna\hskip\intercolumnskip
177 \box\columnb\hskip\intercolumnskip\columnbox}
178 \makefootline}\advancepageno}
179 \def\columnbox{\leftline{\pagebody}}
181 \def\bye{\par\vfill\supereject
182 \if a
\abc \else\null\vfill\eject\fi
183 \if a
\abc \else\null\vfill\eject\fi
187 % we won't be using math mode much, so redefine some of the characters
188 % we might want to talk about
196 \hyphenation{mini-buf-fer
}
199 \parskip 1ex plus
.5ex minus
.5ex
201 \def\small{\smallfont\textfont2=
\smallsy\baselineskip=
.8\baselineskip}
203 % newcolumn - force a new column. Use sparingly, probably only for
204 % the first column of a page, which should have a title anyway.
205 \outer\def\newcolumn{\vfill\eject}
207 % title - page title. Argument is title text.
208 \outer\def\title#1{{\titlefont\centerline{#1}}\vskip 1ex plus
.5ex
}
210 % section - new major section. Argument is section name.
211 \outer\def\section#1{\par\filbreak
212 \vskip 3ex plus
2ex minus
2ex
{\headingfont #1}\mark{#1}%
213 \vskip 2ex plus
1ex minus
1.5ex
}
217 % beginindentedkeys...endindentedkeys - key definitions will be
218 % indented, but running text, typically used as headings to group
219 % definitions, will not.
220 \def\beginindentedkeys{\keyindent=
1em
}
221 \def\endindentedkeys{\keyindent=
0em
}
224 % paralign - begin paragraph containing an alignment.
225 % If an \halign is entered while in vertical mode, a parskip is never
226 % inserted. Using \paralign instead of \halign solves this problem.
227 \def\paralign{\vskip\parskip\halign}
229 % \<...> - surrounds a variable name in a code example
230 \def\<
#1>
{{\it #1\/
}}
232 % kbd - argument is characters typed literally. Like the Texinfo command.
233 \def\kbd#1{{\tt#1}\null} %\null so not an abbrev even if period follows
235 % beginexample...endexample - surrounds literal text, such a code example.
236 % typeset in a typewriter font with line breaks preserved
237 \def\beginexample{\par\leavevmode\begingroup
238 \obeylines\obeyspaces\parskip0pt\tt}
239 {\obeyspaces\global\let =\
}
240 \def\endexample{\endgroup}
242 % key - definition of a key.
243 % \key{description of key}{key-name}
244 % prints the description left-justified, and the key-name in a \kbd
245 % form near the right margin.
246 \def\key#1#2{\leavevmode\hbox to
\hsize{\vtop
247 {\hsize=
.75\hsize\rightskip=
1em
248 \hskip\keyindent\relax#1}\kbd{#2}\hfil}}
251 \setbox\metaxbox\hbox{\kbd{M-x
}}
253 \metaxwidth=
\wd\metaxbox
255 % metax - definition of a M-x command.
256 % \metax{description of command}{M-x command-name}
257 % Tries to justify the beginning of the command name at the same place
258 % as \key starts the key name. (The "M-x " sticks out to the left.)
259 \def\metax#1#2{\leavevmode\hbox to
\hsize{\hbox to
.75\hsize
260 {\hskip\keyindent\relax#1\hfil}%
261 \hskip -
\metaxwidth minus
1fil
264 % threecol - like "key" but with two key names.
265 % for example, one for doing the action backward, and one for forward.
266 \def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&
\kbd{#2}\hfil\quad
267 &
\kbd{#3}\hfil\quad\cr}
272 \title{GNU Emacs Reference Card
}
274 \centerline{(for version
\versionemacs)
}
276 \section{Starting Emacs
}
278 To enter GNU Emacs
\versionemacs, just type its name:
\kbd{emacs
}
280 \section{Leaving Emacs
}
282 \key{suspend Emacs (or iconify it under X)
}{C-z
}
283 \key{exit Emacs permanently
}{C-x C-c
}
287 \key{{\bf read
} a file into Emacs
}{C-x C-f
}
288 \key{{\bf save
} a file back to disk
}{C-x C-s
}
289 \key{save
{\bf all
} files
}{C-x s
}
290 \key{{\bf insert
} contents of another file into this buffer
}{C-x i
}
291 \key{replace this file with the file you really want
}{C-x C-v
}
292 \key{write buffer to a specified file
}{C-x C-w
}
293 \key{toggle read-only status of buffer
}{C-x C-q
}
295 \section{Getting Help
}
297 The help system is simple. Type
\kbd{C-h
} (or
\kbd{F1
}) and follow
298 the directions. If you are a first-time user, type
\kbd{C-h t
} for a
301 \key{remove help window
}{C-x
1}
302 \key{scroll help window
}{C-M-v
}
304 \key{apropos: show commands matching a string
}{C-h a
}
305 \key{describe the function a key runs
}{C-h k
}
306 \key{describe a function
}{C-h f
}
307 \key{get mode-specific information
}{C-h m
}
309 \section{Error Recovery
}
311 \key{{\bf abort
} partially typed or executing command
}{C-g
}
312 \metax{{\bf recover
} files lost by a system crash
}{M-x recover-session
}
313 \metax{{\bf undo
} an unwanted change
}{C-x u, C-_
{\rm or
} C-/
}
314 \metax{restore a buffer to its original contents
}{M-x revert-buffer
}
315 \key{redraw garbaged screen
}{C-l
}
317 \section{Incremental Search
}
319 \key{search forward
}{C-s
}
320 \key{search backward
}{C-r
}
321 \key{regular expression search
}{C-M-s
}
322 \key{reverse regular expression search
}{C-M-r
}
324 \key{select previous search string
}{M-p
}
325 \key{select next later search string
}{M-n
}
326 \key{exit incremental search
}{RET
}
327 \key{undo effect of last character
}{DEL
}
328 \key{abort current search
}{C-g
}
330 Use
\kbd{C-s
} or
\kbd{C-r
} again to repeat the search in either direction.
331 If Emacs is still searching,
\kbd{C-g
} cancels only the part not matched.
333 \shortcopyrightnotice
338 \paralign to
\hsize{#
\tabskip=
10pt plus
1 fil&#
\tabskip=
0pt&#
\cr
339 \threecol{{\bf entity to move over
}}{{\bf backward
}}{{\bf forward
}}
340 \threecol{character
}{C-b
}{C-f
}
341 \threecol{word
}{M-b
}{M-f
}
342 \threecol{line
}{C-p
}{C-n
}
343 \threecol{go to line beginning (or end)
}{C-a
}{C-e
}
344 \threecol{sentence
}{M-a
}{M-e
}
345 \threecol{paragraph
}{M-\
{}{M-\
}}
346 \threecol{page
}{C-x
[}{C-x
]}
347 \threecol{sexp
}{C-M-b
}{C-M-f
}
348 \threecol{function
}{C-M-a
}{C-M-e
}
349 \threecol{go to buffer beginning (or end)
}{M-<
}{M->
}
352 \key{scroll to next screen
}{C-v
}
353 \key{scroll to previous screen
}{M-v
}
354 \key{scroll left
}{C-x <
}
355 \key{scroll right
}{C-x >
}
356 \key{scroll current line to center, top, bottom
}{C-l
}
358 \key{goto line
}{M-g g
}
359 \key{goto char
}{M-g c
}
360 \key{back to indentation
}{M-m
}
362 \section{Killing and Deleting
}
364 \paralign to
\hsize{#
\tabskip=
10pt plus
1 fil&#
\tabskip=
0pt&#
\cr
365 \threecol{{\bf entity to kill
}}{{\bf backward
}}{{\bf forward
}}
366 \threecol{character (delete, not kill)
}{DEL
}{C-d
}
367 \threecol{word
}{M-DEL
}{M-d
}
368 \threecol{line (to end of)
}{M-
0 C-k
}{C-k
}
369 \threecol{sentence
}{C-x DEL
}{M-k
}
370 \threecol{sexp
}{M-- C-M-k
}{C-M-k
}
373 \key{kill
{\bf region
}}{C-w
}
374 \key{copy region to kill ring
}{M-w
}
375 \key{kill through next occurrence of
{\it char
}}{M-z
{\it char
}}
377 \key{yank back last thing killed
}{C-y
}
378 \key{replace last yank with previous kill
}{M-y
}
382 \key{set mark here
}{C-@
{\rm or
} C-SPC
}
383 \key{exchange point and mark
}{C-x C-x
}
385 \key{set mark
{\it arg\/
} {\bf words
} away
}{M-@
}
386 \key{mark
{\bf paragraph
}}{M-h
}
387 \key{mark
{\bf page
}}{C-x C-p
}
388 \key{mark
{\bf sexp
}}{C-M-@
}
389 \key{mark
{\bf function
}}{C-M-h
}
390 \key{mark entire
{\bf buffer
}}{C-x h
}
392 \section{Query Replace
}
394 \key{interactively replace a text string
}{M-\%
}
395 % query-replace-regexp is bound to C-M-% but that can't be typed on
397 \metax{using regular expressions
}{M-x query-replace-regexp
}
399 Valid responses in query-replace mode are
401 \key{{\bf replace
} this one, go on to next
}{SPC
{\rm or
} y
}
402 \key{replace this one, don't move
}{,
}
403 \key{{\bf skip
} to next without replacing
}{DEL
{\rm or
} n
}
404 \key{replace all remaining matches
}{!
}
405 \key{{\bf back up
} to the previous match
}{^
}
406 \key{{\bf exit
} query-replace
}{RET
}
407 \key{enter recursive edit (
\kbd{C-M-c
} to exit)
}{C-r
}
410 \section{Multiple Windows
}
412 When two commands are shown, the second is a similar command for a
413 frame instead of a window.
415 {\setbox0=
\hbox{\kbd{0}}\advance\hsize by
0\wd0
416 \paralign to
\hsize{#
\tabskip=
10pt plus
1 fil&#
\tabskip=
0pt&#
\cr
417 \threecol{delete all other windows
}{C-x
1\ \ \ \
}{C-x
5 1}
418 \threecol{split window, above and below
}{C-x
2\ \ \ \
}{C-x
5 2}
419 \threecol{delete this window
}{C-x
0\ \ \ \
}{C-x
5 0}
421 \key{split window, side by side
}{C-x
3}
423 \key{scroll other window
}{C-M-v
}
425 {\setbox0=
\hbox{\kbd{0}}\advance\hsize by
2\wd0
426 \paralign to
\hsize{#
\tabskip=
10pt plus
1 fil&#
\tabskip=
0pt&#
\cr
427 \threecol{switch cursor to another window
}{C-x o
}{C-x
5 o
}
429 \threecol{select buffer in other window
}{C-x
4 b
}{C-x
5 b
}
430 \threecol{display buffer in other window
}{C-x
4 C-o
}{C-x
5 C-o
}
431 \threecol{find file in other window
}{C-x
4 f
}{C-x
5 f
}
432 \threecol{find file read-only in other window
}{C-x
4 r
}{C-x
5 r
}
433 \threecol{run Dired in other window
}{C-x
4 d
}{C-x
5 d
}
434 \threecol{find tag in other window
}{C-x
4 .
}{C-x
5 .
}
437 \key{grow window taller
}{C-x ^
}
438 \key{shrink window narrower
}{C-x \
{}
439 \key{grow window wider
}{C-x \
}}
443 \key{indent current
{\bf line
} (mode-dependent)
}{TAB
}
444 \key{indent
{\bf region
} (mode-dependent)
}{C-M-\\
}
445 \key{indent
{\bf sexp
} (mode-dependent)
}{C-M-q
}
446 \key{indent region rigidly
{\it arg\/
} columns
}{C-x TAB
}
447 \key{indent for comment
}{M-;
}
449 \key{insert newline after point
}{C-o
}
450 \key{move rest of line vertically down
}{C-M-o
}
451 \key{delete blank lines around point
}{C-x C-o
}
452 \key{join line with previous (with arg, next)
}{M-^
}
453 \key{delete all white space around point
}{M-\\
}
454 \key{put exactly one space at point
}{M-SPC
}
456 \key{fill paragraph
}{M-q
}
457 \key{set fill column to
{\it arg
}}{C-x f
}
458 \key{set prefix each line starts with
}{C-x .
}
462 \section{Case Change
}
464 \key{uppercase word
}{M-u
}
465 \key{lowercase word
}{M-l
}
466 \key{capitalize word
}{M-c
}
468 \key{uppercase region
}{C-x C-u
}
469 \key{lowercase region
}{C-x C-l
}
471 \section{The Minibuffer
}
473 The following keys are defined in the minibuffer.
475 \key{complete as much as possible
}{TAB
}
476 \key{complete up to one word
}{SPC
}
477 \key{complete and execute
}{RET
}
478 \key{show possible completions
}{?
}
479 \key{fetch previous minibuffer input
}{M-p
}
480 \key{fetch later minibuffer input or default
}{M-n
}
481 \key{regexp search backward through history
}{M-r
}
482 \key{regexp search forward through history
}{M-s
}
483 \key{abort command
}{C-g
}
485 Type
\kbd{C-x ESC ESC
} to edit and repeat the last command that used the
486 minibuffer. Type
\kbd{F10
} to activate menu bar items on text terminals.
489 \title{GNU Emacs Reference Card
}
493 \key{select another buffer
}{C-x b
}
494 \key{list all buffers
}{C-x C-b
}
495 \key{kill a buffer
}{C-x k
}
497 \section{Transposing
}
499 \key{transpose
{\bf characters
}}{C-t
}
500 \key{transpose
{\bf words
}}{M-t
}
501 \key{transpose
{\bf lines
}}{C-x C-t
}
502 \key{transpose
{\bf sexps
}}{C-M-t
}
504 \section{Spelling Check
}
506 \key{check spelling of current word
}{M-\$
}
507 \metax{check spelling of all words in region
}{M-x ispell-region
}
508 \metax{check spelling of entire buffer
}{M-x ispell-buffer
}
509 \metax{toggle on-the-fly spell checking
}{M-x flyspell-mode
}
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
}
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-,
}
523 \key{execute a shell command
}{M-!
}
524 \key{execute a shell command asynchronously
}{M-\&
}
525 \key{run a shell command on the region
}{M-|
}
526 \key{filter region through a shell command
}{C-u M-|
}
527 \key{start a shell in window
\kbd{*shell*
}}{M-x shell
}
531 \key{copy rectangle to register
}{C-x r r
}
532 \key{kill rectangle
}{C-x r k
}
533 \key{yank rectangle
}{C-x r y
}
534 \key{open rectangle, shifting text right
}{C-x r o
}
535 \key{blank out rectangle
}{C-x r c
}
536 \key{prefix each line with a string
}{C-x r t
}
540 \key{add global abbrev
}{C-x a g
}
541 \key{add mode-local abbrev
}{C-x a l
}
542 \key{add global expansion for this abbrev
}{C-x a i g
}
543 \key{add mode-local expansion for this abbrev
}{C-x a i l
}
544 \key{explicitly expand abbrev
}{C-x a e
}
546 \key{expand previous word dynamically
}{M-/
}
548 \section{Miscellaneous
}
550 \key{numeric argument
}{C-u
{\it num
}}
551 \key{negative argument
}{M--
}
552 \key{quoted insert
}{C-q
{\it char
}}
555 \section{Regular Expressions
}
557 \key{any single character except a newline
}{.
{\rm(dot)
}}
558 \key{zero or more repeats
}{*
}
559 \key{one or more repeats
}{+
}
560 \key{zero or one repeat
}{?
}
561 \key{quote special characters
}{\\
}
562 \key{quote regular expression special character
{\it c\/
}}{\\
{\it c
}}
563 \key{alternative (``or'')
}{\\|
}
564 \key{grouping
}{\\(
{\rm$
\ldots$
} \\)
}
565 \key{shy grouping
}{\\(:?
{\rm$
\ldots$
} \\)
}
566 \key{explicit numbered grouping
}{\\(:NUM
{\rm$
\ldots$
} \\)
}
567 \key{same text as
{\it n\/
}th group
}{\\
{\it n
}}
568 \key{at word break
}{\
\b}
569 \key{not at word break
}{\
\B}
571 \paralign to
\hsize{#
\tabskip=
10pt plus
1 fil&#
\tabskip=
0pt&#
\cr
572 \threecol{{\bf entity
}}{{\bf match start
}}{{\bf match end
}}
573 \threecol{line
}{^
}{\$
}
574 \threecol{word
}{\\<
}{\\>
}
575 \threecol{symbol
}{\
\_<
}{\
\_>
}
576 \threecol{buffer
}{\\`
}{\\'
}
577 %% FIXME: "`" and "'" isn't displayed correctly in the output PDF file
579 \threecol{{\bf class of characters
}}{{\bf match these
}}{{\bf match others
}}
580 \threecol{explicit set
}{[ {\rm$
\ldots$
} ]}{[^
{\rm$
\ldots$
} ]}
581 \threecol{word-syntax character
}{\
\w}{\
\W}
582 \threecol{character with syntax
{\it c
}}{\
\s{\it c
}}{\
\S{\it c
}}
583 \threecol{character with category
{\it c
}}{\
\c{\it c
}}{\
\C{\it c
}}
586 \section{International Character Sets
}
588 \key{specify principal language
}{C-x RET l
}
589 \metax{show all input methods
}{M-x list-input-methods
}
590 \key{enable or disable input method
}{C-\\
}
591 \key{set coding system for next command
}{C-x RET c
}
592 \metax{show all coding systems
}{M-x list-coding-systems
}
593 \metax{choose preferred coding system
}{M-x prefer-coding-system
}
597 \key{enter the Info documentation reader
}{C-h i
}
598 \key{find specified function or variable in Info
}{C-h S
}
601 Moving within a node:
603 \key{scroll forward
}{SPC
}
604 \key{scroll reverse
}{DEL
}
605 \key{beginning of node
}{b
}
607 Moving between nodes:
609 \key{{\bf next
} node
}{n
}
610 \key{{\bf previous
} node
}{p
}
611 \key{move
{\bf up
}}{u
}
612 \key{select menu item by name
}{m
}
613 \key{select
{\it n\/
}th menu item by number (
1--
9)
}{{\it n
}}
614 \key{follow cross reference (return with
\kbd{l
})
}{f
}
615 \key{return to last node you saw
}{l
}
616 \key{return to directory node
}{d
}
617 \key{go to top node of Info file
}{t
}
618 \key{go to any node by name
}{g
}
622 \key{run Info
{\bf tutorial
}}{h
}
623 \key{look up a subject in the indices
}{i
}
624 \key{search nodes for regexp
}{s
}
625 \key{{\bf quit
} Info
}{q
}
632 \key{save region in register
}{C-x r s
}
633 \key{insert register contents into buffer
}{C-x r i
}
635 \key{save value of point in register
}{C-x r SPC
}
636 \key{jump to point saved in register
}{C-x r j
}
638 \section{Keyboard Macros
}
640 \key{{\bf start
} defining a keyboard macro
}{C-x (
}
641 \key{{\bf end
} keyboard macro definition
}{C-x )
}
642 \key{{\bf execute
} last-defined keyboard macro
}{C-x e
}
643 \key{append to last keyboard macro
}{C-u C-x (
}
644 \metax{name last keyboard macro
}{M-x name-last-kbd-macro
}
645 \metax{insert Lisp definition in buffer
}{M-x insert-kbd-macro
}
647 \section{Commands Dealing with Emacs Lisp
}
649 \key{eval
{\bf sexp
} before point
}{C-x C-e
}
650 \key{eval current
{\bf defun
}}{C-M-x
}
651 \metax{eval
{\bf region
}}{M-x eval-region
}
652 \key{read and eval minibuffer
}{M-:
}
653 \metax{load a Lisp library from
{\bf load-path
}}{M-x load-library
}
655 \section{Simple Customization
}
657 \metax{customize variables and faces
}{M-x customize
}
659 % The intended audience here is the person who wants to make simple
660 % customizations and knows Lisp syntax.
662 Making global key bindings in Emacs Lisp (example):
665 (global-set-key (kbd "C-c g") 'search-forward)
666 (global-set-key (kbd "M-\#") 'query-replace-regexp)
669 \section{Writing Commands
}
672 (defun \<command-name> (\<args>)
673 "\<documentation>" (interactive "\<template>")
680 (defun this-line-to-top-of-window (line)
681 "Reposition current line to top of window.
682 With prefix argument LINE, put point on LINE."
684 (recenter (if (null line)
686 (prefix-numeric-value line))))
689 The
\kbd{interactive
} spec says how to read arguments interactively.
690 Type
\kbd{C-h f interactive RET
} for more details.
697 % compile-command: "pdftex refcard"