refcard.tex 21 KB

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