home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / info / emacs.i06 < prev    next >
Encoding:
GNU Info File  |  1993-06-14  |  50.7 KB  |  1,196 lines

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