home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / VRAC / E17INFO.ZIP / EMACS-8 < prev    next >
Encoding:
GNU Info File  |  1993-07-18  |  48.6 KB  |  1,184 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.54 from the
  2. input file emacs.texi.
  3.  
  4. 
  5. File: emacs,  Node: Scroll Bars,  Next: Menu Bars,  Prev: Frame Parameters,  Up: Frames
  6.  
  7. Scroll Bars
  8. ===========
  9.  
  10.    When using X, Emacs normally makes a "scroll bar" at the right of
  11. each Emacs window.  The scroll bar runs the height of the window, and
  12. shows a moving rectangular inner box which represents the portion of the
  13. buffer currently displayed.  The entire height of the scroll bar
  14. represents the entire length of the buffer.
  15.  
  16.    You can use Mouse-2 (normally, the middle button) in the scroll bar
  17. to move or drag the inner box up and down.  If you move it to the top
  18. of the scroll bar, you see the top of the buffer.  If you move it to
  19. the bottom of the scroll bar, you see the bottom of the buffer.
  20.  
  21.    The left and right buttons in the scroll bar scroll by controlled
  22. increments.  Mouse-1 (normally, the left button) moves the line at the
  23. level where you click up to the top of the window.  Mouse-3 (normally,
  24. the right button) moves the line at the top of the window down to the
  25. level where you click.  By clicking repeatedly in the same place, you
  26. can scroll by the same distance over and over.
  27.  
  28.    You can enable or disable Scroll Bar mode with the command `M-x
  29. scroll-bar-mode'.  With no argument, it toggles the use of scroll bars.
  30. With an argument, it turns use of scroll bars on if and only if the
  31. argument is positive.  This command applies to all frames, including
  32. frames yet to be created.
  33.  
  34.    To enable or disable scroll bars for just the selected frame, use the
  35. `M-x toggle-scroll-bar' command.
  36.  
  37. 
  38. File: emacs,  Node: Menu Bars,  Next: Faces,  Prev: Scroll Bars,  Up: Frames
  39.  
  40. Menu Bars
  41. =========
  42.  
  43.    By default, each Emacs frame has a menu bar at the top which you can
  44. use to perform certain common operations.  There's no need to describe
  45. them in detail here, as you can more easily see for yourself; also, we
  46. may change them and add to them in subsequent Emacs versions.
  47.  
  48.    Each of the operations in the menu bar is bound to an ordinary Emacs
  49. command which you can invoke equally well with `M-x' or with its own
  50. key bindings.  To see the command's name and documentation, type `C-h
  51. k' and then select the menu bar item you are interested in.
  52.  
  53.    You can turn display of menu bars on or off with `M-x menu-bar-mode'.
  54. With no argument, this command toggles Menu Bar mode, a minor mode.
  55. With an argument, the command turns Menu Bar mode on if the argument is
  56. positive, off if the argument is not positive.
  57.  
  58. 
  59. File: emacs,  Node: Faces,  Next: Misc X,  Prev: Menu Bars,  Up: Frames
  60.  
  61. Using Multiple Typefaces
  62. ========================
  63.  
  64.    When using Emacs with X, you can set up multiple styles of displaying
  65. characters.  The aspects of style that you can control are the type
  66. font, the foreground color, the background color, and whether to
  67. underline.
  68.  
  69.    The way you control display style is by defining named "faces".
  70. Each face can specify a type font, a foreground color, a background
  71. color, and an underline flag; but it does not have to specify all of
  72. them.
  73.  
  74.    The style of display used for a given character in the text is
  75. determined by combining several faces.  Which faces to use is always set
  76. up by Lisp programs, at present, by means of text properties and
  77. overlays.  Any aspect of the display style that isn't specified by
  78. overlays or text properties comes from the frame itself.
  79.  
  80.    To see what faces are currently defined, and what they look like,
  81. type `M-x list-faces-display'.  It's possible for a given face to look
  82. different in different frames; this command shows the appearance in the
  83. frame in which you type it.
  84.  
  85.    When Transient Mark mode is enabled, the text of the region is
  86. highlighted when the mark is active.  This uses a face named `region';
  87. you can control the style of highlighting by changing the style of this
  88. face with the commands below.  *Note Setting Mark::, for more
  89. information about Transient Mark mode and activation and deactivation
  90. of the mark.
  91.  
  92.    Here are the commands for users to change the font of a face.
  93.  
  94. `M-x set-face-font RET FACE RET FONT RET'
  95.      Use font FONT in face FACE.
  96.  
  97. `M-x make-face-bold RET FACE RET'
  98.      Convert face FACE to use a bold version of its current font.
  99.  
  100. `M-x make-face-italic RET FACE RET'
  101.      Convert face FACE to use a italic version of its current font.
  102.  
  103. `M-x make-face-bold-italic RET FACE RET'
  104.      Convert face FACE to use a bold-italic version of its current font.
  105.  
  106. `M-x make-face-unbold RET FACE RET'
  107.      Convert face FACE to use a non-bold version of its current font.
  108.  
  109. `M-x make-face-unitalic RET FACE RET'
  110.      Convert face FACE to use a non-italic version of its current font.
  111.  
  112.    Here are the commands for users to set the colors and underline flag
  113. of a face:
  114.  
  115. `M-x set-face-foreground RET FACE RET COLOR RET'
  116.      Use color COLOR for the foreground of characters in face FACE.
  117.  
  118. `M-x set-face-background RET FACE RET COLOR RET'
  119.      Use color COLOR for the background of characters in face FACE.
  120.  
  121. `M-x set-face-underline-p RET FACE RET FLAG RET'
  122.      Specify whether to underline characters in face FACE.
  123.  
  124. `M-x invert-face RET FACE RET'
  125.      Swap the foreground and background colors of face FACE.
  126.  
  127. 
  128. File: emacs,  Node: Misc X,  Prev: Faces,  Up: Frames
  129.  
  130. Miscellaneous X Window Features
  131. ===============================
  132.  
  133.    To iconify the selected Emacs frame, type `C-z'.  The normal meaning
  134. of `C-z', to suspend Emacs, is not useful under a window system, so it
  135. has a different binding in that case (the command `iconify-frame').
  136.  
  137.    To delete the selected frame, type `C-x 5 0'.
  138.  
  139.    Under X Windows, when Transient Mark mode is enabled, Emacs
  140. highlights the region when the mark is active.  This is the main motive
  141. for using Transient Mark mode.  To enable this mode, use the command
  142. `M-x transient-mark-mode'.  *Note Mark::.
  143.  
  144. 
  145. File: emacs,  Node: Major Modes,  Next: Indentation,  Prev: Frames,  Up: Top
  146.  
  147. Major Modes
  148. ***********
  149.  
  150.    Emacs provides many alternative "major modes", each of which
  151. customizes Emacs for editing text of a particular sort.  The major modes
  152. are mutually exclusive, and each buffer has one major mode at any time.
  153. The mode line normally shows the name of the current major mode, in
  154. parentheses (*note Mode Line::.).
  155.  
  156.    The least specialized major mode is called "Fundamental mode".  This
  157. mode has no mode-specific redefinitions or variable settings, so that
  158. each Emacs command behaves in its most general manner, and each option
  159. is in its default state.  For editing any specific type of text, such
  160. as Lisp code or English text, you should switch to the appropriate
  161. major mode, such as Lisp mode or Text mode.
  162.  
  163.    Selecting a major mode changes the meanings of a few keys to become
  164. more specifically adapted to the language being edited.  The ones which
  165. are changed frequently are TAB, DEL, and LFD.  In addition, the
  166. commands which handle comments use the mode to determine how comments
  167. are to be delimited.  Many major modes redefine the syntactical
  168. properties of characters appearing in the buffer.  *Note Syntax::.
  169.  
  170.    The major modes fall into three major groups.  Lisp mode (which has
  171. several variants), C mode, Fortran mode and others are for specific
  172. programming languages.  Text mode, Nroff mode, TeX mode and Outline
  173. mode are for editing English text.  The remaining major modes are not
  174. intended for use on users' files; they are used in buffers created for
  175. specific purposes by Emacs, such as Dired mode for buffers made by Dired
  176. (*note Dired::.), and Mail mode for buffers made by `C-x m' (*note
  177. Sending Mail::.), and Shell mode for buffers used for communicating
  178. with an inferior shell process (*note Interactive Shell::.).
  179.  
  180.    Most programming language major modes specify that only blank lines
  181. separate paragraphs.  This is so that the paragraph commands remain
  182. useful.  (*Note Paragraphs::.)  They also cause Auto Fill mode to use
  183. the definition of TAB to indent the new lines it creates.  This is
  184. because most lines in a program are usually indented.  (*Note
  185. Indentation::.)
  186.  
  187. * Menu:
  188.  
  189. * Choosing Modes::     How major modes are specified or chosen.
  190.  
  191. 
  192. File: emacs,  Node: Choosing Modes,  Prev: Major Modes,  Up: Major Modes
  193.  
  194. How Major Modes are Chosen
  195. ==========================
  196.  
  197.    You can select a major mode explicitly for the current buffer, but
  198. most of the time Emacs determines which mode to use based on the file
  199. name or on special text in the file.
  200.  
  201.    Explicit selection of a new major mode is done with a `M-x' command.
  202. From the name of a major mode, add `-mode' to get the name of a command
  203. to select that mode.  Thus, you can enter Lisp mode by executing `M-x
  204. lisp-mode'.
  205.  
  206.    When you visit a file, Emacs usually chooses the right major mode
  207. based on the file's name.  For example, files whose names end in `.c'
  208. are edited in C mode.  The correspondence between file names and major
  209. mode is controlled by the variable `auto-mode-alist'.  Its value is a
  210. list in which each element has the form
  211.  
  212.      (REGEXP . MODE-FUNCTION)
  213.  
  214. For example, one element normally found in the list has the form
  215. `("\\.c$" . c-mode)', and it is responsible for selecting C mode for
  216. files whose names end in `.c'.  (Note that `\\' is needed in Lisp
  217. syntax to include a `\' in the string, which is needed to suppress the
  218. special meaning of `.' in regexps.)  The only practical way to change
  219. this variable is with Lisp code.
  220.  
  221.    You can specify which major mode should be used for editing a certain
  222. file by a special sort of text in the first nonblank line of the file.
  223. The mode name should appear in this line both preceded and followed by
  224. `-*-'.  Other text may appear on the line as well.  For example,
  225.  
  226.      ;-*-Lisp-*-
  227.  
  228. tells Emacs to use Lisp mode.  Such an explicit specification overrides
  229. any defaulting based on the file name.  Note how the semicolon is used
  230. to make Lisp treat this line as a comment.
  231.  
  232.    Another format of mode specification is
  233.  
  234.      -*-Mode: MODENAME;-*-
  235.  
  236. which allows you to specify local variables as well, like this:
  237.  
  238.      -*- mode: MODENAME; VAR: VALUE; ... -*-
  239.  
  240. *Note File Variables::, for more information about this.
  241.  
  242.    When you visit a file that does not specify a major mode to use, or
  243. when you create a new buffer with `C-x b', the variable
  244. `default-major-mode' specifies which major mode to use.  Normally its
  245. value is the symbol `fundamental-mode', which specifies Fundamental
  246. mode.  If `default-major-mode' is `nil', the major mode is taken from
  247. the previously selected buffer.
  248.  
  249.    If you change the major mode of a buffer, you can go back to the
  250. major mode Emacs would choose automatically: use the command `M-x
  251. normal-mode' to do this.  This is the same function that `find-file'
  252. calls to choose the major mode.  It also processes the file's local
  253. variables list if any.
  254.  
  255. 
  256. File: emacs,  Node: Indentation,  Next: Text,  Prev: Major Modes,  Up: Top
  257.  
  258. Indentation
  259. ***********
  260.  
  261.    This chapter describes the Emacs commands that add, remove, or
  262. adjust indentation.
  263.  
  264. `TAB'
  265.      Indent current line "appropriately" in a mode-dependent fashion.
  266.  
  267. `LFD'
  268.      Perform RET followed by TAB (`newline-and-indent').
  269.  
  270. `M-^'
  271.      Merge two lines (`delete-indentation').  This would cancel out the
  272.      effect of LFD.
  273.  
  274. `C-M-o'
  275.      Split line at point; text on the line after point becomes a new
  276.      line indented to the same column that it now starts in
  277.      (`split-line').
  278.  
  279. `M-m'
  280.      Move (forward or back) to the first nonblank character on the
  281.      current line (`back-to-indentation').
  282.  
  283. `C-M-\'
  284.      Indent several lines to same column (`indent-region').
  285.  
  286. `C-x TAB'
  287.      Shift block of lines rigidly right or left (`indent-rigidly').
  288.  
  289. `M-i'
  290.      Indent from point to the next prespecified tab stop column
  291.      (`tab-to-tab-stop').
  292.  
  293. `M-x indent-relative'
  294.      Indent from point to under an indentation point in the previous
  295.      line.
  296.  
  297.    Most programming languages have some indentation convention.  For
  298. Lisp code, lines are indented according to their nesting in
  299. parentheses.  The same general idea is used for C code, though many
  300. details are different.
  301.  
  302.    Whatever the language, to indent a line, use the TAB command.  Each
  303. major mode defines this command to perform the sort of indentation
  304. appropriate for the particular language.  In Lisp mode, TAB aligns the
  305. line according to its depth in parentheses.  No matter where in the
  306. line you are when you type TAB, it aligns the line as a whole.  In C
  307. mode, TAB implements a subtle and sophisticated indentation style that
  308. knows about many aspects of C syntax.
  309.  
  310.    In Text mode, TAB runs the command `tab-to-tab-stop', which indents
  311. to the next tab stop column.  You can set the tab stops with `M-x
  312. edit-tab-stops'.
  313.  
  314. * Menu:
  315.  
  316. * Indentation Commands::  Various commands and techniques for indentation.
  317. * Tab Stops::             You can set arbitrary "tab stops" and then
  318.                             indent to the next tab stop when you want to.
  319. * Just Spaces::           You can request indentation using just spaces.
  320.  
  321. 
  322. File: emacs,  Node: Indentation Commands,  Next: Tab Stops,  Prev: Indentation,  Up: Indentation
  323.  
  324. Indentation Commands and Techniques
  325. ===================================
  326.  
  327.    If you just want to insert a tab character in the buffer, you can
  328. type `C-q TAB'.
  329.  
  330.    To move over the indentation on a line, do `M-m'
  331. (`back-to-indentation').  This command, given anywhere on a line,
  332. positions point at the first nonblank character on the line.
  333.  
  334.    To insert an indented line before the current line, do `C-a C-o
  335. TAB'.  To make an indented line after the current line, use `C-e LFD'.
  336.  
  337.    `C-M-o' (`split-line') moves the text from point to the end of the
  338. line vertically down, so that the current line becomes two lines.
  339. `C-M-o' first moves point forward over any spaces and tabs.  Then it
  340. inserts after point a newline and enough indentation to reach the same
  341. column point is on.  Point remains before the inserted newline; in this
  342. regard, `C-M-o' resembles `C-o'.
  343.  
  344.    To join two lines cleanly, use the `M-^' (`delete-indentation')
  345. command.  It deletes the indentation at the front of the current line,
  346. and the line boundary as well, replacing them with a single space.  As
  347. a special case (useful for Lisp code) the single space is omitted if
  348. the characters to be joined are consecutive open parentheses or closing
  349. parentheses, or if the junction follows another newline.  To delete
  350. just the indentation of a line, go to the beginning of the line and use
  351. `M-\' (`delete-horizontal-space'), which deletes all spaces and tabs
  352. around the cursor.
  353.  
  354.    If you have a fill prefix, `M-^' deletes the fill prefix if it
  355. appears after the newline that is deleted.  *Note Fill Prefix::.
  356.  
  357.    There are also commands for changing the indentation of several
  358. lines at once.  `C-M-\' (`indent-region') gives each line which begins
  359. in the region the "usual" indentation by invoking TAB at the beginning
  360. of the line.  A numeric argument specifies the column to indent to, and
  361. each line is shifted left or right so that its first nonblank character
  362. appears in that column.  `C-x TAB' (`indent-rigidly') moves all of the
  363. lines in the region right by its argument (left, for negative
  364. arguments).  The whole group of lines moves rigidly sideways, which is
  365. how the command gets its name.
  366.  
  367.    `M-x indent-relative' indents at point based on the previous line
  368. (actually, the last nonempty line).  It inserts whitespace at point,
  369. moving point, until it is underneath an indentation point in the
  370. previous line.  An indentation point is the end of a sequence of
  371. whitespace or the end of the line.  If point is farther right than any
  372. indentation point in the previous line, the whitespace before point is
  373. deleted and the first indentation point then applicable is used.  If no
  374. indentation point is applicable even then, `indent-relative' runs
  375. `tab-to-tab-stop' (*note Tab Stops::.).
  376.  
  377.    `indent-relative' is the definition of TAB in Indented Text mode.
  378. *Note Text::.
  379.  
  380. 
  381. File: emacs,  Node: Tab Stops,  Next: Just Spaces,  Prev: Indentation Commands,  Up: Indentation
  382.  
  383. Tab Stops
  384. =========
  385.  
  386.    For typing in tables, you can use Text mode's definition of TAB,
  387. `tab-to-tab-stop'.  This command inserts indentation before point,
  388. enough to reach the next tab stop column.  If you are not in Text mode,
  389. this command can be found on the key `M-i'.
  390.  
  391.    You can specify the tab stops used by `M-i'.  They are stored in a
  392. variable called `tab-stop-list', as a list of column-numbers in
  393. increasing order.
  394.  
  395.    The convenient way to set the tab stops is with `M-x edit-tab-stops',
  396. which creates and selects a buffer containing a description of the tab
  397. stop settings.  You can edit this buffer to specify different tab
  398. stops, and then type `C-c C-c' to make those new tab stops take effect.
  399. In the tab stop buffer, `C-c C-c' runs the function
  400. `edit-tab-stops-note-changes' rather than its usual definition
  401. `save-buffer'.  `edit-tab-stops' records which buffer was current when
  402. you invoked it, and stores the tab stops back in that buffer; normally
  403. all buffers share the same tab stops and changing them in one buffer
  404. affects all, but if you happen to make `tab-stop-list' local in one
  405. buffer then `edit-tab-stops' in that buffer will edit the local
  406. settings.
  407.  
  408.    Here is what the text representing the tab stops looks like for
  409. ordinary tab stops every eight columns.
  410.  
  411.              :       :       :       :       :       :
  412.      0         1         2         3         4
  413.      0123456789012345678901234567890123456789012345678
  414.      To install changes, type C-c C-c
  415.  
  416.    The first line contains a colon at each tab stop.  The remaining
  417. lines are present just to help you see where the colons are and know
  418. what to do.
  419.  
  420.    Note that the tab stops that control `tab-to-tab-stop' have nothing
  421. to do with displaying tab characters in the buffer.  *Note Display
  422. Vars::, for more information on that.
  423.  
  424. 
  425. File: emacs,  Node: Just Spaces,  Prev: Tab Stops,  Up: Indentation
  426.  
  427. Tabs vs. Spaces
  428. ===============
  429.  
  430.    Emacs normally uses both tabs and spaces to indent lines.  If you
  431. prefer, all indentation can be made from spaces only.  To request this,
  432. set `indent-tabs-mode' to `nil'.  This is a per-buffer variable;
  433. altering the variable affects only the current buffer, but there is a
  434. default value which you can change as well.  *Note Locals::.
  435.  
  436.    There are also commands to convert tabs to spaces or vice versa,
  437. always preserving the columns of all nonblank text.  `M-x tabify' scans
  438. the region for sequences of spaces, and converts sequences of at least
  439. three spaces to tabs if that can be done without changing indentation.
  440. `M-x untabify' changes all tabs in the region to appropriate numbers of
  441. spaces.
  442.  
  443. 
  444. File: emacs,  Node: Text,  Next: Programs,  Prev: Indentation,  Up: Top
  445.  
  446. Commands for Human Languages
  447. ****************************
  448.  
  449.    The term "text" has two widespread meanings in our area of the
  450. computer field.  One is data that is a sequence of characters.  Any file
  451. that you edit with Emacs is text, in this sense of the word.  The other
  452. meaning is more restrictive: a sequence of characters in a human
  453. language for humans to read (possibly after processing by a text
  454. formatter), as opposed to a program or commands for a program.
  455.  
  456.    Human languages have syntactic/stylistic conventions that can be
  457. supported or used to advantage by editor commands: conventions involving
  458. words, sentences, paragraphs, and capital letters.  This chapter
  459. describes Emacs commands for all of these things.  There are also
  460. commands for "filling", which means rearranging the lines of a
  461. paragraph to be approximately equal in length.  The commands for moving
  462. over and killing words, sentences and paragraphs, while intended
  463. primarily for editing text, are also often useful for editing programs.
  464.  
  465.    Emacs has several major modes for editing human language text.  If
  466. the file contains text pure and simple, use Text mode, which customizes
  467. Emacs in small ways for the syntactic conventions of text.  For text
  468. which contains embedded commands for text formatters, Emacs has other
  469. major modes, each for a particular text formatter.  Thus, for input to
  470. TeX, you would use TeX mode; for input to nroff, Nroff mode.
  471.  
  472. * Menu:
  473.  
  474. * Words::         Moving over and killing words.
  475. * Sentences::     Moving over and killing sentences.
  476. * Paragraphs::      Moving over paragraphs.
  477. * Pages::      Moving over pages.
  478. * Filling::       Filling or justifying text.
  479. * Case::          Changing the case of text.
  480. * Text Mode::     The major modes for editing text files.
  481. * Outline Mode::  The major mode for editing outlines.
  482. * TeX Mode::      The major modes for editing input to the formatter TeX.
  483. * Nroff Mode::    The major mode for editing input to the formatter nroff.
  484.  
  485. 
  486. File: emacs,  Node: Words,  Next: Sentences,  Up: Text
  487.  
  488. Words
  489. =====
  490.  
  491.    Emacs has commands for moving over or operating on words.  By
  492. convention, the keys for them are all Meta characters.
  493.  
  494. `M-f'
  495.      Move forward over a word (`forward-word').
  496.  
  497. `M-b'
  498.      Move backward over a word (`backward-word').
  499.  
  500. `M-d'
  501.      Kill up to the end of a word (`kill-word').
  502.  
  503. `M-DEL'
  504.      Kill back to the beginning of a word (`backward-kill-word').
  505.  
  506. `M-@'
  507.      Mark the end of the next word (`mark-word').
  508.  
  509. `M-t'
  510.      Transpose two words or drag a word across other words
  511.      (`transpose-words').
  512.  
  513.    Notice how these keys form a series that parallels the
  514. character-based `C-f', `C-b', `C-d', `C-t' and DEL.  `M-@' is related
  515. to `C-@', which is an alias for `C-SPC'.
  516.  
  517.    The commands `M-f' (`forward-word') and `M-b' (`backward-word') move
  518. forward and backward over words.  These Meta characters are thus
  519. analogous to the corresponding control characters, `C-f' and `C-b',
  520. which move over single characters in the text.  The analogy extends to
  521. numeric arguments, which serve as repeat counts.  `M-f' with a negative
  522. argument moves backward, and `M-b' with a negative argument moves
  523. forward.  Forward motion stops right after the last letter of the word,
  524. while backward motion stops right before the first letter.
  525.  
  526.    `M-d' (`kill-word') kills the word after point.  To be precise, it
  527. kills everything from point to the place `M-f' would move to.  Thus, if
  528. point is in the middle of a word, `M-d' kills just the part after
  529. point.  If some punctuation comes between point and the next word, it
  530. is killed along with the word.  (If you wish to kill only the next word
  531. but not the punctuation before it, simply do `M-f' to get the end, and
  532. kill the word backwards with `M-DEL'.) `M-d' takes arguments just like
  533. `M-f'.
  534.  
  535.    `M-DEL' (`backward-kill-word') kills the word before point.  It
  536. kills everything from point back to where `M-b' would move to.  If
  537. point is after the space in `FOO, BAR', then `FOO, ' is killed.  (If
  538. you wish to kill just `FOO', do `M-b M-d' instead of `M-DEL'.)
  539.  
  540.    `M-t' (`transpose-words') exchanges the word before or containing
  541. point with the following word.  The delimiter characters between the
  542. words do not move.  For example, `FOO, BAR' transposes into `BAR, FOO'
  543. rather than `BAR FOO,'.  *Note Transpose::, for more on transposition
  544. and on arguments to transposition commands.
  545.  
  546.    To operate on the next N words with an operation which applies
  547. between point and mark, you can either set the mark at point and then
  548. move over the words, or you can use the command `M-@' (`mark-word')
  549. which does not move point, but sets the mark where `M-f' would move to.
  550. `M-@' accepts a numeric argument that says how many words to scan for
  551. the place to put the mark.
  552.  
  553.    The word commands' understanding of syntax is completely controlled
  554. by the syntax table.  Any character can, for example, be declared to be
  555. a word delimiter.  *Note Syntax::.
  556.  
  557. 
  558. File: emacs,  Node: Sentences,  Next: Paragraphs,  Prev: Words,  Up: Text
  559.  
  560. Sentences
  561. =========
  562.  
  563.    The Emacs commands for manipulating sentences and paragraphs are
  564. mostly on Meta keys, so as to be like the word-handling commands.
  565.  
  566. `M-a'
  567.      Move back to the beginning of the sentence (`backward-sentence').
  568.  
  569. `M-e'
  570.      Move forward to the end of the sentence (`forward-sentence').
  571.  
  572. `M-k'
  573.      Kill forward to the end of the sentence (`kill-sentence').
  574.  
  575. `C-x DEL'
  576.      Kill back to the beginning of the sentence
  577.      (`backward-kill-sentence').
  578.  
  579.    The commands `M-a' and `M-e' (`backward-sentence' and
  580. `forward-sentence') move to the beginning and end of the current
  581. sentence, respectively.  They were chosen to resemble `C-a' and `C-e',
  582. which move to the beginning and end of a line.  Unlike them, `M-a' and
  583. `M-e' if repeated or given numeric arguments move over successive
  584. sentences.  Emacs assumes that the typist's convention is followed, and
  585. thus considers a sentence to end wherever there is a `.', `?' or `!'
  586. followed by the end of a line or two spaces, with any number of `)',
  587. `]', `'', or `"' characters allowed in between.  A sentence also begins
  588. or ends wherever a paragraph begins or ends.
  589.  
  590.    Neither `M-a' nor `M-e' moves past the newline or spaces beyond the
  591. sentence edge at which it is stopping.
  592.  
  593.    Just as `C-a' and `C-e' have a kill command, `C-k', to go with them,
  594. so `M-a' and `M-e' have a corresponding kill command `M-k'
  595. (`kill-sentence') which kills from point to the end of the sentence.
  596. With minus one as an argument it kills back to the beginning of the
  597. sentence.  Larger arguments serve as a repeat count.
  598.  
  599.    There is a special command, `C-x DEL' (`backward-kill-sentence') for
  600. killing back to the beginning of a sentence, because this is useful
  601. when you change your mind in the middle of composing text.
  602.  
  603.    The variable `sentence-end' controls recognition of the end of a
  604. sentence.  It is a regexp that matches the last few characters of a
  605. sentence, together with the whitespace following the sentence.  Its
  606. normal value is
  607.  
  608.      "[.?!][]\"')]*\\($\\|\t\\|  \\)[ \t\n]*"
  609.  
  610. This example is explained in the section on regexps.  *Note Regexps::.
  611.  
  612. 
  613. File: emacs,  Node: Paragraphs,  Next: Pages,  Prev: Sentences,  Up: Text
  614.  
  615. Paragraphs
  616. ==========
  617.  
  618.    The Emacs commands for manipulating paragraphs are also Meta keys.
  619.  
  620. `M-{'
  621.      Move back to previous paragraph beginning (`backward-paragraph').
  622.  
  623. `M-}'
  624.      Move forward to next paragraph end (`forward-paragraph').
  625.  
  626. `M-h'
  627.      Put point and mark around this or next paragraph
  628.      (`mark-paragraph').
  629.  
  630.    `M-{' moves to the beginning of the current or previous paragraph,
  631. while `M-}' moves to the end of the current or next paragraph.  Blank
  632. lines and text formatter command lines separate paragraphs and are not
  633. part of any paragraph.  Also, an indented line starts a new paragraph.
  634.  
  635.    In major modes for programs (as opposed to Text mode), paragraphs
  636. begin and end only at blank lines.  This makes the paragraph commands
  637. continue to be useful even though there are no paragraphs per se.
  638.  
  639.    When there is a fill prefix, then paragraphs are delimited by all
  640. lines which don't start with the fill prefix.  *Note Filling::.
  641.  
  642.    When you wish to operate on a paragraph, you can use the command
  643. `M-h' (`mark-paragraph') to set the region around it.  This command
  644. puts point at the beginning and mark at the end of the paragraph point
  645. was in.  If point is between paragraphs (in a run of blank lines, or at
  646. a boundary), the paragraph following point is surrounded by point and
  647. mark.  If there are blank lines preceding the first line of the
  648. paragraph, one of these blank lines is included in the region.  Thus,
  649. for example, `M-h C-w' kills the paragraph around or after point.
  650.  
  651.    The precise definition of a paragraph boundary is controlled by the
  652. variables `paragraph-separate' and `paragraph-start'.  The value of
  653. `paragraph-start' is a regexp that should match any line that either
  654. starts or separates paragraphs.  The value of `paragraph-separate' is
  655. another regexp that should match only lines that separate paragraphs
  656. without being part of any paragraph.  Lines that start a new paragraph
  657. and are contained in it must match both regexps.  For example, normally
  658. `paragraph-start' is `"^[ \t\n\f]"' and `paragraph-separate' is `"^[
  659. \t\f]*$"'.
  660.  
  661.    Normally it is desirable for page boundaries to separate paragraphs.
  662. The default values of these variables recognize the usual separator for
  663. pages.
  664.  
  665. 
  666. File: emacs,  Node: Pages,  Next: Filling,  Prev: Paragraphs,  Up: Text
  667.  
  668. Pages
  669. =====
  670.  
  671.    Files are often thought of as divided into "pages" by the "formfeed"
  672. character (ASCII control-L, octal code 014).  For example, if a file is
  673. printed on a line printer, each page of the file, in this sense, will
  674. start on a new page of paper.  Emacs treats a page-separator character
  675. just like any other character.  You can insert it with `C-q C-l', or
  676. delete it with DEL.  Thus, you are free to paginate your file or not.
  677. However, since pages are often meaningful divisions of the file, Emacs
  678. provides commands to move over them and operate on them.
  679.  
  680. `C-x ['
  681.      Move point to previous page boundary (`backward-page').
  682.  
  683. `C-x ]'
  684.      Move point to next page boundary (`forward-page').
  685.  
  686. `C-x C-p'
  687.      Put point and mark around this page (or another page)
  688.      (`mark-page').
  689.  
  690. `C-x l'
  691.      Count the lines in this page (`count-lines-page').
  692.  
  693.    The `C-x [' (`backward-page') command moves point to immediately
  694. after the previous page delimiter.  If point is already right after a
  695. page delimiter, it skips that one and stops at the previous one.  A
  696. numeric argument serves as a repeat count.  The `C-x ]' (`forward-page')
  697. command moves forward past the next page delimiter.
  698.  
  699.    The `C-x C-p' command (`mark-page') puts point at the beginning of
  700. the current page and the mark at the end.  The page delimiter at the end
  701. is included (the mark follows it).  The page delimiter at the front is
  702. excluded (point follows it).  This command can be followed by `C-w' to
  703. kill a page which is to be moved elsewhere.  If it is inserted after a
  704. page delimiter, at a place where `C-x ]' or `C-x [' would take you, then
  705. the page will be properly delimited before and after once again.
  706.  
  707.    A numeric argument to `C-x C-p' is used to specify which page to go
  708. to, relative to the current one.  Zero means the current page.  One
  709. means the next page, and -1 means the previous one.
  710.  
  711.    The `C-x l' command (`count-lines-page') is good for deciding where
  712. to break a page in two.  It prints in the echo area the total number of
  713. lines in the current page, and then divides it up into those preceding
  714. the current line and those following, as in
  715.  
  716.      Page has 96 (72+25) lines
  717.  
  718. Notice that the sum is off by one; this is correct if point is not at
  719. the beginning of a line.
  720.  
  721.    The variable `page-delimiter' controls where pages begin.  Its value
  722. is a regexp that matches the beginning of a line that separates pages.
  723. The normal value of this variable is `"^\f"', which matches a formfeed
  724. character at the beginning of a line.
  725.  
  726. 
  727. File: emacs,  Node: Filling,  Next: Case,  Prev: Pages,  Up: Text
  728.  
  729. Filling Text
  730. ============
  731.  
  732.    With Auto Fill mode, text can be "filled" (broken up into lines that
  733. fit in a specified width) as you insert it.  If you alter existing text
  734. it may no longer be properly filled; then you can use the explicit fill
  735. commands to fill the paragraph again.
  736.  
  737. * Menu:
  738.  
  739. * Auto Fill::       Auto Fill mode breaks long lines automatically.
  740. * Fill Commands::  Commands to refill paragraphs and center lines.
  741. * Fill Prefix::    Filling when every line is indented or in a comment, etc.
  742.  
  743. 
  744. File: emacs,  Node: Auto Fill,  Next: Fill Commands,  Up: Filling
  745.  
  746. Auto Fill Mode
  747. --------------
  748.  
  749.    "Auto Fill" mode is a minor mode in which lines are broken
  750. automatically when they become too wide.  Breaking happens only when
  751. you type a SPC or RET.
  752.  
  753. `M-x auto-fill-mode'
  754.      Enable or disable Auto Fill mode.
  755.  
  756. `SPC'
  757. `RET'
  758.      In Auto Fill mode, break lines when appropriate.
  759.  
  760.    `M-x auto-fill-mode' turns Auto Fill mode on if it was off, or off if
  761. it was on.  With a positive numeric argument it always turns Auto Fill
  762. mode on, and with a negative argument always turns it off.  You can see
  763. when Auto Fill mode is in effect by the presence of the word `Fill' in
  764. the mode line, inside the parentheses.  Auto Fill mode is a minor mode,
  765. turned on or off for each buffer individually.  *Note Minor Modes::.
  766.  
  767.    In Auto Fill mode, lines are broken automatically at spaces when
  768. they get longer than the desired width.  Line breaking and
  769. rearrangement takes place only when you type SPC or RET.  If you wish
  770. to insert a space or newline without permitting line-breaking, type
  771. `C-q SPC' or `C-q LFD' (recall that a newline is really a linefeed).
  772. Also, `C-o' inserts a newline without line breaking.
  773.  
  774.    Auto Fill mode works well with Lisp mode, because when it makes a new
  775. line in Lisp mode it indents that line with TAB.  If a line ending in a
  776. comment gets too long, the text of the comment is split into two
  777. comment lines.  Optionally new comment delimiters are inserted at the
  778. end of the first line and the beginning of the second so that each line
  779. is a separate comment; the variable `comment-multi-line' controls the
  780. choice (*note Comments::.).
  781.  
  782.    Auto Fill mode does not refill entire paragraphs.  It can break
  783. lines but cannot merge lines.  So editing in the middle of a paragraph
  784. can result in a paragraph that is not correctly filled.  The easiest
  785. way to make the paragraph properly filled again is usually with the
  786. explicit fill commands.  *Note Fill Commands::.
  787.  
  788.    Many users like Auto Fill mode and want to use it in all text files.
  789. The section on init files says how to arrange this permanently for
  790. yourself.  *Note Init File::.
  791.  
  792. 
  793. File: emacs,  Node: Fill Commands,  Next: Fill Prefix,  Prev: Auto Fill,  Up: Filling
  794.  
  795. Explicit Fill Commands
  796. ----------------------
  797.  
  798. `M-q'
  799.      Fill current paragraph (`fill-paragraph').
  800.  
  801. `C-x f'
  802.      Set the fill column (`set-fill-column').
  803.  
  804. `M-x fill-region'
  805.      Fill each paragraph in the region (`fill-region').
  806.  
  807. `M-x fill-region-as-paragraph.'
  808.      Fill the region, considering it as one paragraph.
  809.  
  810. `M-s'
  811.      Center a line.
  812.  
  813.    To refill a paragraph, use the command `M-q' (`fill-paragraph').
  814. This operates on the paragraph that point is inside, or the one after
  815. point if point is between paragraphs.  Refilling works by removing all
  816. the line-breaks, then inserting new ones where necessary.
  817.  
  818.    The command `M-s' (`center-line') centers the current line within
  819. the current fill column.  With an argument, it centers several lines
  820. individually and moves past them.
  821.  
  822.    To refill many paragraphs, use `M-x fill-region', which divides the
  823. region into paragraphs and fills each of them.
  824.  
  825.    `M-q' and `fill-region' use the same criteria as `M-h' for finding
  826. paragraph boundaries (*note Paragraphs::.).  For more control, you can
  827. use `M-x fill-region-as-paragraph', which refills everything between
  828. point and mark.  This command deletes any blank lines within the
  829. region, so separate blocks of text end up combined into one block.
  830.  
  831.    A numeric argument to `M-q' causes it to "justify" the text as well
  832. as filling it.  This means that extra spaces are inserted to make the
  833. right margin line up exactly at the fill column.  To remove the extra
  834. spaces, use `M-q' with no argument.  (Likewise for `fill-region'.)
  835.  
  836.    When ADAPTIVE-FILL-MODE is non-`nil' (which is normally the case),
  837. if you use `fill-region-as-paragraph' on an indented paragraph and you
  838. don't have a fill prefix, it uses the indentation of the second line of
  839. the paragraph as the fill prefix.  The effect of adaptive filling is
  840. not noticeable in Text mode, because an indented line counts as a
  841. paragraph starter and thus each line of an indented paragraph is
  842. considered a paragraph of its own.  But you do notice the effect in
  843. Indented Text mode and some other major modes.
  844.  
  845.    The maximum line width for filling is in the variable `fill-column'.
  846. Altering the value of `fill-column' makes it local to the current
  847. buffer; until that time, the default value is in effect.  The default is
  848. initially 70.  *Note Locals::.
  849.  
  850.    The easiest way to set `fill-column' is to use the command `C-x f'
  851. (`set-fill-column').  With no argument, it sets `fill-column' to the
  852. current horizontal position of point.  With a numeric argument, it uses
  853. that as the new fill column.
  854.  
  855. 
  856. File: emacs,  Node: Fill Prefix,  Prev: Fill Commands,  Up: Filling
  857.  
  858. The Fill Prefix
  859. ---------------
  860.  
  861.    To fill a paragraph in which each line starts with a special marker
  862. (which might be a few spaces, giving an indented paragraph), use the
  863. "fill prefix" feature.  The fill prefix is a string which Emacs expects
  864. every line to start with, and which is not included in filling.
  865.  
  866. `C-x .'
  867.      Set the fill prefix (`set-fill-prefix').
  868.  
  869. `M-q'
  870.      Fill a paragraph using current fill prefix (`fill-paragraph').
  871.  
  872. `M-x fill-individual-paragraphs'
  873.      Fill the region, considering each change of indentation as
  874.      starting a new paragraph.
  875.  
  876. `M-x fill-nonuniform-paragraphs'
  877.      Fill the region, considering only paragraph-separator lines as
  878.      starting a new paragraph.
  879.  
  880.    To specify a fill prefix, move to a line that starts with the desired
  881. prefix, put point at the end of the prefix, and give the command
  882. `C-x .' (`set-fill-prefix').  That's a period after the `C-x'.  To turn
  883. off the fill prefix, specify an empty prefix: type `C-x .' with point
  884. at the beginning of a line.
  885.  
  886.    When a fill prefix is in effect, the fill commands remove the fill
  887. prefix from each line before filling and insert it on each line after
  888. filling.  The fill prefix is also inserted on new lines made
  889. automatically by Auto Fill mode.  Lines that do not start with the fill
  890. prefix are considered to start paragraphs, both in `M-q' and the
  891. paragraph commands; this is just right if you are using paragraphs with
  892. hanging indentation (every line indented except the first one).  Lines
  893. which are blank or indented once the prefix is removed also separate or
  894. start paragraphs; this is what you want if you are writing
  895. multi-paragraph comments with a comment delimiter on each line.
  896.  
  897.    For example, if `fill-column' is 40 and you set the fill prefix to
  898. `;; ', then `M-q' in the following text
  899.  
  900.      ;; This is an
  901.      ;; example of a paragraph
  902.      ;; inside a Lisp-style comment.
  903.  
  904. produces this:
  905.  
  906.      ;; This is an example of a paragraph
  907.      ;; inside a Lisp-style comment.
  908.  
  909.    The `C-o' command inserts the fill prefix on new lines it creates,
  910. when you use it at the beginning of a line (*note Blank Lines::.).
  911. Conversely, the command `M-^' deletes the prefix (if it occurs) after
  912. the newline that it deletes (*note Indentation::.).
  913.  
  914.    You can use `M-x fill-individual-paragraphs' to set the fill prefix
  915. for each paragraph automatically.  This command divides the region into
  916. paragraphs, treating every change in the amount of indentation as the
  917. start of a new paragraph, and fills each of these paragraphs.  Thus,
  918. all the lines in one "paragraph" have the same amount of indentation.
  919. That indentation serves as the fill prefix for that paragraph.
  920.  
  921.    `M-x fill-nonuniform-paragraphs' is a similar command that divides
  922. the region into paragraphs in a different way.  It considers only
  923. paragraph-separating lines (as defined by `paragraph-separate') as
  924. starting a new paragraph.  Since this means that the lines of one
  925. paragraph may have different amounts of indentation, the fill prefix
  926. used is the smallest amount of indentation of any of the lines of the
  927. paragraph.
  928.  
  929.    The fill prefix is stored in the variable `fill-prefix'.  Its value
  930. is a string, or `nil' when there is no fill prefix.  This is a
  931. per-buffer variable; altering the variable affects only the current
  932. buffer, but there is a default value which you can change as well.
  933. *Note Locals::.
  934.  
  935. 
  936. File: emacs,  Node: Case,  Next: Text Mode,  Prev: Filling,  Up: Text
  937.  
  938. Case Conversion Commands
  939. ========================
  940.  
  941.    Emacs has commands for converting either a single word or any
  942. arbitrary range of text to upper case or to lower case.
  943.  
  944. `M-l'
  945.      Convert following word to lower case (`downcase-word').
  946.  
  947. `M-u'
  948.      Convert following word to upper case (`upcase-word').
  949.  
  950. `M-c'
  951.      Capitalize the following word (`capitalize-word').
  952.  
  953. `C-x C-l'
  954.      Convert region to lower case (`downcase-region').
  955.  
  956. `C-x C-u'
  957.      Convert region to upper case (`upcase-region').
  958.  
  959.    The word conversion commands are the most useful.  `M-l'
  960. (`downcase-word') converts the word after point to lower case, moving
  961. past it.  Thus, repeating `M-l' converts successive words.  `M-u'
  962. (`upcase-word') converts to all capitals instead, while `M-c'
  963. (`capitalize-word') puts the first letter of the word into upper case
  964. and the rest into lower case.  All these commands convert several words
  965. at once if given an argument.  They are especially convenient for
  966. converting a large amount of text from all upper case to mixed case,
  967. because you can move through the text using `M-l', `M-u' or `M-c' on
  968. each word as appropriate, occasionally using `M-f' instead to skip a
  969. word.
  970.  
  971.    When given a negative argument, the word case conversion commands
  972. apply to the appropriate number of words before point, but do not move
  973. point.  This is convenient when you have just typed a word in the wrong
  974. case: you can give the case conversion command and continue typing.
  975.  
  976.    If a word case conversion command is given in the middle of a word,
  977. it applies only to the part of the word which follows point.  This is
  978. just like what `M-d' (`kill-word') does.  With a negative argument,
  979. case conversion applies only to the part of the word before point.
  980.  
  981.    The other case conversion commands are `C-x C-u' (`upcase-region')
  982. and `C-x C-l' (`downcase-region'), which convert everything between
  983. point and mark to the specified case.  Point and mark do not move.
  984.  
  985.    The region case conversion commands `upcase-region' and
  986. `downcase-region' are normally disabled.  This means that they ask for
  987. confirmation if you try to use them.  When you confirm, you may enable
  988. the command, which means it will not ask for confirmation again.  *Note
  989. Disabling::.
  990.  
  991. 
  992. File: emacs,  Node: Text Mode,  Next: Outline Mode,  Prev: Case,  Up: Text
  993.  
  994. Text Mode
  995. =========
  996.  
  997.    When you edit files of text in a human language, it's more convenient
  998. to use Text mode rather than Fundamental mode.  Invoke `M-x text-mode'
  999. to enter Text mode.  In Text mode, TAB runs the function
  1000. `tab-to-tab-stop', which allows you to use arbitrary tab stops set with
  1001. `M-x edit-tab-stops' (*note Tab Stops::.).  Features concerned with
  1002. comments in programs are turned off except when explicitly invoked.
  1003. The syntax table is changed so that periods are not considered part of
  1004. a word, while apostrophes, backspaces and underlines are.
  1005.  
  1006.    A similar variant mode is Indented Text mode, intended for editing
  1007. text in which most lines are indented.  This mode defines TAB to run
  1008. `indent-relative' (*note Indentation::.), and makes Auto Fill indent
  1009. the lines it creates.  The result is that normally a line made by Auto
  1010. Filling, or by LFD, is indented just like the previous line.  Use `M-x
  1011. indented-text-mode' to select this mode.
  1012.  
  1013.    Entering Text mode or Indented Text mode runs the hook
  1014. `text-mode-hook'.  Other major modes related to Text mode also run this
  1015. hook, followed by hooks of their own; this includes Nroff mode, TeX
  1016. mode, Outline mode and Mail mode.  Hook functions on `text-mode-hook'
  1017. can look at the value of `major-mode' to see which of these modes is
  1018. actually being entered.  *Note Hooks::.
  1019.  
  1020. * Menu:
  1021.  
  1022.   Two modes similar to Text mode are of use for editing text that is to
  1023. be passed through a text formatter before achieving the form in which
  1024. humans are to read it.
  1025.  
  1026. * Nroff Mode::  The major mode for editing input to the formatter nroff.
  1027. * TeX Mode::    The major modes for editing input to the formatter TeX.
  1028.  
  1029.   Another similar mode is used for editing outlines.  It allows you
  1030. to view the text at various levels of detail.  You can view either
  1031. the outline headings alone or both headings and text; you can also
  1032. hide some of the headings at lower levels from view to make the high
  1033. level structure more visible.
  1034.  
  1035. * Outline Mode::The major mode for editing outlines.
  1036.  
  1037. 
  1038. File: emacs,  Node: Outline Mode,  Next: TeX Mode,  Prev: Text Mode,  Up: Text
  1039.  
  1040. Outline Mode
  1041. ============
  1042.  
  1043.    Outline mode is a major mode much like Text mode but intended for
  1044. editing outlines.  It allows you to make parts of the text temporarily
  1045. invisible so that you can see just the overall structure of the
  1046. outline.  Type `M-x outline-mode' to switch to Outline mode as the
  1047. major mode of the current buffer.  Type `M-x outline-minor-mode' to
  1048. enable Outline mode as a minor mode in the current buffer.  When
  1049. Outline minor mode is enabled, the `C-c' commands of Outline mode
  1050. replace those of the major mode.
  1051.  
  1052.    When a line is invisible in outline mode, it does not appear on the
  1053. screen.  The screen appears exactly as if the invisible line were
  1054. deleted, except that an ellipsis (three periods in a row) appears at
  1055. the end of the previous visible line (only one ellipsis no matter how
  1056. many invisible lines follow).
  1057.  
  1058.    All editing commands treat the text of the invisible line as part of
  1059. the previous visible line.  For example, `C-n' moves onto the next
  1060. visible line.  Killing an entire visible line, including its
  1061. terminating newline, really kills all the following invisible lines
  1062. along with it; yanking it all back yanks the invisible lines and they
  1063. remain invisible.
  1064.  
  1065.    Entering Outline mode runs the hook `text-mode-hook' followed by the
  1066. hook `outline-mode-hook' (*note Hooks::.).
  1067.  
  1068. * Menu:
  1069.  
  1070. * Format: Outline Format.       What the text of an outline looks like.
  1071. * Motion: Outline Motion.       Special commands for moving through
  1072.                                      outlines.
  1073. * Visibility: Outline Visibility.  Commands to control what is visible.
  1074.  
  1075. 
  1076. File: emacs,  Node: Outline Format,  Next: Outline Motion,  Up: Outline Mode
  1077.  
  1078. Format of Outlines
  1079. ------------------
  1080.  
  1081.    Outline mode assumes that the lines in the buffer are of two types:
  1082. "heading lines" and "body lines".  A heading line represents a topic in
  1083. the outline.  Heading lines start with one or more stars; the number of
  1084. stars determines the depth of the heading in the outline structure.
  1085. Thus, a heading line with one star is a major topic; all the heading
  1086. lines with two stars between it and the next one-star heading are its
  1087. subtopics; and so on.  Any line that is not a heading line is a body
  1088. line.  Body lines belong with the preceding heading line.  Here is an
  1089. example:
  1090.  
  1091.      * Food
  1092.      
  1093.      This is the body,
  1094.      which says something about the topic of food.
  1095.      
  1096.      ** Delicious Food
  1097.      
  1098.      This is the body of the second-level header.
  1099.      
  1100.      ** Distasteful Food
  1101.      
  1102.      This could have
  1103.      a body too, with
  1104.      several lines.
  1105.      
  1106.      *** Dormitory Food
  1107.      
  1108.      * Shelter
  1109.      
  1110.      A second first-level topic with its header line.
  1111.  
  1112.    A heading line together with all following body lines is called
  1113. collectively an "entry".  A heading line together with all following
  1114. deeper heading lines and their body lines is called a "subtree".
  1115.  
  1116.    You can customize the criterion for distinguishing heading lines by
  1117. setting the variable `outline-regexp'.  Any line whose beginning has a
  1118. match for this regexp is considered a heading line.  Matches that start
  1119. within a line (not at the beginning) do not count.  The length of the
  1120. matching text determines the level of the heading; longer matches make
  1121. a more deeply nested level.  Thus, for example, if a text formatter has
  1122. commands `@chapter', `@section' and `@subsection' to divide the
  1123. document into chapters and sections, you could make those lines count
  1124. as heading lines by setting `outline-regexp' to
  1125. `"@chap\\|@\\(sub\\)*section"'.  Note the trick: the two words
  1126. `chapter' and `section' are equally long, but by defining the regexp to
  1127. match only `chap' we ensure that the length of the text matched on a
  1128. chapter heading is shorter, so that Outline mode will know that
  1129. sections are contained in chapters.  This works as long as no other
  1130. command starts with `@chap'.
  1131.  
  1132.    Outline mode makes a line invisible by changing the newline before it
  1133. into an ASCII control-M (code 015).  Most editing commands that work on
  1134. lines treat an invisible line as part of the previous line because,
  1135. strictly speaking, it *is* part of that line, since there is no longer a
  1136. newline in between.  When you save the file in Outline mode, control-M
  1137. characters are saved as newlines, so the invisible lines become ordinary
  1138. lines in the file.  But saving does not change the visibility status of
  1139. a line inside Emacs.
  1140.  
  1141. 
  1142. File: emacs,  Node: Outline Motion,  Next: Outline Visibility,  Prev: Outline Format,  Up: Outline Mode
  1143.  
  1144. Outline Motion Commands
  1145. -----------------------
  1146.  
  1147.    There are some special motion commands in Outline mode that move
  1148. backward and forward to heading lines.
  1149.  
  1150. `C-c C-n'
  1151.      Move point to the next visible heading line
  1152.      (`outline-next-visible-heading').
  1153.  
  1154. `C-c C-p'
  1155.      Move point to the previous visible heading line
  1156.      (`outline-previous-visible-heading').
  1157.  
  1158. `C-c C-f'
  1159.      Move point to the next visible heading line at the same level as
  1160.      the one point is on (`outline-forward-same-level').
  1161.  
  1162. `C-c C-b'
  1163.      Move point to the previous visible heading line at the same level
  1164.      (`outline-backward-same-level').
  1165.  
  1166. `C-c C-u'
  1167.      Move point up to a lower-level (more inclusive) visible heading
  1168.      line (`outline-up-heading').
  1169.  
  1170.    `C-c C-n' (`next-visible-heading') moves down to the next heading
  1171. line.  `C-c C-p' (`previous-visible-heading') moves similarly backward.
  1172. Both accept numeric arguments as repeat counts.  The names emphasize
  1173. that invisible headings are skipped, but this is not really a special
  1174. feature.  All editing commands that look for lines ignore the invisible
  1175. lines automatically.
  1176.  
  1177.    More powerful motion commands understand the level structure of
  1178. headings.  `C-c C-f' (`outline-forward-same-level') and `C-c C-b'
  1179. (`outline-backward-same-level') move from one heading line to another
  1180. visible heading at the same depth in the outline.  `C-c C-u'
  1181. (`outline-up-heading') moves backward to another heading that is less
  1182. deeply nested.
  1183.  
  1184.