home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume3 / mg2a / part02 (.txt) < prev    next >
LaTeX Document  |  1989-02-03  |  56KB  |  1,184 lines

  1. Path: xanth!mcnc!uvaarpa!umd5!ames!necntc!ncoast!allbery
  2. From: BLARSON@ECLA.USC.EDU (Bob Larson)
  3. Newsgroups: comp.sources.misc
  4. Subject: v03i026: mg 2a part 2 of 15
  5. Message-ID: <12401299102.47.BLARSON@ECLA.USC.EDU>
  6. Date: 26 May 88 04:50:33 GMT
  7. Sender: allbery@ncoast.UUCP
  8. Reply-To: BLARSON@ECLA.USC.EDU (Bob Larson)
  9. Lines: 1485
  10. Approved: allbery@ncoast.UUCP
  11. comp.sources.misc: Volume 3, Issue 26
  12. Submitted-By: "Bob Larson" <BLARSON@ECLA.USC.EDU>
  13. Archive-Name: mg2a/Part2
  14. #    This is a shell archive.
  15. #    Remove everything above and including the cut line.
  16. #    Then run the rest of the file through sh.
  17. #----cut here-----cut here-----cut here-----cut here----#
  18. #!/bin/sh
  19. # shar:    Shell Archiver
  20. #    Run the following text with /bin/sh to create:
  21. #    mg.tex
  22. #    mgidx.tex
  23. # This archive created: Tue May 17 21:46:44 1988
  24. # By:    blarson
  25. cat << \SHAR_EOF > mg.tex
  26. \batchmode %be nice to fellow VAXers
  27. \hoffset=0in \voffset=0in %correct dvi2ln3 bug
  28. \documentstyle[11pt,titlepage]{report}
  29. %\pagestyle{headings} %not sure on this one yet
  30. %\parindent=0in
  31. \textwidth=6in
  32. \oddsidemargin=0.25in
  33. % definitions for DEFINE environment
  34. \newlength{\lblwide}
  35. \newcommand{\resetmarg}{\settowidth{\leftmargin}{\makebox[\lblwide]{}\makebox[\labelsep]{}}}
  36. \newcommand{\resetlbl}{\setlength{\labelwidth}{\lblwide}} 
  37. \newenvironment{define}[1]{\begin{list}{}{\settowidth{\lblwide}{\bf #1}\resetmarg \resetlbl}}{\end{list}}
  38. % definitions for fn environment
  39. \newcommand{\fname}[3]{\hspace{1em}\\{\tt #1}\index{#1} {\it #2}\hfill{\tt #3}}
  40. \newcommand{\fmore}[3]{\\{\tt #1}\index{#1} {\it #2}\hfill{\tt #3}}
  41. \newcommand{\fbody}{\\[0.5em]}
  42. % definitions for making the index
  43. \newcommand{\indexentry}[2]{\item {\tt #1} \dotfill\  #2}
  44. \setcounter{secnumdepth}{5} %personal preference
  45. \setcounter{tocdepth}{5} %personal preference
  46. \author{Sandra J. Loosemore}
  47. \title{The MG Reference Manual \\ Release MG2A}
  48. \date{\vspace{1.5in}
  49. Copyright \copyright 1987, Sandra J. Loosemore \\[0.5em]
  50. \parbox{5 in}{This document, or sections of this document, may be freely
  51. redistributed provided that the copyright notice and the following disclaimer
  52. remain intact:  The author bears no responsibilities for errors in
  53. this document or the software it describes; and shall not be held liable
  54. for any indirect, incidental, or consequential damages.}}
  55. \makeindex %usually not
  56. \begin{document}
  57. \maketitle
  58. \tableofcontents
  59. \chapter{Introduction}
  60. MG is a small, fast, and portable Emacs-style text editor intended to
  61. be used by people who can't run a real Emacs for one reason or another
  62. --- as their main editor on smaller machines with limited memory or
  63. file space, or as a ``quick-start'' editor on larger systems, useful
  64. for composing short mail messages and the like. 
  65. We've made MG compatible with GNU Emacs because that is the ``big'',
  66. full-featured editor that many of us use regularly and are most
  67. familiar with.  GNU Emacs is the creation of Richard M. Stallman, who
  68. was also the author of the original Emacs editor.  However, MG is not
  69. associated in any way with the GNU project, and the MG authors
  70. individually may or may not agree with the opinions expressed by
  71. Richard Stallman and the GNU project. 
  72. MG is largely public domain.  You can use, modify, and redistribute MG
  73. as you like.  A few modules, however, are copyrighted; specifically,
  74. the regular expression code, the VMS termcap routines, and the Amiga
  75. support code.  Look at the source code for the exact copyright
  76. restrictions. 
  77. There are several other editors in existence which call themselves
  78. MicroEmacs.  The original public domain version was written by Dave
  79. Conroy and circulated as version 1.6.  Derived from this, there is
  80. another PD version by Dave Conroy numbered v30; a significantly larger
  81. PD version by Daniel Lawrence which is now up to version 3.9; at least
  82. one proprietary implementation; an implementation for the Atari ST
  83. with an integrated command shell, by Prabhaker Mateti; and probably
  84. others that we don't know about.
  85. MG is derived from the v30 MicroEmacs, with key bindings, command
  86. names, and general functionality made more compatible with GNU Emacs.
  87. Like v30, MG is fairly small and quite robust.  We have generally
  88. resisted the temptation to overfeaturize.  Some features which are
  89. large and complex are flagged for conditional compilation.
  90. Many people have contributed their time to developing, improving, and
  91. porting MG.  Mike Meyer, Mic Kaczmarczik, and Bob Larson deserve 
  92. particular mention for their efforts.  
  93. Questions, suggestions, and offers of help should be addressed to:
  94. \begin{verbatim}
  95.         mg-developers@ucbvax.berkeley.edu   (ARPA)
  96.         ucbvax!mg-developers                (UUCP)
  97. \end{verbatim}
  98. \section{Implementations of MG}
  99. MG runs on many different kinds of hardware under many different 
  100. operating systems.  Currently, these include:
  101. \begin{itemize}
  102. \item 4.2 and 4.3 BSD Unix (including Ultrix-32)
  103. \item System V Unix
  104. \item VAX/VMS
  105. \item Primos
  106. \item OS9/68k
  107. \item Amiga
  108. \item Atari ST
  109. \item MS-DOS
  110. \end{itemize}
  111. This document describes release MG2A.  When we talk of different
  112. versions of MG in this manual, the term {\em version\/} is used to
  113. refer to the different support MG provides for the various machines
  114. and operating systems it runs under, not to different releases of MG
  115. itself.  For example, we might speak of how the VMS version of MG
  116. differs from the Unix version.
  117. As mentioned above, some MG commands may not be implemented in all
  118. versions; these are noted in the documentation.  Some versions of MG
  119. also support features (such as mouse handling) that are not described
  120. here.
  121. \section{A Note on Character Sets}
  122. MG uses the 128-character ASCII character set, and provides support for
  123. 8-bit characters.  Whether the particular version of MG that you are running
  124. knows about extended character sets depends on whether your terminal and
  125. the host operating system know about them.  Moreover, since there is no
  126. standard 8-bit character set, the same character codes will probably
  127. give different glyphs on different systems.  Most versions of MG use
  128. the DEC multinational character set.
  129. \section{Notation and Conventions}
  130. In this manual, commands and other things that must be typed in 
  131. literally are indicated in a typewriter font, like {\tt next-line}.
  132. Placeholders such as command argument names use an italic font.
  133. The terms {\em command\/} and {\em function\/} are synonymous.  We often
  134. speak of a command being bound to a particular {\em key\/}, although you 
  135. may actually have to type more than one character to form a single key.
  136. Most commands are bound to keys with {\em control\/} and {\em meta\/} 
  137. modifiers.
  138. To type a control character, use the control key on your
  139. keyboard like a shift key:  hold down the control key while typing the
  140. character.  In this manual, we will indicate control characters like
  141. \verb"C-x" --- here, typing the character ``x'' while holding down
  142. the control key.
  143. Some keyboards also have a meta key that works like the control
  144. key.  (It may be labelled something else;  on the Atari ST, for example,
  145. the key marked  ``Alternate'' is the meta key.)  If your keyboard doesn't
  146. have a meta key, don't panic.  You can also use the escape key as a meta
  147. prefix; first type the escape, and {\em then\/} the character.  Meta
  148. characters will be indicated as \verb"M-x".
  149. Besides the meta prefix, two other characters are used as prefixes:
  150. \verb"C-x" and \verb"C-h".  A few keys have special notation:  {\tt SPC} is
  151. the space character, {\tt DEL} is the delete or rubout character, {\tt RET}
  152. is carriage return, and {\tt ESC} is the escape character.  {\tt NUL} is 
  153. the null character (ASCII 0), which is usually equivalent to either 
  154. \verb"C-SPC" or \verb"C-@".
  155. Uppercase and lowercase characters are generally equivalent in command
  156. keystrokes.
  157. When you run MG from a shell, command line arguments are interpreted as the
  158. names of files you want to {\em visit\/}, or edit.  Each file is 
  159. read into a {\em buffer\/} in memory.  No changes are actually made to 
  160. the file until you ask it to be written out to disk.
  161. Within MG, the large top part of the screen serves as a {\em window\/} into
  162. the buffer being edited.  Below this is the {\em mode line\/}, which 
  163. displays the name of the buffer.  Finally, at the very bottom of the screen,
  164. there is a one-line {\em minibuffer\/} which is used for displaying
  165. messages and answering questions.
  166. MG keeps track of two pointers into each window, the {\em point\/} and the
  167. {\em mark\/}.  The {\em cursor\/} appears at the point in the current
  168. window, and we often speak of moving the cursor rather than of moving the
  169. point.  The text between the point and the mark is referred to as the {\em
  170. region\/}.
  171. Some commands deal with {\em words\/} and {\em paragraphs\/}.
  172. Generally, whitespace and punctuation separate words.  Lines that are
  173. empty or that contain only spaces or tabs separate paragraphs without
  174. being part of a paragraph.  A non-empty line that starts with a space
  175. or tab also begins a new paragraph. 
  176. A number of commands are defined as {\em toggles\/}.  If no prefix argument
  177. is supplied, these commands toggle an action.  The action is turned on if a 
  178. negative or zero argument is supplied, and turned on if a positive argument
  179. is supplied.
  180. \section{Getting Started}
  181. This document is intended primarily as a reference manual.  If you
  182. have never used any Emacs-like text editor before, it is strongly
  183. suggested that you run the on-line tutorial supplied with the MG
  184. distribution, instead of reading this manual.
  185. Do not be put off by the large number of commands described in this
  186. manual!  It is possible to get by with only a handful of basic commands.
  187. Here are the ones that are probably used most frequently:
  188. \begin{define}{\hspace{1in}}
  189. \item[{\tt C-p}\hfill] Move the cursor to the previous line
  190. \item[{\tt C-n}\hfill] Move the cursor to the next line
  191. \item[{\tt C-b}\hfill] Move the cursor backwards
  192. \item[{\tt C-f}\hfill] Move the cursor forwards
  193. \item[{\tt C-v}\hfill] Scroll forwards one screenful
  194. \item[{\tt M-v}\hfill] Scroll backwards one screenful
  195. \item[{\tt M-<}\hfill] Go to the beginning of the buffer
  196. \item[{\tt M->}\hfill] Go to the end of the buffer
  197. \item[{\tt C-a}\hfill] Go to the beginning of the line
  198. \item[{\tt C-e}\hfill] Go to the end of the line
  199. \item[{\tt DEL}\hfill] Delete the previous character
  200. \item[{\tt C-k}\hfill] Kill (delete) to the end of line
  201. \item[{\tt C-y}\hfill] Reinsert killed text.
  202. \item[{\tt C-x C-c}\hfill] Exit MG
  203. \item[{\tt C-x C-s}\hfill] Save the current buffer
  204. \end{define}
  205. \chapter{Using Commands}
  206. \section{Command Arguments}
  207. Some commands require arguments.  For example, if you want to read a
  208. file into a buffer, you must type in the name of the file.  In the
  209. descriptions of commands in this manual, if arguments are required,
  210. they are listed following the command name.
  211. MG prompts for command arguments in the minibuffer.  Within the minibuffer,
  212. the following characters can be used for editing:
  213. \begin{define}{\hspace{1in}}
  214. \item[{\tt DEL, C-h}\hfill] Erase the last character. 
  215. \item[{\tt C-x, C-u}\hfill] Erase the entire input line. 
  216. \item[{\tt C-w}\hfill] Erase to the beginning of the previous word. 
  217. \item[{\tt C-q, $\backslash$}\hfill] Quote the next character typed. 
  218. \item[{\tt RET}\hfill] Signifies that you have completed typing in 
  219. the argument. 
  220. \item[{\tt C-g}\hfill] Abort the command in progress.
  221. \end{define}
  222. \section{Prefix Arguments}
  223. All commands accept an optional numeric prefix argument.  This is
  224. often interpreted as a repetition count.  For example, the function
  225. {\tt next-line}, if given a prefix argument, will move the cursor
  226. forward that many lines; without an argument, it will move the cursor
  227. forward one line.  A few commands behave differently if given a prefix
  228. argument than they do without one, and others ignore the prefix
  229. argument entirely. 
  230. \fname{digit-argument}{}{M-0, M-1, M-2, M-3, M-4, M-5, M-6, M-7, M-8, M-9}
  231. \fmore{negative-argument}{}{M--} 
  232. \fbody One way to specify a command argument is to use the escape key
  233. as a meta prefix, and then type one or more digits.  A dash may be
  234. used for a negative argument.
  235. \fname{universal-argument}{}{C-u}
  236. \fbody Another way to specify a command prefix is to type {\tt C-u}.
  237. Typing one {\tt C-u} is equivalent to a prefix argument of 4, typing
  238. two gives a value of 16, and so on.  In addition, you can type digits
  239. following {\tt C-u} to form a numeric prefix argument.
  240. \section{Aborting}
  241. \fname{keyboard-quit}{}{C-g}
  242. \fbody Typing {\tt C-g} cancels any command.  It is particularly useful
  243. for cancelling a command when MG is prompting for input in the minibuffer.
  244. \section{Extended Commands}
  245. \fname{execute-extended-command}{command}{M-x}
  246. \fbody Commands that are not bound to keys can be executed through 
  247. {\tt execute extended-command}.  If a prefix argument is supplied, it
  248. is passed to the command being executed.
  249. \chapter{Moving the Cursor}
  250. The commands described in this chapter move the cursor (sometimes
  251. called the point or dot) within the current window.  Commands which
  252. set the mark are included here as well.
  253. \fname{backward-char}{}{C-b}
  254. \fbody Moves the cursor backward (left) one character.  If the cursor
  255. is at the left margin, it will be moved to the end of the previous line.
  256. \fname{backward-paragraph}{}{M-[}
  257. \fbody Moves the cursor backwards to the beginning of the current
  258. paragraph, or to the beginning of the previous paragraph if the cursor
  259. is already at the beginning of a paragraph.
  260. \fname{backward-word}{}{M-b}
  261. \fbody Moves the cursor backwards to the beginning of the current word,
  262. or to the beginning of the previous word if the cursor is already at
  263. the beginning of a word.
  264. \fname{beginning-of-buffer}{}{M-<}
  265. \fbody Moves the cursor backwards to the beginning of the buffer.
  266. \fname{beginning-of-line}{}{C-a}
  267. \fbody Moves the cursor backwards to the beginning of the current
  268. line.  This command has no effect if the cursor is already at the beginning
  269. of the line.
  270. \fname{end-of-buffer}{}{M->}
  271. \fbody Moves the cursor forwards to the end of the buffer.
  272. \fname{end-of-line}{}{C-e}
  273. \fbody Moves the cursor forwards to the end of the current line.  This
  274. command has no effect if the cursor is already at the end of the line.
  275. \fname{exchange-point-and-mark}{}{C-x C-x}
  276. \fbody Set the mark at the current cursor position, and move the cursor
  277. to the old location of the mark.
  278. \fname{forward-char}{}{C-f}
  279. \fbody Moves the cursor forwards one character.  If the cursor is at the
  280. end of a line, it will be moved to the first character on the next line.
  281. \fname{forward-paragraph}{}{M-]}
  282. \fbody Moves the cursor forwards to the next paragraph delimiter.
  283. \fname{forward-word}{}{M-f}
  284. \fbody Moves the cursor forwards to the end of the current word, or to
  285. the end of the next word if the cursor is already at the end of a word.
  286. \fname{goto-line}{line-number}{}
  287. \fbody Moves the cursor to the beginning of line {\em line-number\/} in
  288. the buffer.
  289. \fname{next-line}{}{C-n}
  290. \fbody Moves the cursor down one line.  The cursor remains in the same
  291. column unless it would be past the end of the line, in which case it is
  292. moved to the end of the line.  At the end of the buffer, {\tt C-n} will
  293. create new lines.
  294. \fname{previous-line}{}{C-p}
  295. \fbody Moves the cursor up one line.    The cursor remains in the same
  296. column unless it would be past the end of the line, in which case it is
  297. moved to the end of the line.
  298. \fname{recenter}{}{C-l}
  299. \fbody Redraws the entire screen, scrolling the current window if necessary
  300. so that the cursor is near the center.  With a positive prefix argument 
  301. {\em n\/}, the window is scrolled so that the cursor is {\em n\/} lines
  302. from the top.  A negative prefix argument puts the cursor that many lines
  303. from the bottom of the window.
  304. \fname{redraw-display}{}{}
  305. \fbody Redraws the entire screen, but never scrolls.
  306. \fname{scroll-down}{}{M-v}
  307. \fbody Scrolls the display down (moving backward through the
  308. buffer).  Without 
  309. an argument, it scrolls slightly less than one windowful.  A prefix argument
  310. scrolls that many lines.
  311. \fname{scroll-one-line-down}{}{}
  312. \fmore{scroll-one-line-up}{}{}
  313. \fbody These functions are similar to {\tt scroll-down} and {\tt scroll-up}
  314. (respectively), but when invoked without an argument, cause the display 
  315. to scroll by one line only.  These functions are enabled by defining the
  316. compile-time option GOSMACS.
  317. \fname{scroll-other-window}{}{M-C-v}
  318. \fbody Scrolls the ``other'' window forward as for {\tt scroll-up}.
  319. \fname{scroll-up}{}{C-v}
  320. \fbody Scrolls the display up (moving forward through the buffer).  Without an
  321. an argument, it scrolls slightly less than one windowful.  A prefix argument
  322. scrolls that many lines.
  323. \fname{set-mark-command}{}{NUL}
  324. \fbody Set the mark at the current cursor position.
  325. \fname{what-cursor-position}{}{C-x =}
  326. \fbody Prints some information in the minibuffer about where the cursor is.
  327. \chapter{Text Insertion Commands}
  328. The usual way to insert text into a buffer is simply to type the
  329. characters.  The default binding for all of the printing characters
  330. ({\tt self-insert-command}) causes them to be inserted literally at
  331. the cursor position. 
  332. \fname{insert}{string}{}
  333. \fbody Insert {\em string\/} into the current buffer at the cursor position.
  334. \fname{newline}{}{RET}
  335. \fbody Insert a line break into the current buffer at the cursor position,
  336. moving the cursor forward to the beginning of the new line.
  337. \fname{newline-and-indent}{}{C-j}
  338. \fbody Insert a line break into the current buffer at the cursor position,
  339. then add extra whitespace so that the cursor is aligned in the same
  340. column as the first non-whitespace character in the previous line.
  341. \fname{open-line}{}{C-o}
  342. \fbody Inserts a line break into the current buffer at the current position,
  343. but does not move the cursor forward.
  344. \fname{quoted-insert}{}{C-q} 
  345. \fbody This command acts as a prefix to
  346. cancel the normal interpretation of the next keystroke.  If {\tt C-q}
  347. is followed by one to three octal digits, it is interpreted as the
  348. code of the character to insert.  Otherwise a single key is read and
  349. the character typed is inserted into the buffer instead of interpreted
  350. as a command.  This is used for inserting literal control characters
  351. into a buffer. 
  352. \fname{self-insert-command}{}{}
  353. \fbody This is the default binding for keys representing printable
  354. characters.  The character is inserted into the buffer at the cursor
  355. position, and the cursor moved forward.
  356. \chapter{Killing, Deleting, and Moving Text}
  357. When text is deleted, it is erased completely.  Killing text, on the
  358. other hand, moves it into a temporary storage area called the kill
  359. buffer.  The saved text in the kill buffer is erased when another
  360. block of text is killed.  Until then, however, you can retrieve text
  361. from the kill buffer.  This can be used to move or copy blocks of
  362. text, as well as to restore accidentally killed text.
  363. \fname{backward-kill-word}{}{M-DEL}
  364. \fbody Kill the text backwards from the cursor position to the beginning
  365. of the current word.  Typing {\tt M-DEL} several times in succession 
  366. prepends each killed word to the kill buffer.
  367. \fname{copy-region-as-kill}{}{M-w}
  368. \fbody Copies the text in the region into the kill buffer, without removing
  369. it from the current buffer.
  370. \fname{delete-backward-char}{}{DEL}
  371. \fbody Deletes the character to the left of the cursor.
  372. \fname{delete-blank-lines}{}{C-x C-o}
  373. \fbody Deletes all blank lines after the current line, and if the current
  374. line is blank, deletes it and all blank lines preceeding it as well.
  375. \fname{delete-char}{}{C-d}
  376. \fbody Deletes the character underneath the cursor.
  377. \fname{delete-horizontal-space}{}{M-$\backslash$}
  378. \fbody Deletes all spaces and tabs on either side of the cursor.
  379. \fname{just-one-space}{}{M-SPC}
  380. \fbody This is like {\tt delete-horizontal-space}, except it leaves a single
  381. space at the cursor position.
  382. \fname{kill-line}{}{C-k}
  383. \fbody If no prefix argument is specified, this function kills text up
  384. to the next newline; or if the cursor is at the end of a line, the newline
  385. is killed.  A prefix argument specifies how many lines to kill.  Typing
  386. {\tt C-k} several times in succession appends each line to the kill buffer.
  387. \fname{kill-paragraph}{}{}
  388. \fbody This command kills the entire paragraph containing the cursor.
  389. If the cursor is positioned between paragraphs, the next paragraph is killed.
  390. \fname{kill-region}{}{C-w}
  391. \fbody The region (all text between point and mark) is killed.
  392. \fname{kill-word}{}{M-d}
  393. \fbody Text is killed forward from the cursor position to the next
  394. end of word.  If the cursor is at the end of the word, then the next
  395. word is killed.  Typing {\tt M-d} several times appends the killed
  396. text to the kill buffer.
  397. \fname{yank}{}{C-y}
  398. \fbody Text is copied from the kill buffer into the current buffer at
  399. the cursor position.  The cursor is moved to the end of the inserted
  400. text.
  401. \chapter{Searching and Replacing}
  402. \section{Searching}
  403. The ordinary search command in MG differs from that in many other editors
  404. in that it is incremental:  it begins searching as soon as you begin
  405. typing the search string, instead of waiting for you to type the entire
  406. string.
  407. All of the search commands described in this section are case-insensitive.
  408. \fname{isearch-backward}{pattern}{C-r}
  409. \fmore{isearch-forward}{pattern}{C-s}
  410. \fbody These commands perform an incremental search backward and 
  411. forward (respectively) for {\em pattern\/}.  MG will move the cursor 
  412. to the place in the buffer that matches as much of the pattern as you 
  413. have typed so far, as each character is entered.
  414. Within the incremental search, the following characters are interpreted
  415. specially:
  416. \begin{define}{\hspace{1in}}
  417. \item[{\tt DEL}\hfill] Erase the last character in the search string. 
  418. \item[{\tt ESC}\hfill] Stop searching; exit from incremental search
  419. mode, leaving the cursor where the search brought it. 
  420. \item[{\tt C-g}\hfill] If a match has been found, exits from
  421. incremental search but leaves the cursor in its original position.  If
  422. the search has failed, this will just erase the characters which have
  423. not been found from the end of the search pattern.  In this case, you
  424. must type \verb"C-g" again to abort the search. 
  425. \item[{\tt C-s}\hfill] Search forward for the next occurrence of the
  426. same pattern. 
  427. \item[{\tt C-r}\hfill] Search backward for the previous occurrence of
  428. the same pattern. 
  429. \item[{\tt C-q}\hfill] ``Quotes'' the next character typed, forcing it
  430. to be interpreted as a literal character in the search pattern.
  431. \end{define}
  432. In addition, normal commands such as \verb"C-a" that do not have special
  433. meanings within incremental search cause the search to be terminated, and
  434. then are executed in the ordinary way.
  435. \fname{search-again}{}{}
  436. \fmore{search-backward}{pattern}{M-r}
  437. \fmore{search-forward}{pattern}{M-s}
  438. \fbody These commands perform ordinary, non-incremental searches.
  439. {\tt Search-again} uses the same pattern and direction as the previous
  440. search.
  441. \section{Replacing}
  442. \fname{query-replace}{pattern replacement}{M-\%}
  443. \fbody The primary replace command in MG is an interactive query replace.
  444. MG searches forward for occurrences of {\em pattern\/}, and asks you what
  445. to do about each one.  The choices are:
  446. \begin{define}{\hspace{1in}}
  447. \item[{\tt SPC}\hfill] Replace this match with {\em replacement\/},
  448. and go on to the next. 
  449. \item[{\tt DEL}\hfill] Skip to the next match without replacing this one. 
  450. \item[{\tt .}\hfill] Replace this match, and then quit. 
  451. \item[{\tt !}\hfill] Replace all remaining occurrences without asking again. 
  452. \item[{\tt ESC}\hfill] Quit.
  453. \end{define}
  454. By default, {\tt query-replace} adjusts the case of lower-case letters
  455. in the replacement string to match that of the
  456. particular occurrence of the pattern; for example, replacing ``Foo''
  457. with ``bar'' results in ``Bar''.  Upper case letters in the replacement
  458. string are always left uppercase.   In addition, supplying a prefix argument
  459. will also tell {\tt query-replace} to leave the case of the replacement
  460. string as-is.
  461. Note that {\tt query-replace} always performs a case-insensitive search.
  462. \section{Regular Expressions}
  463. Regular expressions provide a means for specifying complex search
  464. patterns, instead of just a literal string.  The commands in this
  465. section are available only if MG is compiled with the REGEX option
  466. defined. 
  467. Regular expression syntax uses the following rules.  Most characters
  468. in a regular expression are considered to be {\em ordinary\/} characters,
  469. and will match themselves and nothing else.  The exceptions are the
  470. special characters listed below.
  471. \begin{define}{\hspace{1in}}
  472. \item[{\tt .}\hfill] Matches any single character except a newline.  
  473. \item[{\tt *}\hfill] A suffix operator that matches zero or more
  474. repetitions of the (smallest) preceding regular expression. 
  475. \item[{\tt +}\hfill] A suffix operator that matches one or more
  476. repetitions of the (smallest) preceding regular expression. 
  477. \item[{\tt ?}\hfill] A suffix operator that matches either zero or one
  478. occurence of the (smallest) preceding regular expression. 
  479. \item[{\tt [\ldots]}\hfill] Matches any one character listed in the
  480. character set between the square brackets.  See examples below. 
  481. \item[{\tt \^{ }}\hfill] Matches at the beginning of a line. 
  482. \item[{\tt \$}\hfill] Matches at the end of a line. 
  483. \item[{\tt $\backslash$}\hfill] Except for the situations listed
  484. below, acts as a prefix operator which causes the character following
  485. to be treated as an ordinary character. 
  486. \item[{\tt $\backslash$|}\hfill] An infix binary {\em or\/} operator.
  487. It applies to the two largest surrounding expressions. 
  488. \item[{\tt $\backslash$(\ldots$\backslash$)}\hfill] A grouping construct,
  489. usually used to specify a larger expression for postfix operators such
  490. as \verb"*" or to limit the scope of operands to \verb"\|". 
  491. \item[{\tt $\backslash${\em digit\/}}\hfill] Matches the same text
  492. matched by the {\em digit\/}th \verb"\(...\)" construct.  These are
  493. numbered from 1 to 9 in the order that the open-parentheses appear. 
  494. \item[{\tt $\backslash$`}\hfill] Matches at the beginning of the buffer. 
  495. \item[{\tt $\backslash$'}\hfill] Matches at the end of the buffer. 
  496. \item[{\tt $\backslash$b}\hfill] Matches at the beginning or end of a word. 
  497. \item[{\tt $\backslash$B}\hfill] Matches anyplace {\em except\/} at
  498. the beginning or end of a word. 
  499. \item[{\tt $\backslash$<}\hfill] Matches at the beginning of a word. 
  500. \item[{\tt $\backslash$>}\hfill] Matches at the end of a word. 
  501. \item[{\tt $\backslash$w}\hfill] Matches any word-constituent character. 
  502. \item[{\tt $\backslash$W}\hfill] Matches any character which is {\em
  503. not\/} a word-constituent. 
  504. \end{define}
  505. Some examples may help clarify the rules.
  506. \begin{define}{\hspace{1in}}
  507. \item[{\tt foo}\hfill] Matches the literal string {\tt foo}. 
  508. \item[{\tt ;.*}\hfill] Matches all strings which begin with a
  509. semicolon and continue to the end of a line. 
  510. \item[{\tt c[ad]+r}\hfill] Matches strings of the form {\tt car}, {\tt
  511. cdr}, {\tt caar}, {\tt cadr}, and so on. 
  512. \item[{\tt [a-z]}\hfill] Matches any lowercase letter. 
  513. \item[{\tt [\^{ }a-z]}\hfill] Matches any character {\em except\/}
  514. lowercase letters. 
  515. \item[{\tt [0-9+---]}\hfill] Matches a digit or sign. 
  516. \item[{\tt $\backslash$(foo$\backslash$|bar$\backslash$)}\hfill]
  517. Matches either the string {\tt foo} or the string {\tt bar}. 
  518. \end{define}
  519. \fname{count-matches}{pattern}{}
  520. \fmore{count-non-matches}{pattern}{}
  521. \fbody These commands count the number of lines which do or do not
  522. (respectively) match the specified pattern.
  523. \fname{delete-matching-lines}{pattern}{}
  524. \fmore{delete-non-matching-lines}{pattern}{}
  525. \fbody These commands delete all lines which do or do not (respectively)
  526. match the specified pattern.
  527. \fname{query-replace-regexp}{pattern replacement}{}
  528. \fbody This is the regular expression version of {\tt query-replace}.
  529. The {\em replacement\/} string may be a constant, or it can refer to
  530. all or part of the string matched by the {\em pattern\/}.  \verb"\&" in
  531. the replacement string expands into the entire text being replaced,
  532. while \verb"\"{\em n\/} (where {\em n\/} is a number) replaces the 
  533. {\em n\/}th parenthesized expression in {\em pattern\/}.
  534. \fname{re-search-again}{}{}
  535. \fmore{re-search-backward}{pattern}{}
  536. \fmore{re-search-forward}{pattern}{}
  537. \fbody These are the regular expression equivalents of the ordinary
  538. non-incremental search commands.
  539. \fname{set-case-fold-search}{}{}
  540. \fbody This command toggles an internal variable that controls whether
  541. the regular expression search and replace commands pay attention to
  542. case.  By default, regular expression searches are case-insensitive.
  543. Ordinary searches are always case-insensitive and are not affected by
  544. the setting of this variable.
  545. \chapter{Windows}
  546. MG initially has only one text window displayed.  However, you can have
  547. as many windows as will fit on the screen.  Each window has its own mode
  548. line and must display at least two lines of text.  (Note that a MG's
  549. ``windows'' are distinct from the ``windows'' handled by screen managers
  550. such as the X Window System.)
  551. Multiple windows may be used to display different buffers.  You can also
  552. have the same buffer displayed in more than one window, which is useful
  553. if you want to see one part of a file at the same time as you are editing
  554. another part.
  555. Although many windows can be displayed at once, only one window is active 
  556. at any given time.  This is the window where the cursor appears.
  557. Some commands refer to the ``other'' window.  This is the window directly
  558. below the current window, or the top window if you are in the bottom window.
  559. \fname{delete-other-windows}{}{C-x 1}
  560. \fbody Makes the current window the only window.
  561. \fname{delete-window}{}{C-x 0}
  562. \fbody Deletes the current window, making the ``other'' window the
  563. current window.  This command doesn't do anything useful if there is only
  564. one window being displayed.
  565. \fname{enlarge-window}{}{C-\^{ }}
  566. \fbody Makes the current window larger.  Without a prefix argument, the
  567. window grows one line; otherwise, the prefix argument specifies how many
  568. lines to grow.
  569. \fname{other-window}{}{C-x o}
  570. \fbody Makes the ``other'' window the current window.
  571. \fname{previous-window}{}{}
  572. \fbody This is like {\tt other-window}, except that it cycles through
  573. the windows in reverse order.  This command is available only if MG was
  574. compiled with the GOSMACS option defined.
  575. \fname{shrink-window}{}{}
  576. \fbody Makes the current window smaller.  Without a prefix argument, the
  577. window loses one line; otherwise, the prefix argument specifies how many
  578. lines go away.
  579. \fname{split-window-vertically}{}{C-x 2}
  580. \fbody Split the current window into two windows, both using the same
  581. buffer.
  582. \chapter{Files and Buffers}
  583. Most buffers are used to contain a file being edited.  It is
  584. also possible to have buffers that are not associated with any file;
  585. MG uses these for purposes such as displaying help text, for example.
  586. However, since most commands for dealing with files also deal with
  587. buffers, we have grouped all of these commands together into one chapter.
  588. \section{Buffer Manipulation}
  589. \fname{insert-buffer}{buffer-name}{}
  590. \fbody Inserts the contents of the named buffer into the current buffer
  591. at the cursor location.  The cursor moves to the end of the inserted
  592. text.
  593. \fname{kill-buffer}{buffer-name}{C-x k}
  594. \fbody The named buffer and its contents are deleted.  If the buffer has
  595. been marked as modified, MG will ask you if you really want to delete it.
  596. Note that, contrary to its name, this command {\em does not\/} save the
  597. buffer contents in the kill buffer.
  598. If a buffer is being displayed in a window when it is deleted, MG will 
  599. find some other buffer to display in the same window.
  600. \fname{list-buffers}{}{C-x C-b}
  601. \fbody This command writes information about the buffers currently in
  602. use to a buffer named {\tt *Buffer List*}.  This buffer is then displayed
  603. in the ``other'' window; if there is only one window, this command will
  604. split the screen into two windows.
  605. \fname{not-modified}{}{M-\~{ }}
  606. \fbody This command makes MG think that the current buffer has not been
  607. modified, even if it really has been changed.  This affects the behavior
  608. of the {\tt kill-buffer} and the buffer-saving commands described below.
  609. MG indicates modified buffers with two stars at the left end of the mode
  610. line.
  611. \fname{switch-to-buffer}{buffer-name}{C-x b}
  612. \fbody The current window is mapped onto the named buffer.  If there
  613. isn't already a buffer with that name around, MG will create one.
  614. \fname{switch-to-buffer-other-window}{buffer-name}{C-x 4 b}
  615. \fbody This command works like {\tt switch-to-buffer}, except that the
  616. ``other'' window is used.  If there is only one window, this command
  617. splits the screen into two windows and maps the named buffer onto one
  618. of them.
  619. \section{Reading and Writing Files}
  620. \fname{find-file}{file-name}{C-x f}
  621. \fmore{find-file-other-window}{file-name}{C-x 4 C-f}
  622. \fbody These commands are analagous to {\tt switch-to-buffer} and {\tt
  623. switch-to-buffer-other-window}, respectively.  The difference is that
  624. these commands look for a buffer associated with the named file.  If no
  625. matching buffer is found, MG will create a new buffer with a name
  626. derived from the filename, and attempt to read the file into the buffer.
  627. If the named file cannot be opened, the buffer remains empty.
  628. \fname{insert-file}{file-name}{C-x i}
  629. \fbody This command reads in the contents of the named file into the
  630. current buffer at the cursor position.  The cursor remains in the same
  631. place.
  632. \fname{save-buffer}{}{C-x C-s}
  633. \fbody If the current buffer has been modified, it is saved.  Buffers
  634. that are not associated with files cannot be written out with this
  635. command.
  636. \fname{save-buffers-kill-emacs}{}{C-x C-c}
  637. \fbody This command is used to leave MG and return control to the shell
  638. or other program that was used to start MG.  If there are modified buffers,
  639. MG will ask you if you want to save them before exiting.
  640. \fname{save-some-buffers}{}{C-x s}
  641. \fbody MG will ask you if you want to save modified buffers that are
  642. associated with files.
  643. \fname{write-file}{file-name}{C-x C-w}
  644. \fbody The current buffer is written out using the file name supplied.
  645. This is useful for saving buffers that are not associated with files, or
  646. for writing out a file with a different name than what was used to read
  647. it in.
  648. \section{Backup Files}
  649. MG provides a way to save a copy of the original version of files which 
  650. have been modified and then written out again.  The backup copy reflects
  651. the state of the file as it existed the first time it was read into MG.
  652. The name used for the backup file varies, depending on the operating
  653. system.
  654. This feature is disabled if MG is compiled with NO\_BACKUP defined.
  655. \fname{make-backup-files}{}{} 
  656. \fbody This command is a toggle which
  657. controls the state of an internal variable that determines whether MG
  658. creates backup files. 
  659. \section{Changing the Directory}
  660. The commands in this section are disabled by defining NO\_DIR.
  661. \fname{cd}{directory-name}{}
  662. \fbody This command changes MG's notion of the ``current'' directory
  663. or pathname.  This is used to supply defaults for functions that read 
  664. or write files.
  665. The syntax for {\em directory-name\/} is obviously specific to the
  666. particular operating system MG is running on.
  667. \fname{pwd}{}{}
  668. \fbody Display what MG thinks is the current directory.
  669. \chapter{Modes}
  670. Modes are used to locally alter the bindings of keys on a 
  671. buffer-by-buffer basis.  MG is normally in fundamental mode, and these
  672. are the bindings that are listed with the command descriptions in 
  673. this manual.  Modes define additional keymaps that are searched for
  674. bindings before the fundamental mode bindings are examined; see the
  675. section on key binding below for more details on how this works.
  676. \fname{set-default-mode}{mode-name}{}
  677. \fbody Normally, when MG visits a file, it puts the associated buffer
  678. into fundamental mode.  Using the {\tt set-default-mode} command, you
  679. can specify that MG should default to use some other mode on all subsequent
  680. buffers that are created.  This command is a toggle.  With no prefix
  681. argument, if the named mode is not already on the list of
  682. default modes, then it will be added to the list; otherwise, it is removed
  683. from the list.
  684. \section{No Tab Mode}
  685. In notab mode, tabs are expanded into spaces instead of inserted
  686. literally into the buffer.  Literal tab characters are displayed as
  687. \verb"^I" (much like other control characters).  These commands are
  688. available if MG is compiled with the symbol NOTAB defined.  (This mode
  689. is mainly for use on systems such as PRIMOS that do not treat tab as a
  690. series of spaces.)
  691. \fname{no-tab-mode}{}{}
  692. \fbody This command is a toggle to control whether notab mode is in effect.
  693. \fname{space-to-tabstop}{}{}
  694. \fbody Insert enough spaces to move the cursor to the next tab stop.  In
  695. notab mode, this function is bound to {\tt C-i}.
  696. \section{Overwrite Mode}
  697. Normally, when characters are inserted into the buffer, they are spliced
  698. into the existing text.  In overwrite mode, inserting a character causes
  699. the character already at the cursor position to be replaced.  This is
  700. useful for editing pictures, tables, and the like.
  701. \fname{overwrite-mode}{}{}
  702. \fbody This command is a toggle which controls whether overwrite mode is
  703. in effect.
  704. \section{Auto Fill}
  705. Fill mode causes newlines to be added automatically at word
  706. breaks when text is added at the end of a line, extending past the
  707. right margin.  Auto fill is useful for editing text and documentation
  708. files.
  709. \fname{auto-fill-mode}{}{}
  710. \fbody This command is a toggle which controls whether fill mode is
  711. in effect.
  712. \fname{insert-with-wrap}{}{}
  713. \fbody This command works like {\tt self-insert}, except that it checks
  714. to see if the cursor has passed the right margin.  If so, it fills
  715. the line by inserting a line break between words.  This command is bound to 
  716. {\tt SPC} in fill mode.
  717. \fname{fill-paragraph}{}{M-q}
  718. \fbody Fill the paragraph containing the cursor.
  719. \fname{set-fill-column}{}{C-x f}
  720. \fbody Without a prefix argument, this command sets the right margin
  721. at the current cursor column.  If a prefix argument is supplied, it is used
  722. instead as the line width.
  723. \section{Auto Indent}
  724. Indent mode binds {\tt RET} to {\tt newline-and-indent}, so
  725. that each new line is indented to the same level as the preceeding
  726. line.  This mode is useful for editing code. 
  727. \fname{auto-indent-mode}{}{}
  728. \fbody This command is a toggle which controls whether auto-indent mode
  729. is in effect.
  730. \section{Blink}
  731. Blink mode makes it easier to match parentheses, brackets, and other
  732. paired delimiters.  When the closing delimiter is typed, the cursor
  733. moves momentarily to the matching opening delimiter (if it is on the
  734. screen), or displays the line containing the matching delimiter on the
  735. echo line.  This is useful for editing Lisp or C code, or for
  736. preparing input files for text processors such as LaTeX that use
  737. paired delimiters. 
  738. \fname{blink-matching-paren}{}{}
  739. \fbody This command is a toggle which controls whether blink mode is
  740. in effect.
  741. \fname{blink-matching-paren-hack}{}{}
  742. \fbody This function behaves like {\tt self-insert}, except that it
  743. finds the matching delimiter as described above.  In blink mode, this
  744. function is bound to \verb")", which flashes the matching \verb"(".  This
  745. function also knows about the pairs \verb"{}", \verb"[]", and \verb"<>".
  746. All other characters match with themselves.
  747. \section{Dired Mode}
  748. ``Dired'' is an abbreviation for ``directory editor'', and it provides a way
  749. to browse through the contents of a directory from with MG.  Dired puts
  750. a directory listing into a buffer; you can use normal editing commands to
  751. move around the buffer, and a special group of commands to manipulate
  752. the files.  For example, there are commands to delete and rename files,
  753. and to read a file into an MG buffer.
  754. Since dired mode rebinds many keys, a table may be helpful:
  755. \begin{verbatim}
  756.     C-d      dired-flag-file-deleted
  757.     SPC      next-line
  758.     c        dired-copy-file
  759.     d        dired-flag-file-deleted
  760.     e        dired-find-file
  761.     f        dired-find-file
  762.     n        next-line
  763.     o        dired-find-file-other-window
  764.     p        previous-line
  765.     r        dired-renamefile
  766.     u        dired-unflag
  767.     x        dired-do-deletions
  768.     DEL      dired-backup-unflag
  769. \end{verbatim}
  770. The commands in this section are disabled by defining NO\_DIRED.
  771. \fname{dired}{directory-name}{C-x d}
  772. \fbody Creates a dired buffer for the given directory name, and displays
  773. it in the current window.  The files
  774. in the directory are listed, usually along with information about the
  775. file such as its size and timestamp.  The exact format of the information
  776. is system-specific.
  777. \fname{dired-backup-unflag}{}{}
  778. \fbody This function removes the deletion flag from the file listed on
  779. the previous line of the dired buffer.
  780. \fname{dired-copy-file}{new-name}{}
  781. \fbody Copy the file listed on the current line of the dired buffer.
  782. \fname{dired-do-deletions}{}{}
  783. \fbody Deletes the files that have been flagged for deletion.
  784. \fname{dired-find-file}{}{}
  785. \fmore{dired-find-file-other-window}{}{}
  786. \fbody These function works like {\tt find-file} and 
  787. {\tt find-file-other-window}, except that the filename is taken 
  788. from the current line in the dired buffer.
  789. \fname{dired-flag-file-deleted}{}{}
  790. \fbody Flag the file listed on the current line for deletion.  This is
  791. indicated in the buffer by putting a ``D'' at the left margin.  No
  792. files are not actually deleted until the function {\tt dired-do-deletions}
  793. is executed.
  794. \fname{dired-other-window}{directory-name}{}
  795. \fbody This function works just like {\tt dired}, except that it puts the
  796. dired buffer in the ``other'' window.
  797. \fname{dired-rename-file}{new-name}{}
  798. \fbody Renames the file listed on the current line of the dired buffer.  
  799. Note that the dired buffer is not updated to reflect the change.
  800. \fname{dired-unflag}{}{}
  801. \fbody Remove the deletion flag for the file on the current line.
  802. \chapter{Miscellaneous}
  803. \section{Help}
  804. Most of the commands in this section write useful information to the
  805. {\tt *help*} buffer, which is then displayed in the ``other'' window.
  806. These commands can be disabled at compile-time by defining NO\_HELP.
  807. \fname{apropos}{topic}{C-h a}
  808. \fbody This command lists all functions whose names contain a string
  809. matching {\em topic\/} in the {\tt *help*} buffer.
  810. \fname{describe-bindings}{}{C-h b}
  811. \fbody Information about the key bindings in effect in the current buffer
  812. is listed in the {\tt *help*} buffer.
  813. \fname{describe-key-briefly}{key}{C-h c}
  814. \fbody Information about the binding of {\em key\/} is printed in the
  815. minibuffer.
  816. \fname{help-help}{option}{C-h C-h}
  817. \fbody This command lists all of the help options available and
  818. prompts for which one to run.  Currently, these include only {\tt a}
  819. to run {\tt apropos}, {\tt b} to run {\tt describe-bindings}, and {\tt c}
  820. to run {\tt describe-key-briefly}.
  821. \section{Keyboard Macros}
  822. A keyboard macro is a saved set of commands from the keyboard that can be
  823. reexecuted later on.  There can only be one keyboard macro defined at
  824. any one time.
  825. The commands in this section are available unless they have been disabled
  826. by defining NO\_MACRO.
  827. \fname{call-last-kbd-macro}{}{C-x e}
  828. \fbody Execute the saved keyboard macro.  A prefix argument can be used
  829. to specify a repetition count.
  830. \fname{end-kbd-macro}{}{C-x )}
  831. \fmore{start-kbd-macro}{}{C-x (}
  832. \fbody These functions are used to define a keyboard macro.  All keys
  833. entered after {\tt start-kbd-macro} is executed, up to a {\tt end-kbd-macro},
  834. are remembered as they are executed.  You can then reexecute the same
  835. sequence of operations using {\tt call-last-kbd-macro}.
  836. \section{Changing Case}
  837. MG provides a number of functions for changing the case of text.
  838. \fname{capitalize-word}{}{M-c}
  839. \fmore{downcase-region}{}{C-x C-l}
  840. \fmore{downcase-word}{}{M-l}
  841. \fmore{upcase-region}{}{C-x C-u}
  842. \fmore{upcase-word}{}{M-u}
  843. \fbody All of these commands do the obvious.
  844. \section{Odds and Ends}
  845. This section describes miscellaneous commands that don't fit into any
  846. particular category.
  847. \fname{emacs-version}{}{}
  848. \fbody Prints information about the version of MG you are running in
  849. the minibuffer.
  850. \fname{meta-key-mode}{}{}
  851. \fbody If the particular version of MG you are running supports a meta key,
  852. this function can be used to determine whether MG actually pays attention
  853. to it or not.  If no prefix argument is supplied, the internal variable
  854. that controls the use of the meta key is toggled; a positive value enables
  855. the meta key, while a negative value disables it.
  856. \fname{prefix-region}{}{}
  857. \fmore{set-prefix-string}{string}{}
  858. \fbody {\tt Prefix-region} is used to prefix each line of the region
  859. with a string.  This is useful for indenting quoted text, making block
  860. comments, and the like.  The function {\tt set-prefix-string} can be
  861. used to set the string used as the prefix.
  862. \fname{suspend-emacs}{}{C-z} 
  863. \fbody This command temporarily suspends
  864. MG so that you can run other programs, and later resume editing.  The
  865. exact behavior depends on which operating system you are running MG
  866. under.  Typically, MG will either spawn a new shell as a subprocess, or
  867. return you to the parent process.
  868. \fname{transpose-chars}{}{C-t}
  869. \fbody This command transposes the previous two characters.
  870. \chapter{Customization}
  871. MG provides a limited support for customization.  However, unlike ``real'' 
  872. Emacs, there is no extension language for interpretively defining new 
  873. functions.
  874. \section{Key Bindings}
  875. MG allows keys to be rebound locally or globally.  To understand the
  876. difference between the two, some discussion on how modes are implemented
  877. is necessary.
  878. An internal data structure called a keymap is used to look up the
  879. function that is bound to a particular key.  The keymap for
  880. fundamental mode contains all of the default bindings which are listed
  881. with the command descriptions in this manual.  Modes define additional
  882. keymaps that are searched for a binding before the fundamental mode
  883. keymap is examined.  Keymaps have the same name as the mode they are
  884. associated with.
  885. MG does not provide commands for defining new modes, but you can alter
  886. the keymaps for existing modes.
  887. \fname{define-key}{keymap-name key command}{}
  888. \fbody This command can be used to modify the keymap for the named mode.
  889. \fname{global-set-key}{key command}{}
  890. \fmore{global-unset-key}{key}{}
  891. \fbody These commands modify the keymap for fundamental mode.  Bindings
  892. established by {\tt global-set-key} will be inherited by all other modes, 
  893. as long as they do not establish local rebindings of the same key.
  894. \fname{local-set-key}{key command}{}
  895. \fmore{local-unset-key}{key}{}
  896. \fbody These commands modify the keymap currently in effect.
  897. \section{Startup Files}
  898. Although MG does not include a general-purpose extension language, it
  899. does provide a way to read and evaluate commands using a somewhat
  900. different syntax than that used for executing extended commands.  This
  901. is typically used in a startup file to modify key bindings.
  902. A startup file consists of one or more expressions.  Each expression must
  903. appear on a separate line in the file; there may not be more than one
  904. expression per line, nor may expressions span across line breaks.
  905. Whitespace (spaces and tabs) separate the tokens in an expression.  For
  906. historical reasons, parentheses are also considered to be whitespace in
  907. this context.  A semicolon acts as a comment character, causing the rest
  908. of the line to be discarded.
  909. An expression consists of a function name, an optional prefix argument
  910. (given as an integer constant), and arguments to be passed to the
  911. function.  If an argument includes literal whitespace or nonprintable
  912. characters (for example, as in a keystroke argument to one of the key
  913. binding functions described in the previous section), it must be
  914. supplied as a string constant enclosed in double quotes. 
  915. Within string constants, the following backslash escapes are available
  916. to specify nonprintable characters:
  917. \begin{define}{\hspace{1in}}
  918. \item[{\tt $\backslash$t, $\backslash$T}\hfill] Tab 
  919. \item[{\tt $\backslash$n, $\backslash$N}\hfill] Newline 
  920. \item[{\tt $\backslash$r, $\backslash$R}\hfill] Carriage return 
  921. \item[{\tt $\backslash$e, $\backslash$E}\hfill] Escape (Meta prefix) 
  922. \item[{\tt $\backslash$\^{ }}\hfill] Control prefix 
  923. \item[{\tt $\backslash${\em n\/}}\hfill] Specifies a character by its
  924. ASCII code, where {\em n\/} may consist of from one to three octal
  925. digits
  926. \item[{\tt $\backslash$f{\em n\/}, $\backslash$F{\em n\/}}\hfill]
  927. Specifies the keycode for the {\em n\/}th function key.  {\em N\/} may
  928. consist of one or two decimal digits. 
  929. \end{define}
  930. The following commands which deal with evaluation of expressions are
  931. disabled by defining the compile-time option NO\_STARTUP.  See the
  932. implementation notes for your particular version of MG for information
  933. on how it handles startup files. 
  934. \fname{eval-current-buffer}{}{}
  935. \fbody Evaluate the expressions in the current buffer.
  936. \fname{eval-expression}{expression}{}
  937. \fbody Evaluate the expression supplied.
  938. \fname{load}{file-name}{}
  939. \fbody Read in the specified file and evaluate its contents.
  940. \twocolumn[\Huge{\vspace{2em}{\bf Fundamental Mode Key Bindings}\vspace{1.5em}}]
  941. \addcontentsline{toc}{chapter}{Fundamental Mode Key Bindings}
  942. \begin{verbatim}
  943. NUL       set-mark-command
  944. C-a       beginning-of-line
  945. C-b       backward-char
  946. C-d       delete-char
  947. C-e       end-of-line
  948. C-f       forward-char
  949. C-g       keyboard-quit
  950. C-h       help
  951. TAB       self-insert-command
  952. C-j       newline-and-indent
  953. C-k       kill-line
  954. C-l       recenter
  955. RET       newline
  956. C-n       next-line
  957. C-o       open-line
  958. C-p       previous-line
  959. C-q       quoted-insert
  960. C-r       isearch-backward
  961. C-s       isearch-forward
  962. C-t       transpose-chars
  963. C-u       universal-argument
  964. C-v       scroll-up
  965. C-w       kill-region
  966. C-x       c-x prefix
  967. C-y       yank
  968. C-z       suspend-emacs
  969. ESC       meta prefix
  970. SPC .. ~  self-insert-command
  971. DEL       delete-backward-char
  972. C-h C-g   keyboard-quit
  973. C-h C-h   help-help
  974. C-h a     apropos
  975. C-h b     describe-bindings
  976. C-h c     describe-key-briefly
  977. C-x C-b   list-buffers
  978. C-x C-c   save-buffers-kill-emacs
  979. C-x C-f   find-file
  980. C-x C-g   keyboard-quit
  981. C-x C-l   downcase-region
  982. C-x C-o   delete-blank-lines
  983. C-x C-s   save-buffer
  984. C-x C-u   upcase-region
  985. C-x C-w   write-file
  986. C-x C-x   exchange-point-and-mark
  987. C-x (     start-kbd-macro
  988. C-x )     end-kbd-macro
  989. C-x 0     delete-window
  990. C-x 1     delete-other-windows
  991. C-x 2     split-window-vertically
  992. C-x 4     c-x 4 prefix
  993. C-x =     what-cursor-position
  994. C-x ^     enlarge-window
  995. C-x b     switch-to-buffer
  996. C-x d     dired
  997. C-x e     call-last-kbd-macro
  998. C-x f     set-fill-column
  999. C-x i     insert-file
  1000. C-x k     kill-buffer
  1001. C-x o     other-window
  1002. C-x s     save-some-buffers
  1003. C-x 4 C-f find-file-other-window
  1004. C-x 4 C-g keyboard-quit
  1005. C-x 4 b   switch-to-buffer-other-window
  1006. C-x 4 f   find-file-other-window
  1007. M-C-g     keyboard-quit
  1008. M-C-v     scroll-other-window
  1009. M-SPC     just-one-space
  1010. M-%       query-replace
  1011. M--       negative-argument
  1012. M-0       digit-argument
  1013. M-1       digit-argument
  1014. M-2       digit-argument
  1015. M-3       digit-argument
  1016. M-4       digit-argument
  1017. M-5       digit-argument
  1018. M-6       digit-argument
  1019. M-7       digit-argument
  1020. M-8       digit-argument
  1021. M-9       digit-argument
  1022. M-<       beginning-of-buffer
  1023. M->       end-of-buffer
  1024. M-[       backward-paragraph
  1025. M-\       delete-horizontal-space
  1026. M-]       forward-paragraph
  1027. M-b       backward-word
  1028. M-c       capitalize-word
  1029. M-d       kill-word
  1030. M-f       forward-word
  1031. M-l       downcase-word
  1032. M-q       fill-paragraph
  1033. M-r       search-backward
  1034. M-s       search-forward
  1035. M-u       upcase-word
  1036. M-v       scroll-down
  1037. M-w       copy-region-as-kill
  1038. M-x       execute-extended-command
  1039. M-~       not-modified
  1040. M-DEL     backward-kill-word
  1041. \end{verbatim}
  1042. \begin{theindex}
  1043. \addcontentsline{toc}{chapter}{Index}
  1044. \input{mgidx.tex}
  1045. \end{theindex}
  1046. \end{document}
  1047. SHAR_EOF
  1048. cat << \SHAR_EOF > mgidx.tex
  1049. \indexentry{apropos}{31}
  1050. \indexentry{auto-fill-mode}{27}
  1051. \indexentry{auto-indent-mode}{28}
  1052. \indexentry{backward-char}{9}
  1053. \indexentry{backward-kill-word}{14}
  1054. \indexentry{backward-paragraph}{9}
  1055. \indexentry{backward-word}{9}
  1056. \indexentry{beginning-of-buffer}{9}
  1057. \indexentry{beginning-of-line}{9}
  1058. \indexentry{blink-matching-paren}{28}
  1059. \indexentry{blink-matching-paren-hack}{28}
  1060. \indexentry{call-last-kbd-macro}{32}
  1061. \indexentry{capitalize-word}{32}
  1062. \indexentry{cd}{25}
  1063. \indexentry{copy-region-as-kill}{14}
  1064. \indexentry{count-matches}{19}
  1065. \indexentry{count-non-matches}{19}
  1066. \indexentry{define-key}{34}
  1067. \indexentry{delete-backward-char}{14}
  1068. \indexentry{delete-blank-lines}{14}
  1069. \indexentry{delete-char}{14}
  1070. \indexentry{delete-horizontal-space}{15}
  1071. \indexentry{delete-matching-lines}{19}
  1072. \indexentry{delete-non-matching-lines}{19}
  1073. \indexentry{delete-other-windows}{21}
  1074. \indexentry{delete-window}{21}
  1075. \indexentry{describe-bindings}{31}
  1076. \indexentry{describe-key-briefly}{31}
  1077. \indexentry{digit-argument}{8}
  1078. \indexentry{dired}{29}
  1079. \indexentry{dired-backup-unflag}{29}
  1080. \indexentry{dired-copy-file}{29}
  1081. \indexentry{dired-do-deletions}{29}
  1082. \indexentry{dired-find-file}{29}
  1083. \indexentry{dired-find-file-other-window}{29}
  1084. \indexentry{dired-flag-file-deleted}{29}
  1085. \indexentry{dired-other-window}{30}
  1086. \indexentry{dired-rename-file}{30}
  1087. \indexentry{dired-unflag}{30}
  1088. \indexentry{downcase-region}{32}
  1089. \indexentry{downcase-word}{32}
  1090. \indexentry{emacs-version}{32}
  1091. \indexentry{end-kbd-macro}{32}
  1092. \indexentry{end-of-buffer}{9}
  1093. \indexentry{end-of-line}{10}
  1094. \indexentry{enlarge-window}{21}
  1095. \indexentry{eval-current-buffer}{36}
  1096. \indexentry{eval-expression}{36}
  1097. \indexentry{exchange-point-and-mark}{10}
  1098. \indexentry{execute-extended-command}{8}
  1099. \indexentry{fill-paragraph}{27}
  1100. \indexentry{find-file}{24}
  1101. \indexentry{find-file-other-window}{24}
  1102. \indexentry{forward-char}{10}
  1103. \indexentry{forward-paragraph}{10}
  1104. \indexentry{forward-word}{10}
  1105. \indexentry{global-set-key}{34}
  1106. \indexentry{global-unset-key}{34}
  1107. \indexentry{goto-line}{10}
  1108. \indexentry{help-help}{31}
  1109. \indexentry{insert}{12}
  1110. \indexentry{insert-buffer}{23}
  1111. \indexentry{insert-file}{24}
  1112. \indexentry{insert-with-wrap}{27}
  1113. \indexentry{isearch-backward}{16}
  1114. \indexentry{isearch-forward}{16}
  1115. \indexentry{just-one-space}{15}
  1116. \indexentry{keyboard-quit}{8}
  1117. \indexentry{kill-buffer}{23}
  1118. \indexentry{kill-line}{15}
  1119. \indexentry{kill-paragraph}{15}
  1120. \indexentry{kill-region}{15}
  1121. \indexentry{kill-word}{15}
  1122. \indexentry{list-buffers}{23}
  1123. \indexentry{load}{36}
  1124. \indexentry{local-set-key}{34}
  1125. \indexentry{local-unset-key}{35}
  1126. \indexentry{make-backup-files}{25}
  1127. \indexentry{meta-key-mode}{32}
  1128. \indexentry{negative-argument}{8}
  1129. \indexentry{newline}{12}
  1130. \indexentry{newline-and-indent}{12}
  1131. \indexentry{next-line}{10}
  1132. \indexentry{no-tab-mode}{26}
  1133. \indexentry{not-modified}{24}
  1134. \indexentry{open-line}{12}
  1135. \indexentry{other-window}{21}
  1136. \indexentry{overwrite-mode}{27}
  1137. \indexentry{prefix-region}{33}
  1138. \indexentry{previous-line}{10}
  1139. \indexentry{previous-window}{22}
  1140. \indexentry{pwd}{25}
  1141. \indexentry{query-replace}{17}
  1142. \indexentry{query-replace-regexp}{19}
  1143. \indexentry{quoted-insert}{12}
  1144. \indexentry{re-search-again}{20}
  1145. \indexentry{re-search-backward}{20}
  1146. \indexentry{re-search-forward}{20}
  1147. \indexentry{recenter}{10}
  1148. \indexentry{redraw-display}{11}
  1149. \indexentry{save-buffer}{24}
  1150. \indexentry{save-buffers-kill-emacs}{24}
  1151. \indexentry{save-some-buffers}{25}
  1152. \indexentry{scroll-down}{11}
  1153. \indexentry{scroll-one-line-down}{11}
  1154. \indexentry{scroll-one-line-up}{11}
  1155. \indexentry{scroll-other-window}{11}
  1156. \indexentry{scroll-up}{11}
  1157. \indexentry{search-again}{17}
  1158. \indexentry{search-backward}{17}
  1159. \indexentry{search-forward}{17}
  1160. \indexentry{self-insert-command}{13}
  1161. \indexentry{set-case-fold-search}{20}
  1162. \indexentry{set-default-mode}{26}
  1163. \indexentry{set-fill-column}{27}
  1164. \indexentry{set-mark-command}{11}
  1165. \indexentry{set-prefix-string}{33}
  1166. \indexentry{shrink-window}{22}
  1167. \indexentry{space-to-tabstop}{26}
  1168. \indexentry{split-window-vertically}{22}
  1169. \indexentry{start-kbd-macro}{32}
  1170. \indexentry{suspend-emacs}{33}
  1171. \indexentry{switch-to-buffer}{24}
  1172. \indexentry{switch-to-buffer-other-window}{24}
  1173. \indexentry{transpose-chars}{33}
  1174. \indexentry{universal-argument}{8}
  1175. \indexentry{upcase-region}{32}
  1176. \indexentry{upcase-word}{32}
  1177. \indexentry{what-cursor-position}{11}
  1178. \indexentry{write-file}{25}
  1179. \indexentry{yank}{15}
  1180. SHAR_EOF
  1181. #    End of shell archive
  1182. exit 0
  1183. -------
  1184.