home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / utility / misc / e1858src.lha / emacs-18.58 / info / emacs-6 < prev    next >
Encoding:
GNU Info File  |  1992-02-21  |  49.6 KB  |  1,205 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.43 from the
  2. input file emacs.tex.
  3.  
  4.    This file documents the GNU Emacs editor.
  5.  
  6.    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.
  7.  
  8.    Permission is granted to make and distribute verbatim copies of
  9. this manual provided the copyright notice and this permission notice
  10. are preserved on all copies.
  11.  
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided also
  14. that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
  15. General Public License" are included exactly as in the original, and
  16. provided that the entire resulting derived work is distributed under
  17. the terms of a permission notice identical to this one.
  18.  
  19.    Permission is granted to copy and distribute translations of this
  20. manual into another language, under the above conditions for modified
  21. versions, except that the sections entitled "The GNU Manifesto",
  22. "Distribution" and "GNU General Public License" may be included in a
  23. translation approved by the author instead of in the original English.
  24.  
  25. 
  26. File: emacs,  Node: Windows,  Next: Major Modes,  Prev: Buffers,  Up: Top
  27.  
  28. Multiple Windows
  29. ****************
  30.  
  31.    Emacs can split the screen into two or many windows, which can
  32. display parts of different buffers, or different parts of one buffer.
  33.  
  34. * Menu:
  35.  
  36. * Basic Window::     Introduction to Emacs windows.
  37. * Split Window::     New windows are made by splitting existing windows.
  38. * Other Window::     Moving to another window or doing something to it.
  39. * Pop Up Window::    Finding a file or buffer in another window.
  40. * Change Window::    Deleting windows and changing their sizes.
  41.  
  42. 
  43. File: emacs,  Node: Basic Window,  Next: Split Window,  Prev: Windows,  Up: Windows
  44.  
  45. Concepts of Emacs Windows
  46. =========================
  47.  
  48.    When multiple windows are being displayed, each window has an Emacs
  49. buffer designated for display in it.  The same buffer may appear in
  50. more than one window; if it does, any changes in its text are
  51. displayed in all the windows where it appears.  But the windows
  52. showing the same buffer can show different parts of it, because each
  53. window has its own value of point.
  54.  
  55.    At any time, one of the windows is the "selected window"; the buffer
  56. this window is displaying is the current buffer.  The terminal's cursor
  57. shows the location of point in this window.  Each other window has a
  58. location of point as well, but since the terminal has only one cursor
  59. there is no way to show where those locations are.
  60.  
  61.    Commands to move point affect the value of point for the selected
  62. Emacs window only.  They do not change the value of point in any other
  63. Emacs window, even one showing the same buffer.  The same is true for
  64. commands such as `C-x b' to change the selected buffer in the selected
  65. window; they do not affect other windows at all.  However, there are
  66. other commands such as `C-x 4 b' that select a different window and
  67. switch buffers in it.  Also, all commands that display information in
  68. a window, including (for example) `C-h f' (`describe-function') and
  69. `C-x C-b' (`list-buffers'), work by switching buffers in a nonselected
  70. window without affecting the selected window.
  71.  
  72.    Each window has its own mode line, which displays the buffer name,
  73. modification status and major and minor modes of the buffer that is
  74. displayed in the window.  *Note Mode Line::, for full details on the
  75. mode line.
  76.  
  77. 
  78. File: emacs,  Node: Split Window,  Next: Other Window,  Prev: Basic Window,  Up: Windows
  79.  
  80. Splitting Windows
  81. =================
  82.  
  83. `C-x 2'
  84.      Split the selected window into two windows, one above the other
  85.      (`split-window-vertically').
  86.  
  87. `C-x 5'
  88.      Split the selected window into two windows positioned side by side
  89.      (`split-window-horizontally').
  90.  
  91.    The command `C-x 2' (`split-window-vertically') breaks the selected
  92. window into two windows, one above the other.  Both windows start out
  93. displaying the same buffer, with the same value of point.  By default
  94. the two windows each get half the height of the window that was split;
  95. a numeric argument specifies how many lines to give to the top window.
  96.  
  97.    `C-x 5' (`split-window-horizontally') breaks the selected window
  98. into two side-by-side windows.  A numeric argument specifies how many
  99. columns to give the one on the left.  A line of vertical bars
  100. separates the two windows.  Windows that are not the full width of the
  101. screen have mode lines, but they are truncated; also, they do not
  102. always appear in inverse video, because, the Emacs display routines
  103. have not been taught how to display a region of inverse video that is
  104. only part of a line on the screen.
  105.  
  106.    When a window is less than the full width, text lines too long to
  107. fit are frequent.  Continuing all those lines might be confusing.  The
  108. variable `truncate-partial-width-windows' can be set non-`nil' to force
  109. truncation in all windows less than the full width of the screen,
  110. independent of the buffer being displayed and its value for
  111. `truncate-lines'.  *Note Continuation Lines::.
  112.  
  113.    Horizontal scrolling is often used in side-by-side windows.  *Note
  114. Display::.
  115.  
  116. 
  117. File: emacs,  Node: Other Window,  Next: Pop Up Window,  Prev: Split Window,  Up: Windows
  118.  
  119. Using Other Windows
  120. ===================
  121.  
  122. `C-x o'
  123.      Select another window (`other-window').  That is `o', not zero.
  124.  
  125. `C-M-v'
  126.      Scroll the next window (`scroll-other-window').
  127.  
  128. `M-x compare-windows'
  129.      Find next place where the text in the selected window does not
  130.      match the text in the next window.
  131.  
  132.    To select a different window, use `C-x o' (`other-window').  That
  133. is an `o', for `other', not a zero.  When there are more than two
  134. windows, this command moves through all the windows in a cyclic order,
  135. generally top to bottom and left to right.  From the rightmost and
  136. bottommost window, it goes back to the one at the upper left corner.  A
  137. numeric argument means to move several steps in the cyclic order of
  138. windows.  A negative argument moves around the cycle in the opposite
  139. order.  When the minibuffer is active, the minibuffer is the last
  140. window in the cycle; you can switch from the minibuffer window to one
  141. of the other windows, and later switch back and finish supplying the
  142. minibuffer argument that is requested.  *Note Minibuffer Edit::.
  143.  
  144.    The usual scrolling commands (*note Display::.) apply to the
  145. selected window only, but there is one command to scroll the next
  146. window.  `C-M-v' (`scroll-other-window') scrolls the window that `C-x
  147. o' would select.  It takes arguments, positive and negative, like
  148. `C-v'.
  149.  
  150.    The command `M-x compare-windows' compares the text in the current
  151. window with that in the next window.  Comparison starts at point in
  152. each window.  Point moves forward in each window, a character at a
  153. time in each window, until the next characters in the two windows are
  154. different.  Then the command is finished.
  155.  
  156. 
  157. File: emacs,  Node: Pop Up Window,  Next: Change Window,  Prev: Other Window,  Up: Windows
  158.  
  159. Displaying in Another Window
  160. ============================
  161.  
  162.    `C-x 4' is a prefix key for commands that select another window
  163. (splitting the window if there is only one) and select a buffer in that
  164. window.  Different `C-x 4' commands have different ways of finding the
  165. buffer to select.
  166.  
  167. `C-x 4 b BUFNAME RET'
  168.      Select buffer BUFNAME in another window.  This runs 
  169.       `switch-to-buffer-other-window'.
  170.  
  171. `C-x 4 f FILENAME RET'
  172.      Visit file FILENAME and select its buffer in another window.  This
  173.      runs `find-file-other-window'.  *Note Visiting::.
  174.  
  175. `C-x 4 d DIRECTORY RET'
  176.      Select a Dired buffer for directory DIRECTORY in another window. 
  177.      This runs `dired-other-window'.  *Note Dired::.
  178.  
  179. `C-x 4 m'
  180.      Start composing a mail message in another window.  This runs
  181.      `mail-other-window', and its same-window version is `C-x m'
  182.      (*note Sending Mail::.).
  183.  
  184. `C-x 4 .'
  185.      Find a tag in the current tag table in another window.  This runs
  186.      `find-tag-other-window', the multiple-window variant of `M-.'
  187.      (*note Tags::.).
  188.  
  189. 
  190. File: emacs,  Node: Change Window,  Prev: Pop Up Window,  Up: Windows
  191.  
  192. Deleting and Rearranging Windows
  193. ================================
  194.  
  195. `C-x 0'
  196.      Get rid of the selected window (`kill-window').  That is a zero.
  197.  
  198. `C-x 1'
  199.      Get rid of all windows except the selected one
  200.      (`delete-other-windows').
  201.  
  202. `C-x ^'
  203.      Make the selected window taller, at the expense of the other(s)
  204.      (`enlarge-window').
  205.  
  206. `C-x }'
  207.      Make the selected window wider (`enlarge-window-horizontally').
  208.  
  209.    To delete a window, type `C-x 0' (`delete-window').  (That is a
  210. zero.)  The space occupied by the deleted window is distributed among
  211. the other active windows (but not the minibuffer window, even if that
  212. is active at the time).  Once a window is deleted, its attributes are
  213. forgotten; there is no automatic way to make another window of the
  214. same shape or showing the same buffer.  But the buffer continues to
  215. exist, and you can select it in any window with `C-x b'.
  216.  
  217.    `C-x 1' (`delete-other-windows') is more powerful than `C-x 0'; it
  218. deletes all the windows except the selected one (and the minibuffer);
  219. the selected window expands to use the whole screen except for the echo
  220. area.
  221.  
  222.    To readjust the division of space among existing windows, use `C-x
  223. ^' (`enlarge-window').  It makes the currently selected window get one
  224. line bigger, or as many lines as is specified with a numeric argument. 
  225. With a negative argument, it makes the selected window smaller.  `C-x
  226. }' (`enlarge-window-horizontally') makes the selected window wider by
  227. the specified number of columns.  The extra screen space given to a
  228. window comes from one of its neighbors, if that is possible;
  229. otherwise, all the competing windows are shrunk in the same
  230. proportion.  If this makes any windows too small, those windows are
  231. deleted and their space is divided up.  The minimum size is specified
  232. by the variables `window-min-height' and `window-min-width'.
  233.  
  234. 
  235. File: emacs,  Node: Major Modes,  Next: Indentation,  Prev: Windows,  Up: Top
  236.  
  237. Major Modes
  238. ***********
  239.  
  240.    Emacs has many different "major modes", each of which customizes
  241. Emacs for editing text of a particular sort.  The major modes are
  242. mutually exclusive, and each buffer has one major mode at any time. 
  243. The mode line normally contains the name of the current major mode, in
  244. parentheses.  *Note Mode Line::.
  245.  
  246.    The least specialized major mode is called "Fundamental mode".  This
  247. mode has no mode-specific redefinitions or variable settings, so that
  248. each Emacs command behaves in its most general manner, and each option
  249. is in its default state.  For editing any specific type of text, such
  250. as Lisp code or English text, you should switch to the appropriate
  251. major mode, such as Lisp mode or Text mode.
  252.  
  253.    Selecting a major mode changes the meanings of a few keys to become
  254. more specifically adapted to the language being edited.  The ones
  255. which are changed frequently are TAB, DEL, and LFD.  In addition, the
  256. commands which handle comments use the mode to determine how comments
  257. are to be delimited.  Many major modes redefine the syntactical
  258. properties of characters appearing in the buffer.  *Note Syntax::.
  259.  
  260.    The major modes fall into three major groups.  Lisp mode (which has
  261. several variants), C mode and Muddle mode are for specific programming
  262. languages.  Text mode, Nroff mode, TeX mode and Outline mode are for
  263. editing English text.  The remaining major modes are not intended for
  264. use on users' files; they are used in buffers created for specific
  265. purposes by Emacs, such as Dired mode for buffers made by Dired (*note
  266. Dired::.), and Mail mode for buffers made by `C-x m' (*note Sending
  267. Mail::.), and Shell mode for buffers used for communicating with an
  268. inferior shell process (*note Interactive Shell::.).
  269.  
  270.    Most programming language major modes specify that only blank lines
  271. separate paragraphs.  This is so that the paragraph commands remain
  272. useful.  *Note Paragraphs::.  They also cause Auto Fill mode to use
  273. the definition of TAB to indent the new lines it creates.  This is
  274. because most lines in a program are usually indented.  *Note
  275. Indentation::.
  276.  
  277. * Menu:
  278.  
  279. * Choosing Modes::     How major modes are specified or chosen.
  280.  
  281. 
  282. File: emacs,  Node: Choosing Modes,  Prev: Major Modes,  Up: Major Modes
  283.  
  284. How Major Modes are Chosen
  285. ==========================
  286.  
  287.    You can select a major mode explicitly for the current buffer, but
  288. most of the time Emacs determines which mode to use based on the file
  289. name or some text in the file.
  290.  
  291.    Explicit selection of a new major mode is done with a `M-x' command. 
  292. From the name of a major mode, add `-mode' to get the name of a
  293. command to select that mode.  Thus, you can enter Lisp mode by
  294. executing `M-x lisp-mode'.
  295.  
  296.    When you visit a file, Emacs usually chooses the right major mode
  297. based on the file's name.  For example, files whose names end in `.c'
  298. are edited in C mode.  The correspondence between file names and major
  299. mode is controlled by the variable `auto-mode-alist'.  Its value is a
  300. list in which each element has the form
  301.  
  302.      (REGEXP . MODE-FUNCTION)
  303.  
  304. For example, one element normally found in the list has the form
  305. `("\\.c$" . c-mode)', and it is responsible for selecting C mode for
  306. files whose names end in `.c'.  (Note that `\\' is needed in Lisp
  307. syntax to include a `\' in the string, which is needed to suppress the
  308. special meaning of `.' in regexps.)  The only practical way to change
  309. this variable is with Lisp code.
  310.  
  311.    You can specify which major mode should be used for editing a
  312. certain file by a special sort of text in the first nonblank line of
  313. the file.  The mode name should appear in this line both preceded and
  314. followed by `-*-'.  Other text may appear on the line as well.  For
  315. example,
  316.  
  317.      ;-*-Lisp-*-
  318.  
  319. tells Emacs to use Lisp mode.  Note how the semicolon is used to make
  320. Lisp treat this line as a comment.  Such an explicit specification
  321. overrides any defaulting based on the file name.
  322.  
  323.    Another format of mode specification is
  324.  
  325.      -*-Mode: MODENAME;-*-
  326.  
  327. which allows other things besides the major mode name to be specified. 
  328. However, Emacs does not look for anything except the mode name.
  329.  
  330.    The major mode can also be specified in a local variables list. 
  331. *Note File Variables::.
  332.  
  333.    When a file is visited that does not specify a major mode to use,
  334. or when a new buffer is created with `C-x b', the major mode used is
  335. that specified by the variable `default-major-mode'.  Normally this
  336. value is the symbol `fundamental-mode', which specifies Fundamental
  337. mode.  If `default-major-mode' is `nil', the major mode is taken from
  338. the previously selected buffer.
  339.  
  340. 
  341. File: emacs,  Node: Indentation,  Next: Text,  Prev: Major Modes,  Up: Top
  342.  
  343. Indentation
  344. ***********
  345.  
  346. `TAB'
  347.      Indent current line "appropriately" in a mode-dependent fashion.
  348.  
  349. `LFD'
  350.      Perform RET followed by TAB (`newline-and-indent').
  351.  
  352. `M-^'
  353.      Merge two lines (`delete-indentation').  This would cancel out
  354.      the effect of LFD.
  355.  
  356. `C-M-o'
  357.      Split line at point; text on the line after point becomes a new
  358.      line indented to the same column that it now starts in
  359.      (`split-line').
  360.  
  361. `M-m'
  362.      Move (forward or back) to the first nonblank character on the
  363.      current line (`back-to-indentation').
  364.  
  365. `C-M-\'
  366.      Indent several lines to same column (`indent-region').
  367.  
  368. `C-x TAB'
  369.      Shift block of lines rigidly right or left (`indent-rigidly').
  370.  
  371. `M-i'
  372.      Indent from point to the next prespecified tab stop column
  373.      (`tab-to-tab-stop').
  374.  
  375. `M-x indent-relative'
  376.      Indent from point to under an indentation point in the previous
  377.      line.
  378.  
  379.    Most programming languages have some indentation convention.  For
  380. Lisp code, lines are indented according to their nesting in
  381. parentheses.  The same general idea is used for C code, though many
  382. details are different.
  383.  
  384.    Whatever the language, to indent a line, use the TAB command.  Each
  385. major mode defines this command to perform the sort of indentation
  386. appropriate for the particular language.  In Lisp mode, TAB aligns the
  387. line according to its depth in parentheses.  No matter where in the
  388. line you are when you type TAB, it aligns the line as a whole.  In C
  389. mode, TAB implements a subtle and sophisticated indentation style that
  390. knows about many aspects of C syntax.
  391.  
  392.    In Text mode, TAB runs the command `tab-to-tab-stop', which indents
  393. to the next tab stop column.  You can set the tab stops with `M-x
  394. edit-tab-stops'.
  395.  
  396. * Menu:
  397.  
  398. * Indentation Commands:: Various commands and techniques for indentation.
  399. * Tab Stops::            You can set arbitrary "tab stops" and then
  400.                          indent to the next tab stop when you want to.
  401. * Just Spaces::          You can request indentation using just spaces.
  402.  
  403. 
  404. File: emacs,  Node: Indentation Commands,  Next: Tab Stops,  Prev: Indentation,  Up: Indentation
  405.  
  406. Indentation Commands and Techniques
  407. ===================================
  408.  
  409.    If you just want to insert a tab character in the buffer, you can
  410. type `C-q TAB'.
  411.  
  412.    To move over the indentation on a line, do `Meta-m'
  413. (`back-to-indentation').  This command, given anywhere on a line,
  414. positions point at the first nonblank character on the line.
  415.  
  416.    To insert an indented line before the current line, do `C-a C-o
  417. TAB'.  To make an indented line after the current line, use `C-e LFD'.
  418.  
  419.    `C-M-o' (`split-line') moves the text from point to the end of the
  420. line vertically down, so that the current line becomes two lines. 
  421. `C-M-o' first moves point forward over any spaces and tabs.  Then it
  422. inserts after point a newline and enough indentation to reach the same
  423. column point is on.  Point remains before the inserted newline; in this
  424. regard, `C-M-o' resembles `C-o'.
  425.  
  426.    To join two lines cleanly, use the `Meta-^' (`delete-indentation')
  427. command to delete the indentation at the front of the current line,
  428. and the line boundary as well.  They are replaced by a single space,
  429. or by no space if at the beginning of a line or before a `)' or after
  430. a `('.  To delete just the indentation of a line, go to the beginning
  431. of the line and use `Meta-\' (`delete-horizontal-space'), which
  432. deletes all spaces and tabs around the cursor.
  433.  
  434.    There are also commands for changing the indentation of several
  435. lines at once.  `Control-Meta-\' (`indent-region') gives each line
  436. which begins in the region the "usual" indentation by invoking TAB at
  437. the beginning of the line.  A numeric argument specifies the column to
  438. indent to, and each line is shifted left or right so that its first
  439. nonblank character appears in that column.  `C-x TAB'
  440. (`indent-rigidly') moves all of the lines in the region right by its
  441. argument (left, for negative arguments).  The whole group of lines
  442. moves rigidly sideways, which is how the command gets its name.
  443.  
  444.    `M-x indent-relative' indents at point based on the previous line
  445. (actually, the last nonempty line.)  It inserts whitespace at point,
  446. moving point, until it is underneath an indentation point in the
  447. previous line.  An indentation point is the end of a sequence of
  448. whitespace or the end of the line.  If point is farther right than any
  449. indentation point in the previous line, the whitespace before point is
  450. deleted and the first indentation point then applicable is used.  If
  451. no indentation point is applicable even then, `tab-to-tab-stop' is run
  452. (see next section).
  453.  
  454.    `indent-relative' is the definition of TAB in Indented Text mode. 
  455. *Note Text::.
  456.  
  457. 
  458. File: emacs,  Node: Tab Stops,  Next: Just Spaces,  Prev: Indentation Commands,  Up: Indentation
  459.  
  460. Tab Stops
  461. =========
  462.  
  463.    For typing in tables, you can use Text mode's definition of TAB,
  464. `tab-to-tab-stop'.  This command inserts indentation before point,
  465. enough to reach the next tab stop column.  If you are not in Text mode,
  466. this function can be found on `M-i' anyway.
  467.  
  468.    The tab stops used by `M-i' can be set arbitrarily by the user. 
  469. They are stored in a variable called `tab-stop-list', as a list of
  470. column-numbers in increasing order.
  471.  
  472.    The convenient way to set the tab stops is using `M-x
  473. edit-tab-stops', which creates and selects a buffer containing a
  474. description of the tab stop settings.  You can edit this buffer to
  475. specify different tab stops, and then type `C-c C-c' to make those new
  476. tab stops take effect.  In the tab stop buffer, `C-c C-c' runs the
  477. function `edit-tab-stops-note-changes' rather than its usual definition
  478. `save-buffer'.  `edit-tab-stops' records which buffer was current when
  479. you invoked it, and stores the tab stops back in that buffer; normally
  480. all buffers share the same tab stops and changing them in one buffer
  481. affects all, but if you happen to make `tab-stop-list' local in one
  482. buffer then `edit-tab-stops' in that buffer will edit the local
  483. settings.
  484.  
  485.    Here is what the text representing the tab stops looks like for
  486. ordinary tab stops every eight columns.
  487.  
  488.              :       :       :       :       :       :
  489.      0         1         2         3         4
  490.      0123456789012345678901234567890123456789012345678
  491.      To install changes, type C-c C-c
  492.  
  493.    The first line contains a colon at each tab stop.  The remaining
  494. lines are present just to help you see where the colons are and know
  495. what to do.
  496.  
  497.    Note that the tab stops that control `tab-to-tab-stop' have nothing
  498. to do with displaying tab characters in the buffer.  *Note Display
  499. Vars::, for more information on that.
  500.  
  501. 
  502. File: emacs,  Node: Just Spaces,  Prev: Tab Stops,  Up: Indentation
  503.  
  504. Tabs vs. Spaces
  505. ===============
  506.  
  507.    Emacs normally uses both tabs and spaces to indent lines.  If you
  508. prefer, all indentation can be made from spaces only.  To request
  509. this, set `indent-tabs-mode' to `nil'.  This is a per-buffer variable;
  510. altering the variable affects only the current buffer, but there is a
  511. default value which you can change as well.  *Note Locals::.
  512.  
  513.    There are also commands to convert tabs to spaces or vice versa,
  514. always preserving the columns of all nonblank text.  `M-x tabify'
  515. scans the region for sequences of spaces, and converts sequences of at
  516. least three spaces to tabs if that can be done without changing
  517. indentation.  `M-x untabify' changes all tabs in the region to
  518. appropriate numbers of spaces.
  519.  
  520. 
  521. File: emacs,  Node: Text,  Next: Programs,  Prev: Indentation,  Up: Top
  522.  
  523. Commands for Human Languages
  524. ****************************
  525.  
  526.    The term "text" has two widespread meanings in our area of the
  527. computer field.  One is data that is a sequence of characters.  Any
  528. file that you edit with Emacs is text, in this sense of the word.  The
  529. other meaning is more restrictive: a sequence of characters in a human
  530. language for humans to read (possibly after processing by a text
  531. formatter), as opposed to a program or commands for a program.
  532.  
  533.    Human languages have syntactic/stylistic conventions that can be
  534. supported or used to advantage by editor commands: conventions
  535. involving words, sentences, paragraphs, and capital letters.  This
  536. chapter describes Emacs commands for all of these things.  There are
  537. also commands for "filling", or rearranging paragraphs into lines of
  538. approximately equal length.  The commands for moving over and killing
  539. words, sentences and paragraphs, while intended primarily for editing
  540. text, are also often useful for editing programs.
  541.  
  542.    Emacs has several major modes for editing human language text.  If
  543. the file contains text pure and simple, use Text mode, which customizes
  544. Emacs in small ways for the syntactic conventions of text.  For text
  545. which contains embedded commands for text formatters, Emacs has other
  546. major modes, each for a particular text formatter.  Thus, for input to
  547. TeX, you would use TeX mode; for input to nroff, Nroff mode.
  548.  
  549. * Menu:
  550.  
  551. * Text Mode::   The major modes for editing text files.
  552. * Nroff Mode::  The major mode for editing input to the formatter nroff.
  553. * TeX Mode::    The major modes for editing input to the formatter TeX.
  554. * Outline Mode::The major mode for editing outlines.
  555. * Words::       Moving over and killing words.
  556. * Sentences::   Moving over and killing sentences.
  557. * Paragraphs::    Moving over paragraphs.
  558. * Pages::    Moving over pages.
  559. * Filling::     Filling or justifying text
  560. * Case::        Changing the case of text
  561.  
  562. 
  563. File: emacs,  Node: Text Mode,  Next: Words,  Prev: Text,  Up: Text
  564.  
  565. Text Mode
  566. =========
  567.  
  568.    Editing files of text in a human language ought to be done using
  569. Text mode rather than Lisp or Fundamental mode.  Invoke `M-x
  570. text-mode' to enter Text mode.  In Text mode, TAB runs the function
  571. `tab-to-tab-stop', which allows you to use arbitrary tab stops set
  572. with `M-x edit-tab-stops' (*note Tab Stops::.).  Features concerned
  573. with comments in programs are turned off except when explicitly
  574. invoked.  The syntax table is changed so that periods are not
  575. considered part of a word, while apostrophes, backspaces and
  576. underlines are.
  577.  
  578.    A similar variant mode is Indented Text mode, intended for editing
  579. text in which most lines are indented.  This mode defines TAB to run
  580. `indent-relative' (*note Indentation::.), and makes Auto Fill indent
  581. the lines it creates.  The result is that normally a line made by Auto
  582. Filling, or by LFD, is indented just like the previous line.  Use `M-x
  583. indented-text-mode' to select this mode.
  584.  
  585.    Entering Text mode or Indented Text mode calls with no arguments the
  586. value of the variable `text-mode-hook', if that value exists and is
  587. not `nil'.  This value is also called when modes related to Text mode
  588. are entered; this includes Nroff mode, TeX mode, Outline mode and Mail
  589. mode.  Your hook can look at the value of `major-mode' to see which of
  590. these modes is actually being entered.
  591.  
  592. * Menu:
  593.  
  594.   Two modes similar to Text mode are of use for editing text that is to
  595. be passed through a text formatter before achieving the form in which
  596. humans are to read it.
  597.  
  598. * Nroff Mode::  The major mode for editing input to the formatter nroff.
  599. * TeX Mode::    The major modes for editing input to the formatter TeX.
  600.  
  601.   Another similar mode is used for editing outlines.  It allows you
  602. to view the text at various levels of detail.  You can view either
  603. the outline headings alone or both headings and text; you can also
  604. hide some of the headings at lower levels from view to make the high
  605. level structure more visible.
  606.  
  607. * Outline Mode::The major mode for editing outlines.
  608.  
  609. 
  610. File: emacs,  Node: Nroff Mode,  Next: TeX Mode,  Prev: Text Mode,  Up: Text Mode
  611.  
  612. Nroff Mode
  613. ----------
  614.  
  615.    Nroff mode is a mode like Text mode but modified to handle nroff
  616. commands present in the text.  Invoke `M-x nroff-mode' to enter this
  617. mode.  It differs from Text mode in only a few ways.  All nroff
  618. command lines are considered paragraph separators, so that filling
  619. will never garble the nroff commands.  Pages are separated by `.bp'
  620. commands.  Comments start with backslash-doublequote.  Also, three
  621. special commands are provided that are not in Text mode:
  622.  
  623. `M-n'
  624.      Move to the beginning of the next line that isn't an nroff command
  625.      (`forward-text-line').  An argument is a repeat count.
  626.  
  627. `M-p'
  628.      Like `M-n' but move up (`backward-text-line').
  629.  
  630. `M-?'
  631.      Prints in the echo area the number of text lines (lines that are
  632.      not nroff commands) in the region (`count-text-lines').
  633.  
  634.    The other feature of Nroff mode is that you can turn on Electric
  635. Nroff newline mode.  This is a minor mode that you can turn on or off
  636. with `M-x electric-nroff-mode' (*note Minor Modes::.).  When the mode
  637. is on, each time you use RET to end a line that contains an nroff
  638. command that opens a kind of grouping, the matching nroff command to
  639. close that grouping is automatically inserted on the following line. 
  640. For example, if you are at the beginning of a line and type `. ( b
  641. RET', the matching command `.)b' will be inserted on a new line
  642. following point.
  643.  
  644.    Entering Nroff mode calls with no arguments the value of the
  645. variable `text-mode-hook', if that value exists and is not `nil'; then
  646. it does the same with the variable `nroff-mode-hook'.
  647.  
  648. 
  649. File: emacs,  Node: TeX Mode,  Next: Outline Mode,  Prev: Nroff Mode,  Up: Text Mode
  650.  
  651. TeX Mode
  652. --------
  653.  
  654.    TeX is a powerful text formatter written by Donald Knuth; it is also
  655. free, like GNU Emacs.  LaTeX is a simplified input format for TeX,
  656. implemented by TeX macros.  It comes with TeX.
  657.  
  658.    Emacs has a special TeX mode for editing TeX input files.  It
  659. provides facilities for checking the balance of delimiters and for
  660. invoking TeX on all or part of the file.
  661.  
  662.    TeX mode has two variants, Plain TeX mode and LaTeX mode (actually
  663. two distinct major modes which differ only slightly).  They are
  664. designed for editing the two different input formats.  The command `M-x
  665. tex-mode' looks at the contents of the buffer to determine whether the
  666. contents appear to be LaTeX input or not; it then selects the
  667. appropriate mode.  If it can't tell which is right (e.g., the buffer is
  668. empty), the variable `TeX-default-mode' controls which mode is used.
  669.  
  670.    The commands `M-x plain-tex-mode' and `M-x latex-mode' explicitly
  671. select the two variants of TeX mode.  Use these commands when `M-x
  672. tex-mode' does not guess right.
  673.  
  674. * Menu:
  675.  
  676. * Editing: TeX Editing.   Special commands for editing in TeX mode.
  677. * Printing: TeX Print.    Commands for printing part of a file with TeX.
  678.  
  679.    TeX for Unix systems can be obtained from the University of
  680. Washington for a distribution fee.
  681.  
  682.    To order a full distribution, send $140.00 for a 1/2 inch 9-track
  683. tape, $165.00 for two 4-track 1/4 inch cartridge tapes (foreign sites
  684. $150.00, for 1/2 inch, $175.00 for 1/4 inch, to cover the extra
  685. postage) payable to the University of Washington to:
  686.  
  687.      The Director
  688.      Northwest Computer Support Group,  DW-10
  689.      University of Washington
  690.      Seattle, Washington 98195
  691.  
  692. Purchase orders are acceptable, but there is an extra charge of
  693. $10.00, to pay for processing charges. (Total of $150 for domestic
  694. sites, $175 for foreign sites).
  695.  
  696.    The normal distribution is a tar tape, blocked 20, 1600 bpi, on an
  697. industry standard 2400 foot half-inch reel.  The physical format for
  698. the 1/4 inch streamer cartridges uses QIC-11, 8000 bpi, 4-track
  699. serpentine recording for the SUN.  Also, SystemV tapes can be written
  700. in cpio format, blocked 5120 bytes, ASCII headers.
  701.  
  702. 
  703. File: emacs,  Node: TeX Editing,  Next: TeX Print,  Prev: TeX Mode,  Up: TeX Mode
  704.  
  705. TeX Editing Commands
  706. ....................
  707.  
  708.    Here are the special commands provided in TeX mode for editing the
  709. text of the file.
  710.  
  711. `"'
  712.      Insert, according to context, either ```' or `"' or `'''
  713.      (`TeX-insert-quote').
  714.  
  715. `LFD'
  716.      Insert a paragraph break (two newlines) and check the previous
  717.      paragraph for unbalanced braces or dollar signs
  718.      (`TeX-terminate-paragraph').
  719.  
  720. `M-x validate-TeX-buffer'
  721.      Check each paragraph in the buffer for unbalanced braces or
  722.      dollar signs.
  723.  
  724. `M-{'
  725.      Insert `{}' and position point between them (`TeX-insert-braces').
  726.  
  727. `M-}'
  728.      Move forward past the next unmatched close brace (`up-list').
  729.  
  730. `C-c C-f'
  731.      Close a block for LaTeX (`TeX-close-LaTeX-block').
  732.  
  733.    In TeX, the character `"' is not normally used; one uses ```' to
  734. start a quotation and `''' to end one.  TeX mode defines the key `"'
  735. to insert ```' after whitespace or an open brace, `"' after a
  736. backslash, or `''' otherwise.  This is done by the command
  737. `TeX-insert-quote'.  If you need the character `"' itself in unusual
  738. contexts, use `C-q' to insert it.  Also, `"' with a numeric argument
  739. always inserts that number of `"' characters.
  740.  
  741.    In TeX mode, `$' has a special syntax code which attempts to
  742. understand the way TeX math mode delimiters match.  When you insert a
  743. `$' that is meant to exit math mode, the position of the matching `$'
  744. that entered math mode is displayed for a second.  This is the same
  745. feature that displays the open brace that matches a close brace that
  746. is inserted.  However, there is no way to tell whether a `$' enters
  747. math mode or leaves it; so when you insert a `$' that enters math
  748. mode, the previous `$' position is shown as if it were a match, even
  749. though they are actually unrelated.
  750.  
  751.    If you prefer to keep braces balanced at all times, you can use
  752. `M-{' (`TeX-insert-braces') to insert a pair of braces.  It leaves
  753. point between the two braces so you can insert the text that belongs
  754. inside.  Afterward, use the command `M-}' (`up-list') to move forward
  755. past the close brace.
  756.  
  757.    There are two commands for checking the matching of braces.  LFD
  758. (`TeX-terminate-paragraph') checks the paragraph before point, and
  759. inserts two newlines to start a new paragraph.  It prints a message in
  760. the echo area if any mismatch is found.  `M-x validate-TeX-buffer'
  761. checks the entire buffer, paragraph by paragraph.  When it finds a
  762. paragraph that contains a mismatch, it displays point at the beginning
  763. of the paragraph for a few seconds and pushes a mark at that spot. 
  764. Scanning continues until the whole buffer has been checked or until
  765. you type another key.  The positions of the last several paragraphs
  766. with mismatches can be found in the mark ring (*note Mark Ring::.).
  767.  
  768.    Note that square brackets and parentheses are matched in TeX mode,
  769. not just braces.  This is wrong for the purpose of checking TeX syntax. 
  770. However, parentheses and square brackets are likely to be used in text
  771. as matching delimiters and it is useful for the various motion
  772. commands and automatic match display to work with them.
  773.  
  774.    In LaTeX input, `\begin' and `\end' commands must balance.  After
  775. you insert a `\begin', use `C-c C-f' (`TeX-close-LaTeX-block') to
  776. insert automatically a matching `\end' (on a new line following the
  777. `\begin').  A blank line is inserted between the two, and point is
  778. left there.
  779.  
  780. 
  781. File: emacs,  Node: TeX Print,  Prev: TeX Editing,  Up: TeX Mode
  782.  
  783. TeX Printing Commands
  784. .....................
  785.  
  786.    You can invoke TeX as an inferior of Emacs on either the entire
  787. contents of the buffer or just a region at a time.  Running TeX in
  788. this way on just one chapter is a good way to see what your changes
  789. look like without taking the time to format the entire file.
  790.  
  791. `C-c C-r'
  792.      Invoke TeX on the current region, plus the buffer's header
  793.      (`TeX-region').
  794.  
  795. `C-c C-b'
  796.      Invoke TeX on the entire current buffer (`TeX-buffer').
  797.  
  798. `C-c C-l'
  799.      Recenter the window showing output from the inferior TeX so that
  800.      the last line can be seen (`TeX-recenter-output-buffer').
  801.  
  802. `C-c C-k'
  803.      Kill the inferior TeX (`TeX-kill-job').
  804.  
  805. `C-c C-p'
  806.      Print the output from the last `C-c C-r' or `C-c C-b' command
  807.      (`TeX-print').
  808.  
  809. `C-c C-q'
  810.      Show the printer queue (`TeX-show-print-queue').
  811.  
  812.    You can pass the current buffer through an inferior TeX by means of
  813. `C-c C-b' (`TeX-buffer').  The formatted output appears in a file in
  814. `/tmp'; to print it, type `C-c C-p' (`TeX-print').  Afterward use `C-c
  815. C-q' (`TeX-show-print-queue') to view the progress of your output
  816. towards being printed.
  817.  
  818.    The console output from TeX, including any error messages, appear
  819. in a buffer called `*TeX-shell*'.  If TeX gets an error, you can switch
  820. to this buffer and feed it input (this works as in Shell mode; *note
  821. Interactive Shell::.).  Without switching to this buffer you can scroll
  822. it so that its last line is visible by typing `C-c C-l'.
  823.  
  824.    Type `C-c C-k' (`TeX-kill-job') to kill the TeX process if you see
  825. that its output is no longer useful.  Using `C-c C-b' or `C-c C-r'
  826. also kills any TeX process still running.
  827.  
  828.    You can also pass an arbitrary region through an inferior TeX by
  829. typing `C-c C-r' (`TeX-region').  This is tricky, however, because
  830. most files of TeX input contain commands at the beginning to set
  831. parameters and define macros, without which no later part of the file
  832. will format correctly.  To solve this problem, `C-c C-r' allows you to
  833. designate a part of the file as containing essential commands; it is
  834. included before the specified region as part of the input to TeX.  The
  835. designated part of the file is called the "header".
  836.  
  837.    To indicate the bounds of the header in Plain TeX mode, you insert
  838. two special strings in the file.  Insert `%**start of header' before
  839. the header, and `%**end of header' after it.  Each string must appear
  840. entirely on one line, but there may be other text on the line before or
  841. after.  The lines containing the two strings are included in the
  842. header.  If `%**start of header' does not appear within the first 100
  843. lines of the buffer, `C-c C-r' assumes that there is no header.
  844.  
  845.    In LaTeX mode, the header begins with `\documentstyle' and ends
  846. with `\begin{document}'.  These are commands that LaTeX requires you
  847. to use in any case, so nothing special needs to be done to identify the
  848. header.
  849.  
  850.    Entering either kind of TeX mode calls with no arguments the value
  851. of the variable `text-mode-hook', if that value exists and is not
  852. `nil'; then it does the same with the variable `TeX-mode-hook'. 
  853. Finally it does the same with either `plain-TeX-mode-hook' or
  854. `LaTeX-mode-hook'.
  855.  
  856. 
  857. File: emacs,  Node: Outline Mode,  Prev: TeX Mode,  Up: Text Mode
  858.  
  859. Outline Mode
  860. ------------
  861.  
  862.    Outline mode is a major mode much like Text mode but intended for
  863. editing outlines.  It allows you to make parts of the text temporarily
  864. invisible so that you can see just the overall structure of the
  865. outline.  Type `M-x outline-mode' to turn on Outline mode in the
  866. current buffer.
  867.  
  868.    Entering Outline mode calls with no arguments the value of the
  869. variable `text-mode-hook', if that value exists and is not `nil'; then
  870. it does the same with the variable `outline-mode-hook'.
  871.  
  872.    When a line is invisible in outline mode, it does not appear on the
  873. screen.  The screen appears exactly as if the invisible line were
  874. deleted, except that an ellipsis (three periods in a row) appears at
  875. the end of the previous visible line (only one ellipsis no matter how
  876. many invisible lines follow).
  877.  
  878.    All editing commands treat the text of the invisible line as part
  879. of the previous visible line.  For example, `C-n' moves onto the next
  880. visible line.  Killing an entire visible line, including its
  881. terminating newline, really kills all the following invisible lines
  882. along with it; yanking it all back yanks the invisible lines and they
  883. remain invisible.
  884.  
  885. * Menu:
  886.  
  887. * Format: Outline Format.      What the text of an outline looks like.
  888. * Motion: Outline Motion.      Special commands for moving through outlines.
  889. * Visibility: Outline Visibility. Commands to control what is visible.
  890.  
  891. 
  892. File: emacs,  Node: Outline Format,  Next: Outline Motion,  Prev: Outline Mode,  Up: Outline Mode
  893.  
  894. Format of Outlines
  895. ..................
  896.  
  897.    Outline mode assumes that the lines in the buffer are of two types:
  898. "heading lines" and "body lines".  A heading line represents a topic
  899. in the outline.  Heading lines start with one or more stars; the
  900. number of stars determines the depth of the heading in the outline
  901. structure.  Thus, a heading line with one star is a major topic; all
  902. the heading lines with two stars between it and the next one-star
  903. heading are its subtopics; and so on.  Any line that is not a heading
  904. line is a body line.  Body lines belong to the preceding heading line.
  905.  Here is an example:
  906.  
  907.      * Food
  908.      
  909.      This is the body,
  910.      which says something about the topic of food.
  911.      
  912.      ** Delicious Food
  913.      
  914.      This is the body of the second-level header.
  915.      
  916.      ** Distasteful Food
  917.      
  918.      This could have
  919.      a body too, with
  920.      several lines.
  921.      
  922.      *** Dormitory Food
  923.      
  924.      * Shelter
  925.      
  926.      A second first-level topic with its header line.
  927.  
  928.    A heading line together with all following body lines is called
  929. collectively an "entry".  A heading line together with all following
  930. deeper heading lines and their body lines is called a "subtree".
  931.  
  932.    You can customize the criterion for distinguishing heading lines by
  933. setting the variable `outline-regexp'.  Any line whose beginning has a
  934. match for this regexp is considered a heading line.  Matches that
  935. start within a line (not at the beginning) do not count.  The length
  936. of the matching text determines the level of the heading; longer
  937. matches make a more deeply nested level.  Thus, for example, if a text
  938. formatter has commands `@chapter', `@section' and `@subsection' to
  939. divide the document into chapters and sections, you could make those
  940. lines count as heading lines by setting `outline-regexp' to
  941. `"@chap\\|@\\(sub\\)*section"'.  Note the trick: the two words
  942. `chapter' and `section' are equally long, but by defining the regexp
  943. to match only `chap' we ensure that the length of the text matched on
  944. a chapter heading is shorter, so that Outline mode will know that
  945. sections are contained in chapters.  This works as long as no other
  946. command starts with `@chap'.
  947.  
  948.    Outline mode makes a line invisible by changing the newline before
  949. it into an ASCII Control-M (code 015).  Most editing commands that
  950. work on lines treat an invisible line as part of the previous line
  951. because, strictly speaking, it is part of that line, since there is no
  952. longer a newline in between.  When you save the file in Outline mode,
  953. Control-M characters are saved as newlines, so the invisible lines
  954. become ordinary lines in the file.  But saving does not change the
  955. visibility status of a line inside Emacs.
  956.  
  957. 
  958. File: emacs,  Node: Outline Motion,  Next: Outline Visibility,  Prev: Outline Format,  Up: Outline Mode
  959.  
  960. Outline Motion Commands
  961. .......................
  962.  
  963.    There are some special motion commands in Outline mode that move
  964. backward and forward to heading lines.
  965.  
  966. `C-c C-n'
  967.      Move point to the next visible heading line
  968.      (`outline-next-visible-heading').
  969.  
  970. `C-c C-p'
  971.      Move point to the previous visible heading line 
  972.       (`outline-previous-visible-heading').
  973.  
  974. `C-c C-f'
  975.      Move point to the next visible heading line at the same level as
  976.      the one point is on (`outline-forward-same-level').
  977.  
  978. `C-c C-b'
  979.      Move point to the previous visible heading line at the same level
  980.      (`outline-backward-same-level').
  981.  
  982. `C-c C-u'
  983.      Move point up to a lower-level (more inclusive) visible heading
  984.      line (`outline-up-heading').
  985.  
  986.    `C-c C-n' (`next-visible-heading') moves down to the next heading
  987. line.  `C-c C-p' (`previous-visible-heading') moves similarly
  988. backward.  Both accept numeric arguments as repeat counts.  The names
  989. emphasize that invisible headings are skipped, but this is not really
  990. a special feature.  All editing commands that look for lines ignore the
  991. invisible lines automatically.
  992.  
  993.    More advanced motion commands understand the levels of headings. 
  994. The commands `C-c C-f' (`outline-forward-same-level') and `C-c C-b'
  995. (`outline-backward-same-level') move from one heading line to another
  996. visible heading at the same depth in the outline.  `C-c C-u'
  997. (`outline-up-heading') moves backward to another heading that is less
  998. deeply nested.
  999.  
  1000. 
  1001. File: emacs,  Node: Outline Visibility,  Prev: Outline Motion,  Up: Outline Mode
  1002.  
  1003. Outline Visibility Commands
  1004. ...........................
  1005.  
  1006.    The other special commands of outline mode are used to make lines
  1007. visible or invisible.  Their names all start with `hide' or `show'. 
  1008. Most of them fall into pairs of opposites.  They are not undoable;
  1009. instead, you can undo right past them.  Making lines visible or
  1010. invisible is simply not recorded by the undo mechanism.
  1011.  
  1012. `M-x hide-body'
  1013.      Make all body lines in the buffer invisible.
  1014.  
  1015. `M-x show-all'
  1016.      Make all lines in the buffer visible.
  1017.  
  1018. `C-c C-h'
  1019.      Make everything under this heading invisible, not including this
  1020.      heading itself
  1021.       (`hide-subtree').
  1022.  
  1023. `C-c C-s'
  1024.      Make everything under this heading visible, including body,
  1025.      subheadings, and their bodies (`show-subtree').
  1026.  
  1027. `M-x hide-leaves'
  1028.      Make the body of this heading line, and of all its subheadings,
  1029.      invisible.
  1030.  
  1031. `M-x show-branches'
  1032.      Make all subheadings of this heading line, at all levels, visible.
  1033.  
  1034. `C-c C-i'
  1035.      Make immediate subheadings (one level down) of this heading line
  1036.      visible (`show-children').
  1037.  
  1038. `M-x hide-entry'
  1039.      Make this heading line's body invisible.
  1040.  
  1041. `M-x show-entry'
  1042.      Make this heading line's body visible.
  1043.  
  1044.    Two commands that are exact opposites are `M-x hide-entry' and `M-x
  1045. show-entry'.  They are used with point on a heading line, and apply
  1046. only to the body lines of that heading.  The subtopics and their
  1047. bodies are not affected.
  1048.  
  1049.    Two more powerful opposites are `C-c C-h' (`hide-subtree') and `C-c
  1050. C-s' (`show-subtree').  Both expect to be used when point is on a
  1051. heading line, and both apply to all the lines of that heading's
  1052. "subtree": its body, all its subheadings, both direct and indirect, and
  1053. all of their bodies.  In other words, the subtree contains everything
  1054. following this heading line, up to and not including the next heading
  1055. of the same or higher rank.
  1056.  
  1057.    Intermediate between a visible subtree and an invisible one is
  1058. having all the subheadings visible but none of the body.  There are
  1059. two commands for doing this, depending on whether you want to hide the
  1060. bodies or make the subheadings visible.  They are `M-x hide-leaves' and
  1061. `M-x show-branches'.
  1062.  
  1063.    A little weaker than `show-branches' is `C-c C-i'
  1064. (`show-children').  It makes just the direct subheadings
  1065. visible--those one level down.  Deeper subheadings remain invisible, if
  1066. they were invisible.
  1067.  
  1068.    Two commands have a blanket effect on the whole file.  `M-x
  1069. hide-body' makes all body lines invisible, so that you see just the
  1070. outline structure.  `M-x show-all' makes all lines visible.  These
  1071. commands can be thought of as a pair of opposites even though `M-x
  1072. show-all' applies to more than just body lines.
  1073.  
  1074.    The use of ellipses at the ends of visible lines can be turned off
  1075. by setting `selective-display-ellipses' to `nil'.  Then there is no
  1076. visible indication of the presence of invisible lines.
  1077.  
  1078. 
  1079. File: emacs,  Node: Words,  Next: Sentences,  Prev: Text Mode,  Up: Text
  1080.  
  1081. Words
  1082. =====
  1083.  
  1084.    Emacs has commands for moving over or operating on words.  By
  1085. convention, the keys for them are all `Meta-' characters.
  1086.  
  1087. `M-f'
  1088.      Move forward over a word (`forward-word').
  1089.  
  1090. `M-b'
  1091.      Move backward over a word (`backward-word').
  1092.  
  1093. `M-d'
  1094.      Kill up to the end of a word (`kill-word').
  1095.  
  1096. `M-DEL'
  1097.      Kill back to the beginning of a word (`backward-kill-word').
  1098.  
  1099. `M-@'
  1100.      Mark the end of the next word (`mark-word').
  1101.  
  1102. `M-t'
  1103.      Transpose two words;  drag a word forward or backward across
  1104.      other words (`transpose-words').
  1105.  
  1106.    Notice how these keys form a series that parallels the
  1107. character-based `C-f', `C-b', `C-d', `C-t' and DEL.  `M-@' is related
  1108. to `C-@', which is an alias for `C-SPC'.
  1109.  
  1110.    The commands `Meta-f' (`forward-word') and `Meta-b'
  1111. (`backward-word') move forward and backward over words.  They are thus
  1112. analogous to `Control-f' and `Control-b', which move over single
  1113. characters.  Like their `Control-' analogues, `Meta-f' and `Meta-b'
  1114. move several words if given an argument.  `Meta-f' with a negative
  1115. argument moves backward, and `Meta-b' with a negative argument moves
  1116. forward.  Forward motion stops right after the last letter of the
  1117. word, while backward motion stops right before the first letter.
  1118.  
  1119.    `Meta-d' (`kill-word') kills the word after point.  To be precise,
  1120. it kills everything from point to the place `Meta-f' would move to. 
  1121. Thus, if point is in the middle of a word, `Meta-d' kills just the
  1122. part after point.  If some punctuation comes between point and the
  1123. next word, it is killed along with the word.  (If you wish to kill
  1124. only the next word but not the punctuation before it, simply do
  1125. `Meta-f' to get the end, and kill the word backwards with `Meta-DEL'.)
  1126. `Meta-d' takes arguments just like `Meta-f'.
  1127.  
  1128.    `Meta-DEL' (`backward-kill-word') kills the word before point.  It
  1129. kills everything from point back to where `Meta-b' would move to.  If
  1130. point is after the space in `FOO, BAR', then `FOO, ' is killed.  (If
  1131. you wish to kill just `FOO', do `Meta-b Meta-d' instead of `Meta-DEL'.)
  1132.  
  1133.    `Meta-t' (`transpose-words') exchanges the word before or
  1134. containing point with the following word.  The delimiter characters
  1135. between the words do not move.  For example, `FOO, BAR' transposes into
  1136. `BAR, FOO' rather than `BAR FOO,'.  *Note Transpose::, for more on
  1137. transposition and on arguments to transposition commands.
  1138.  
  1139.    To operate on the next N words with an operation which applies
  1140. between point and mark, you can either set the mark at point and then
  1141. move over the words, or you can use the command `Meta-@' (`mark-word')
  1142. which does not move point, but sets the mark where `Meta-f' would move
  1143. to.  It can be given arguments just like `Meta-f'.
  1144.  
  1145.    The word commands' understanding of syntax is completely controlled
  1146. by the syntax table.  Any character can, for example, be declared to
  1147. be a word delimiter.  *Note Syntax::.
  1148.  
  1149. 
  1150. File: emacs,  Node: Sentences,  Next: Paragraphs,  Prev: Words,  Up: Text
  1151.  
  1152. Sentences
  1153. =========
  1154.  
  1155.    The Emacs commands for manipulating sentences and paragraphs are
  1156. mostly on `Meta-' keys, so as to be like the word-handling commands.
  1157.  
  1158. `M-a'
  1159.      Move back to the beginning of the sentence (`backward-sentence').
  1160.  
  1161. `M-e'
  1162.      Move forward to the end of the sentence (`forward-sentence').
  1163.  
  1164. `M-k'
  1165.      Kill forward to the end of the sentence (`kill-sentence').
  1166.  
  1167. `C-x DEL'
  1168.      Kill back to the beginning of the sentence 
  1169.      (`backward-kill-sentence').
  1170.  
  1171.    The commands `Meta-a' and `Meta-e' (`backward-sentence' and
  1172. `forward-sentence') move to the beginning and end of the current
  1173. sentence, respectively.  They were chosen to resemble `Control-a' and
  1174. `Control-e', which move to the beginning and end of a line.  Unlike
  1175. them, `Meta-a' and `Meta-e' if repeated or given numeric arguments
  1176. move over successive sentences.  Emacs assumes that the typist's
  1177. convention is followed, and thus considers a sentence to end wherever
  1178. there is a `.', `?' or `!' followed by the end of a line or two spaces,
  1179. with any number of `)', `]', `'', or `"' characters allowed in
  1180. between.  A sentence also begins or ends wherever a paragraph begins
  1181. or ends.
  1182.  
  1183.    Neither `M-a' nor `M-e' moves past the newline or spaces beyond the
  1184. sentence edge at which it is stopping.
  1185.  
  1186.    Just as `C-a' and `C-e' have a kill command, `C-k', to go with
  1187. them, so `M-a' and `M-e' have a corresponding kill command `M-k'
  1188. (`kill-sentence') which kills from point to the end of the sentence. 
  1189. With minus one as an argument it kills back to the beginning of the
  1190. sentence.  Larger arguments serve as a repeat count.
  1191.  
  1192.    There is a special command, `C-x DEL' (`backward-kill-sentence')
  1193. for killing back to the beginning of a sentence, because this is
  1194. useful when you change your mind in the middle of composing text.
  1195.  
  1196.    The variable `sentence-end' controls recognition of the end of a
  1197. sentence.  It is a regexp that matches the last few characters of a
  1198. sentence, together with the whitespace following the sentence.  Its
  1199. normal value is
  1200.  
  1201.      "[.?!][]\"')]*\\($\\|\t\\|  \\)[ \t\n]*"
  1202.  
  1203. This example is explained in the section on regexps.  *Note Regexps::.
  1204.  
  1205.