survival.tex 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. %&tex
  2. % Title: GNU Emacs Survival Card
  3. % Copyright (C) 2000-2012 Free Software Foundation, Inc.
  4. % Author: Wlodek Bzyl <matwb@univ.gda.pl>
  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. %**start of header
  17. % User interface is `plain.tex' and macros described below
  18. %
  19. % \title{CARD TITLE}{for version 23}
  20. % \section{NAME}
  21. % optional paragraphs separated with \askip amount of vertical space
  22. % \key{KEY-NAME} description of key or
  23. % \mkey{M-x LONG-LISP-NAME} description of Elisp function
  24. %
  25. % \kbd{ARG} -- argument is typed literally
  26. \def\plainfmtname{plain}
  27. \ifx\fmtname\plainfmtname
  28. \else
  29. \errmessage{This file requires `plain' format to be typeset correctly}
  30. \endinput
  31. \fi
  32. % PDF output layout. 0 for A4, 1 for letter (US), a `l' is added for
  33. % a landscape layout.
  34. \input pdflayout.sty
  35. \pdflayout=(1)
  36. \def\versionemacs{24} % version of Emacs this is for
  37. \def\year{2012} % latest copyright year
  38. \def\copyrightnotice{\penalty-1\vfill
  39. \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter
  40. Copyright \copyright\ \year\ Free Software Foundation, Inc.\break
  41. For GNU Emacs version \versionemacs\break
  42. Author W{\l}odek Bzyl (matwb@univ.gda.pl)
  43. Permission is granted to make and distribute copies of
  44. this card provided the copyright notice and this permission notice
  45. are preserved on all copies.\par}}
  46. \hsize 3.2in
  47. \vsize 7.95in
  48. \font\titlefont=cmss10 scaled 1200
  49. \font\headingfont=cmss10
  50. \font\smallfont=cmr6
  51. \font\smallsy=cmsy6
  52. \font\eightrm=cmr8
  53. \font\eightbf=cmbx8
  54. \font\eightit=cmti8
  55. \font\eighttt=cmtt8
  56. \font\eightmi=cmmi8
  57. \font\eightsy=cmsy8
  58. \font\eightss=cmss8
  59. \textfont0=\eightrm
  60. \textfont1=\eightmi
  61. \textfont2=\eightsy
  62. \def\rm{\eightrm} \rm
  63. \def\bf{\eightbf}
  64. \def\it{\eightit}
  65. \def\tt{\eighttt}
  66. \def\ss{\eightss}
  67. \baselineskip=0.8\baselineskip
  68. \newdimen\intercolumnskip % horizontal space between columns
  69. \intercolumnskip=0.5in
  70. % The TeXbook, p. 257
  71. \let\lr=L \newbox\leftcolumn
  72. \output={\if L\lr
  73. \global\setbox\leftcolumn\columnbox \global\let\lr=R
  74. \else
  75. \doubleformat \global\let\lr=L\fi}
  76. \def\doubleformat{\shipout\vbox{\makeheadline
  77. \leftline{\box\leftcolumn\hskip\intercolumnskip\columnbox}
  78. \makefootline}
  79. \advancepageno}
  80. \def\columnbox{\leftline{\pagebody}}
  81. \def\newcolumn{\vfil\eject}
  82. \def\bye{\par\vfil\supereject
  83. \if R\lr \null\vfil\eject\fi
  84. \end}
  85. \outer\def\title#1#2{{\titlefont\centerline{#1}}\vskip 1ex plus 0.5ex
  86. \centerline{\ss#2}
  87. \vskip2\baselineskip}
  88. \outer\def\section#1{\filbreak
  89. \bskip
  90. \leftline{\headingfont #1}
  91. \askip}
  92. \def\bskip{\vskip 2.5ex plus 0.25ex }
  93. \def\askip{\vskip 0.75ex plus 0.25ex}
  94. \newdimen\defwidth \defwidth=0.25\hsize
  95. \def\hang{\hangindent\defwidth}
  96. \def\textindent#1{\noindent\llap{\hbox to \defwidth{\tt#1\hfil}}\ignorespaces}
  97. \def\key{\par\hangafter=0\hang\textindent}
  98. \def\mtextindent#1{\noindent\hbox{\tt#1\quad}\ignorespaces}
  99. \def\mkey{\par\hangafter=1\hang\mtextindent}
  100. \def\kbd#{\bgroup\tt \let\next= }
  101. \newdimen\raggedstretch
  102. \newskip\raggedparfill \raggedparfill=0pt plus 1fil
  103. \def\nohyphens
  104. {\hyphenpenalty10000\exhyphenpenalty10000\pretolerance10000}
  105. \def\raggedspaces
  106. {\spaceskip=0.3333em\relax
  107. \xspaceskip=0.5em\relax}
  108. \def\raggedright
  109. {\raggedstretch=6em
  110. \nohyphens
  111. \rightskip=0pt plus \raggedstretch
  112. \raggedspaces
  113. \parfillskip=\raggedparfill
  114. \relax}
  115. \def\raggedcenter
  116. {\raggedstretch=6em
  117. \nohyphens
  118. \rightskip=0pt plus \raggedstretch
  119. \leftskip=\rightskip
  120. \raggedspaces
  121. \parfillskip=0pt
  122. \relax}
  123. \chardef\\=`\\
  124. \raggedright
  125. \nopagenumbers
  126. \parindent 0pt
  127. \interlinepenalty=10000
  128. \hoffset -0.2in
  129. %\voffset 0.2in
  130. %**end of header
  131. \title{GNU\ \ Emacs\ \ Survival\ \ Card}{for version \versionemacs}
  132. In the following, \kbd{C-z} means hit the `\kbd{z}' key while
  133. holding down the {\it Ctrl}\ \ key. \kbd{M-z} means hit the
  134. `\kbd{z}' key while hitting the {\it Meta\/} (labeled {\it Alt\/}
  135. on some keyboards) or after hitting {\it Esc\/} key.
  136. \section{Running Emacs}
  137. To enter GNU Emacs, just type its name: \kbd{emacs}.
  138. Emacs divides the frame into several areas:
  139. menu line,
  140. buffer area with the edited text,
  141. mode line describing the buffer in the window above it,
  142. and a minibuffer/echo area in the last line.
  143. \askip
  144. \key{C-x C-c} quit Emacs
  145. \key{C-x C-f} edit file; this command uses the minibuffer to read
  146. the file name; use this to create new files by entering the name
  147. of the new file
  148. \key{C-x C-s} save the file
  149. \key{C-x k} kill a buffer
  150. \key{C-g} in most context: cancel, stop, abort partially typed or
  151. executing command
  152. \key{C-x u} undo
  153. \section{Moving About}
  154. \key{C-l} scroll current line to center of window
  155. \key{C-x b} switch to another buffer
  156. \key{M-<} move to beginning of buffer
  157. \key{M->} move to end of buffer
  158. \key{M-g M-g} go to a given line number
  159. \section{Multiple Windows}
  160. \key{C-x 0} remove the current window from the display
  161. \key{C-x 1} make active window the only window
  162. \key{C-x 2} split window horizontally
  163. \key{C-x 3} split window vertically
  164. \key{C-x o} move to other window
  165. \section{Regions}
  166. Emacs defines a `region' as the space between the {\it mark\/} and
  167. the {\it point}. A mark is set with \kbd{C-{\it space}}.
  168. The point is at the cursor position.
  169. \askip
  170. \key{M-h} mark entire paragraph
  171. \key{C-x h} mark entire buffer
  172. \section{Killing and Copying}
  173. \key{C-w} kill region
  174. \key{M-w} copy region to kill-ring
  175. \key{C-k} kill from the cursor all the way to the end of the line
  176. \key{M-DEL} kill word
  177. \key{C-y} yank back the last kill (\kbd{C-w C-y} combination could be
  178. used to move text around)
  179. \key{M-y} replace last yank with previous kill
  180. \section{Searching}
  181. \key{C-s} search for a string
  182. \key{C-r} search for a string backwards
  183. \key{RET} quit searching
  184. \key{M-C-s} regular expression search
  185. \key{M-C-r} reverse regular expression search
  186. \askip
  187. Use \kbd{C-s} or \kbd{C-r} again to repeat the search in either direction.
  188. \section{Tags}
  189. Tags tables files record locations of function and
  190. procedure definitions, global variables, data types and anything
  191. else convenient. To create a tags table file, type
  192. `{\tt etags} {\it input\_files}' as a shell command.
  193. \askip
  194. \key{M-.} find a definition
  195. \key{C-u M-.} find next occurrence of definition
  196. \key{M-*} pop back to where \kbd{M-.} was last invoked
  197. \mkey{M-x tags-query-replace} run query-replace on all files
  198. recorded in tags table
  199. \key{M-,} continue last tags search or query-replace
  200. \section{Compiling}
  201. \key{M-x compile} compile code in active window
  202. \key{C-c C-c} go to the next compiler error, when in
  203. the compile window or
  204. \key{C-x `} when in the window with source code
  205. \section{Dired, the Directory Editor}
  206. \key{C-x d} invoke Dired
  207. \key{d} flag this file for deletion
  208. \key{\~{}} flag all backup files for deletion
  209. \key{u} remove deletion flag
  210. \key{x} delete the files flagged for deletion
  211. \key{C} copy file
  212. \key{g} update the Dired buffer
  213. \key{f} visit the file described on the current line
  214. \key{s} switch between alphabetical date/time order
  215. \section{Reading and Sending Mail}
  216. \key{M-x rmail} start reading mail
  217. \key{q} quit reading mail
  218. \key{h} show headers
  219. \key{d} mark the current message for deletion
  220. \key{x} remove all messages marked for deletion
  221. \key{C-x m} begin composing a message
  222. \key{C-c C-c} send the message and switch to another buffer
  223. \key{C-c C-f C-c} move to the `CC' header field, creating one
  224. if there is none
  225. \section{Miscellaneous}
  226. \key{M-q} fill paragraph
  227. \key{M-/} expand previous word dynamically
  228. \key{C-z} iconify (suspend) Emacs when running it under X or
  229. shell, respectively
  230. \mkey{M-x revert-buffer} replace the text being edited with the
  231. text of the file on disk
  232. \section{Query Replace}
  233. \key{M-\%} interactively search and replace
  234. \key{M-C-\%} using regular expressions
  235. \askip
  236. Valid responses in query-replace mode are
  237. \askip
  238. \key{SPC} replace this one, go on to next
  239. \key{,} replace this one, don't move
  240. \key{DEL} skip to next without replacing
  241. \key{!} replace all remaining matches
  242. \key{\^{}} back up to the previous match
  243. \key{RET} exit query-replace
  244. \key{C-r} enter recursive edit (\kbd{M-C-c} to exit)
  245. \section{Regular Expressions}
  246. \key{. {\rm(dot)}} any single character except a newline
  247. \key{*} zero or more repeats
  248. \key{+} one or more repeats
  249. \key{?} zero or one repeat
  250. \key{[$\ldots$]} denotes a class of character to match
  251. \key{[\^{}$\ldots$]} negates the class
  252. \key{\\{\it c}} quote characters otherwise having a special
  253. meaning in regular expressions
  254. \key{$\ldots$\\|$\ldots$\\|$\ldots$} matches one of
  255. the alternatives (``or'')
  256. \key{\\( $\ldots$ \\)} groups a series of pattern elements to
  257. a single element
  258. \key{\\{\it n}} same text as {\it n\/}th group
  259. \key{\^{}} matches at line beginning
  260. \key{\$} matches at line end
  261. \key{\\w} matches word-syntax character
  262. \key{\\W} matches non-word-syntax character
  263. \key{\\<} matches at word beginning
  264. \key{\\>} matches at word end
  265. \key{\\b} matches at word break
  266. \key{\\B} matches at non-word break
  267. \section{Registers}
  268. \key{C-x r s} save region in register
  269. \key{C-x r i} insert register contents into buffer
  270. \key{C-x r SPC} save value of point in register
  271. \key{C-x r j} jump to point saved in register
  272. \section{Rectangles}
  273. \key{C-x r r} copy rectangle to register
  274. \key{C-x r k} kill rectangle
  275. \key{C-x r y} yank rectangle
  276. \key{C-x r t} prefix each line with a string
  277. \key{C-x r o} open rectangle, shifting text right
  278. \key{C-x r c} blank out rectangle
  279. \section{Shells}
  280. \key{M-x shell} start a shell within Emacs
  281. \key{M-!} execute a shell command
  282. \key{M-|} run a shell command on the region
  283. \key{C-u M-|} filter region through a shell command
  284. \section{Spelling Check}
  285. \key{M-\$} check spelling of word at the cursor
  286. \mkey{M-x ispell-region} check spelling of all words in region
  287. \mkey{M-x ispell-buffer} check spelling of entire buffer
  288. \section{International Character Sets}
  289. \key{C-x RET C-\\} select and activate input method for
  290. the current buffer
  291. \key{C-\\} enable or disable input method
  292. \mkey{M-x list-input-methods} show all input methods
  293. \mkey{M-x set-language-environment} specify principal language
  294. \key{C-x RET c} set coding system for next command
  295. \mkey{M-x find-file-literally} visit file with no conversion
  296. of any kind
  297. \mkey{M-x list-coding-systems} show all coding systems
  298. \mkey{M-x prefer-coding-system} choose preferred coding system
  299. \section{Keyboard Macros}
  300. \key{C-x (} start defining a keyboard macro
  301. \key{C-x )} end keyboard macro definition
  302. \key{C-x e} execute last-defined keyboard macro
  303. \key{C-u C-x (} append to last keyboard macro
  304. \mkey{M-x name-last-kbd-macro} name last keyboard macro
  305. \section{Simple Customization}
  306. \key{M-x customize} customize variables and faces
  307. \section{Getting Help}
  308. Emacs does command completion for you. Typing \kbd{M-x}
  309. {\it tab\/} or {\it space\/} gives a list of Emacs commands.
  310. \askip
  311. \key{C-h} Emacs help
  312. \key{C-h t} run the Emacs tutorial
  313. \key{C-h i} enter Info, the documentation browser
  314. \key{C-h a} show commands matching a string (apropos)
  315. \key{C-h k} display documentation of the function invoked by
  316. keystroke
  317. \askip
  318. Emacs gets into different {\it modes}, each of which customizes
  319. Emacs for editing text of a particular sort. The mode line
  320. contains names of the current modes, in parentheses.
  321. \askip
  322. \key{C-h m} get mode-specific information
  323. \copyrightnotice
  324. \bye
  325. % Local variables:
  326. % compile-command: "pdftex survival"
  327. % End: