diff options
| author | Chong Yidong | 2011-12-03 00:50:10 +0800 |
|---|---|---|
| committer | Chong Yidong | 2011-12-03 00:50:10 +0800 |
| commit | 95ca9bc7340332c09c0a083aeae21cd25bb3928b (patch) | |
| tree | 0cf4e9fba2910e9ee15fdc0d87e1ccbd42ca5b1c | |
| parent | 99c79fee5189adb5c4fe52fab4cc1e9f55d2a6bf (diff) | |
| download | emacs-95ca9bc7340332c09c0a083aeae21cd25bb3928b.tar.gz emacs-95ca9bc7340332c09c0a083aeae21cd25bb3928b.zip | |
More updates to Text chapter of Emacs manual.
* text.texi (Pages): Mention how formfeed chars are displayed.
(Auto Fill): Note convention for calling auto-fill-mode from Lisp.
Describe adaptive filling more precisely.
(Fill Commands): Note that filling removes excess whitespace.
(Text Mode): Note auto-mode-alist entries for Text mode. TAB is
now bound to indent-for-tab-command in Text mode.
(Outline Mode): Copyedits.
(Outline Visibility): Note that Reveal mode is a buffer-local
minor mode.
* modes.texi (Major Modes): Move note about checking major-mode in
a hook function here, from Text mode.
| -rw-r--r-- | doc/emacs/ChangeLog | 15 | ||||
| -rw-r--r-- | doc/emacs/modes.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/text.texi | 480 |
3 files changed, 249 insertions, 248 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 06e3c039238..d7bcb28b500 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2011-12-02 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * text.texi (Pages): Mention how formfeed chars are displayed. | ||
| 4 | (Auto Fill): Note convention for calling auto-fill-mode from Lisp. | ||
| 5 | Describe adaptive filling more precisely. | ||
| 6 | (Fill Commands): Note that filling removes excess whitespace. | ||
| 7 | (Text Mode): Note auto-mode-alist entries for Text mode. TAB is | ||
| 8 | now bound to indent-for-tab-command in Text mode. | ||
| 9 | (Outline Mode): Copyedits. | ||
| 10 | (Outline Visibility): Note that Reveal mode is a buffer-local | ||
| 11 | minor mode. | ||
| 12 | |||
| 13 | * modes.texi (Major Modes): Move note about checking major-mode in | ||
| 14 | a hook function here, from Text mode. | ||
| 15 | |||
| 1 | 2011-11-28 Chong Yidong <cyd@gnu.org> | 16 | 2011-11-28 Chong Yidong <cyd@gnu.org> |
| 2 | 17 | ||
| 3 | * text.texi (Words): Add xref to Position Info. | 18 | * text.texi (Words): Add xref to Position Info. |
diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi index 60636ce040f..e5be13d6ce5 100644 --- a/doc/emacs/modes.texi +++ b/doc/emacs/modes.texi | |||
| @@ -115,6 +115,8 @@ hooks. Each mode hook is named after its major mode, e.g. Fortran | |||
| 115 | mode has @code{fortran-mode-hook}. Furthermore, all text-based major | 115 | mode has @code{fortran-mode-hook}. Furthermore, all text-based major |
| 116 | modes run @code{text-mode-hook}, and all programming language modes | 116 | modes run @code{text-mode-hook}, and all programming language modes |
| 117 | run @code{prog-mode-hook}, prior to running their own mode hooks. | 117 | run @code{prog-mode-hook}, prior to running their own mode hooks. |
| 118 | Hook functions can look at the value of the variable @code{major-mode} | ||
| 119 | to see which mode is actually being entered. | ||
| 118 | 120 | ||
| 119 | Mode hooks are commonly used to enable minor modes (@pxref{Minor | 121 | Mode hooks are commonly used to enable minor modes (@pxref{Minor |
| 120 | Modes}). For example, you can put the following lines in your init | 122 | Modes}). For example, you can put the following lines in your init |
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index 5fdf4c5dabe..241acbaf333 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi | |||
| @@ -319,15 +319,15 @@ in Fundamental mode, @code{paragraph-start} is @w{@code{"\f\\|[ | |||
| 319 | 319 | ||
| 320 | @cindex pages | 320 | @cindex pages |
| 321 | @cindex formfeed character | 321 | @cindex formfeed character |
| 322 | Within some text files, text is divided into @dfn{pages}, which are | 322 | Within some text files, text is divided into @dfn{pages} delimited |
| 323 | delimited by the @dfn{formfeed character} (@acronym{ASCII} code 12, | 323 | by the @dfn{formfeed character} (@acronym{ASCII} code 12, also denoted |
| 324 | sometimes denoted as @key{control-L}). When you print hardcopy for a | 324 | as @key{control-L}), which is displayed in Emacs as the escape |
| 325 | file, the formfeed character forces a page break: each page of the | 325 | sequence @samp{^L} (@pxref{Text Display}). Traditionally, when such |
| 326 | file goes on a separate page on paper. Most Emacs commands treat the | 326 | text files are printed to hardcopy, each formfeed character forces a |
| 327 | formfeed character just like any other character: you can insert it | 327 | page break. Most Emacs commands treat it just like any other |
| 328 | with @kbd{C-q C-l}, and delete it with @key{DEL}. However, since | 328 | character, so you can insert it with @kbd{C-q C-l}, delete it with |
| 329 | pages are often meaningful divisions of the file, Emacs provides | 329 | @key{DEL}, etc. In addition, Emacs provides commands to move over |
| 330 | commands to move over them and operate on them. | 330 | pages and operate on them. |
| 331 | 331 | ||
| 332 | @table @kbd | 332 | @table @kbd |
| 333 | @item M-x what-page | 333 | @item M-x what-page |
| @@ -359,9 +359,9 @@ command moves forward past the next page delimiter. | |||
| 359 | @kindex C-x C-p | 359 | @kindex C-x C-p |
| 360 | @findex mark-page | 360 | @findex mark-page |
| 361 | The @kbd{C-x C-p} command (@code{mark-page}) puts point at the | 361 | The @kbd{C-x C-p} command (@code{mark-page}) puts point at the |
| 362 | beginning of the current page and the mark at the end. The page | 362 | beginning of the current page (after that page delimiter at the |
| 363 | delimiter at the end is included (the mark follows it). The page | 363 | front), and the mark at the end of the page (after the page delimiter |
| 364 | delimiter at the front is excluded (point follows it). | 364 | at the end). |
| 365 | 365 | ||
| 366 | @kbd{C-x C-p C-w} is a handy way to kill a page to move it | 366 | @kbd{C-x C-p C-w} is a handy way to kill a page to move it |
| 367 | elsewhere. If you move to another page delimiter with @kbd{C-x [} and | 367 | elsewhere. If you move to another page delimiter with @kbd{C-x [} and |
| @@ -403,9 +403,7 @@ beginning of a line. | |||
| 403 | specified width. Emacs does filling in two ways. In Auto Fill mode, | 403 | specified width. Emacs does filling in two ways. In Auto Fill mode, |
| 404 | inserting text with self-inserting characters also automatically fills | 404 | inserting text with self-inserting characters also automatically fills |
| 405 | it. There are also explicit fill commands that you can use when editing | 405 | it. There are also explicit fill commands that you can use when editing |
| 406 | text leaves it unfilled. When you edit formatted text, you can specify | 406 | text leaves it unfilled. |
| 407 | a style of filling for each portion of the text (@pxref{Formatted | ||
| 408 | Text}). | ||
| 409 | 407 | ||
| 410 | @menu | 408 | @menu |
| 411 | * Auto Fill:: Auto Fill mode breaks long lines automatically. | 409 | * Auto Fill:: Auto Fill mode breaks long lines automatically. |
| @@ -419,9 +417,9 @@ Text}). | |||
| 419 | @cindex Auto Fill mode | 417 | @cindex Auto Fill mode |
| 420 | @cindex mode, Auto Fill | 418 | @cindex mode, Auto Fill |
| 421 | 419 | ||
| 422 | @dfn{Auto Fill} mode is a minor mode in which lines are broken | 420 | @dfn{Auto Fill} mode is a buffer-local minor mode (@pxref{Minor |
| 423 | automatically when they become too wide. Breaking happens only when | 421 | Modes}) in which lines are broken automatically when they become too |
| 424 | you type a @key{SPC} or @key{RET}. | 422 | wide. Breaking happens only when you type a @key{SPC} or @key{RET}. |
| 425 | 423 | ||
| 426 | @table @kbd | 424 | @table @kbd |
| 427 | @item M-x auto-fill-mode | 425 | @item M-x auto-fill-mode |
| @@ -432,45 +430,43 @@ In Auto Fill mode, break lines when appropriate. | |||
| 432 | @end table | 430 | @end table |
| 433 | 431 | ||
| 434 | @findex auto-fill-mode | 432 | @findex auto-fill-mode |
| 435 | @kbd{M-x auto-fill-mode} turns Auto Fill mode on if it was off, or off | 433 | The mode command @kbd{M-x auto-fill-mode} toggles Auto Fill mode in |
| 436 | if it was on. With a positive numeric argument it always turns Auto | 434 | the current buffer. With a positive numeric argument, it enables Auto |
| 437 | Fill mode on, and with a negative argument always turns it off. You can | 435 | Fill mode, and with a negative argument it disables it. If |
| 438 | see when Auto Fill mode is in effect by the presence of the word | 436 | @code{auto-fill-mode} is called from Lisp with an omitted or |
| 439 | @samp{Fill} in the mode line, inside the parentheses. Auto Fill mode is | 437 | @code{nil} argument, it enables Auto Fill mode. To enable Auto Fill |
| 440 | a minor mode which is enabled or disabled for each buffer individually. | 438 | mode automatically in certain major modes, add @code{auto-fill-mode} |
| 441 | @xref{Minor Modes}. | 439 | to the mode hooks (@pxref{Major Modes}). When Auto Fill mode is |
| 442 | 440 | enabled, the mode indicator @samp{Fill} appears in the mode line | |
| 443 | In Auto Fill mode, lines are broken automatically at spaces when they | 441 | (@pxref{Mode Line}). |
| 444 | get longer than the desired width. Line breaking and rearrangement | 442 | |
| 445 | takes place only when you type @key{SPC} or @key{RET}. If you wish to | 443 | Auto Fill mode breaks lines automatically at spaces whenever they |
| 446 | insert a space or newline without permitting line-breaking, type | 444 | get longer than the desired width. This line breaking occurs only |
| 447 | @kbd{C-q @key{SPC}} or @kbd{C-q C-j} (recall that a newline is really a | 445 | when you type @key{SPC} or @key{RET}. If you wish to insert a space |
| 448 | control-J). Also, @kbd{C-o} inserts a newline without line breaking. | 446 | or newline without permitting line-breaking, type @kbd{C-q @key{SPC}} |
| 449 | 447 | or @kbd{C-q C-j} respectively. Also, @kbd{C-o} inserts a newline | |
| 450 | Auto Fill mode works well with programming-language modes, because it | 448 | without line breaking. |
| 451 | indents new lines with @key{TAB}. If a line ending in a comment gets | 449 | |
| 452 | too long, the text of the comment is split into two comment lines. | 450 | When Auto Fill mode breaks a line, it tries to obey the |
| 453 | Optionally, new comment delimiters are inserted at the end of the first | 451 | @dfn{adaptive fill prefix}: if a fill prefix can be deduced from the |
| 454 | line and the beginning of the second so that each line is a separate | 452 | first and/or second line of the current paragraph, it is inserted into |
| 455 | comment; the variable @code{comment-multi-line} controls the choice | 453 | the new line (@pxref{Adaptive Fill}). Otherwise the new line is |
| 456 | (@pxref{Comments}). | 454 | indented, as though you had typed @key{TAB} on it |
| 457 | 455 | (@pxref{Indentation}). In a programming language mode, if a line is | |
| 458 | Adaptive filling (@pxref{Adaptive Fill}) works for Auto Filling as | 456 | broken in the middle of a comment, the comment is split by inserting |
| 459 | well as for explicit fill commands. It takes a fill prefix | 457 | new comment delimiters as appropriate. |
| 460 | automatically from the second or first line of a paragraph. | 458 | |
| 461 | 459 | Auto Fill mode does not refill entire paragraphs; it breaks lines | |
| 462 | Auto Fill mode does not refill entire paragraphs; it can break lines but | 460 | but does not merge lines. Therefore, editing in the middle of a |
| 463 | cannot merge lines. So editing in the middle of a paragraph can result in | 461 | paragraph can result in a paragraph that is not correctly filled. To |
| 464 | a paragraph that is not correctly filled. The easiest way to make the | 462 | fill it, call the explicit fill commands |
| 465 | paragraph properly filled again is usually with the explicit fill commands. | 463 | @iftex |
| 464 | described in the next section. | ||
| 465 | @end iftex | ||
| 466 | @ifnottex | 466 | @ifnottex |
| 467 | @xref{Fill Commands}. | 467 | (@pxref{Fill Commands}). |
| 468 | @end ifnottex | 468 | @end ifnottex |
| 469 | 469 | ||
| 470 | Many users like Auto Fill mode and want to use it in all text files. | ||
| 471 | The section on init files says how to arrange this permanently for yourself. | ||
| 472 | @xref{Init File}. | ||
| 473 | |||
| 474 | @node Fill Commands | 470 | @node Fill Commands |
| 475 | @subsection Explicit Fill Commands | 471 | @subsection Explicit Fill Commands |
| 476 | 472 | ||
| @@ -489,21 +485,23 @@ Center a line. | |||
| 489 | 485 | ||
| 490 | @kindex M-q | 486 | @kindex M-q |
| 491 | @findex fill-paragraph | 487 | @findex fill-paragraph |
| 492 | To refill a paragraph, use the command @kbd{M-q} | 488 | The command @kbd{M-q} (@code{fill-paragraph}) @dfn{fills} the |
| 493 | (@code{fill-paragraph}). This operates on the paragraph that point is | 489 | current paragraph. It redistributes the line breaks within the |
| 494 | inside, or the one after point if point is between paragraphs. | 490 | paragraph, and deletes any excess space and tab characters occurring |
| 495 | Refilling works by removing all the line-breaks, then inserting new | 491 | within the paragraph, in such a way that the lines end up fitting |
| 496 | ones where necessary. When there is an active region, this command | 492 | within a certain maximum width. |
| 497 | operates on the text within the region like @code{fill-region}. | ||
| 498 | 493 | ||
| 499 | @findex fill-region | 494 | @findex fill-region |
| 500 | To refill many paragraphs, use @kbd{M-x fill-region}, which | 495 | Normally, @kbd{M-q} acts on the paragraph where point is, but if |
| 501 | finds the paragraphs in the region and fills each of them. | 496 | point is between paragraphs, it acts on the paragraph after point. If |
| 497 | the region is active, it acts instead on the text in the region. You | ||
| 498 | can also call @kbd{M-x fill-region} to specifically fill the text in | ||
| 499 | the region. | ||
| 502 | 500 | ||
| 503 | @findex fill-region-as-paragraph | 501 | @findex fill-region-as-paragraph |
| 504 | @kbd{M-q} and @code{fill-region} use the same criteria as @kbd{M-h} | 502 | @kbd{M-q} and @code{fill-region} use the usual Emacs criteria for |
| 505 | for finding paragraph boundaries (@pxref{Paragraphs}). For more | 503 | finding paragraph boundaries (@pxref{Paragraphs}). For more control, |
| 506 | control, you can use @kbd{M-x fill-region-as-paragraph}, which refills | 504 | you can use @kbd{M-x fill-region-as-paragraph}, which refills |
| 507 | everything between point and mark as a single paragraph. This command | 505 | everything between point and mark as a single paragraph. This command |
| 508 | deletes any blank lines within the region, so separate blocks of text | 506 | deletes any blank lines within the region, so separate blocks of text |
| 509 | end up combined into one block. | 507 | end up combined into one block. |
| @@ -513,9 +511,18 @@ end up combined into one block. | |||
| 513 | as well as filling it. This means that extra spaces are inserted to | 511 | as well as filling it. This means that extra spaces are inserted to |
| 514 | make the right margin line up exactly at the fill column. To remove | 512 | make the right margin line up exactly at the fill column. To remove |
| 515 | the extra spaces, use @kbd{M-q} with no argument. (Likewise for | 513 | the extra spaces, use @kbd{M-q} with no argument. (Likewise for |
| 516 | @code{fill-region}.) Another way to control justification, and choose | 514 | @code{fill-region}.) |
| 517 | other styles of filling, is with the @code{justification} text | 515 | |
| 518 | property; see @ref{Format Justification}. | 516 | @vindex fill-column |
| 517 | @kindex C-x f | ||
| 518 | @findex set-fill-column | ||
| 519 | The maximum line width for filling is specified by the buffer-local | ||
| 520 | variable @code{fill-column}. The default value (@pxref{Locals}) is | ||
| 521 | 70. The easiest way to set @code{fill-column} in the current buffer | ||
| 522 | is to use the command @kbd{C-x f} (@code{set-fill-column}). With a | ||
| 523 | numeric argument, it uses that as the new fill column. With just | ||
| 524 | @kbd{C-u} as argument, it sets @code{fill-column} to the current | ||
| 525 | horizontal position of point. | ||
| 519 | 526 | ||
| 520 | @kindex M-o M-s @r{(Text mode)} | 527 | @kindex M-o M-s @r{(Text mode)} |
| 521 | @cindex centering | 528 | @cindex centering |
| @@ -526,40 +533,27 @@ within the current fill column. With an argument @var{n}, it centers | |||
| 526 | made by Text mode and is available only in that and related modes | 533 | made by Text mode and is available only in that and related modes |
| 527 | (@pxref{Text Mode}). | 534 | (@pxref{Text Mode}). |
| 528 | 535 | ||
| 529 | @vindex fill-column | 536 | By default, Emacs considers a period followed by two spaces or by a |
| 530 | @kindex C-x f | 537 | newline as the end of a sentence; a period followed by just one space |
| 531 | @findex set-fill-column | 538 | indicates an abbreviation, not the end of a sentence. Accordingly, |
| 532 | The maximum line width for filling is in the variable | 539 | the fill commands will not break a line after a period followed by |
| 533 | @code{fill-column}. Altering the value of @code{fill-column} makes it | 540 | just one space. If you change the variable |
| 534 | local to the current buffer; until that time, the default value is in | 541 | @code{sentence-end-double-space} to a non-@code{nil} value, the fill |
| 535 | effect. The default is initially 70. @xref{Locals}. The easiest way | 542 | commands will break a line after a period followed by one space, and |
| 536 | to set @code{fill-column} is to use the command @kbd{C-x f} | 543 | put just one space after each period. @xref{Sentences}, for other |
| 537 | (@code{set-fill-column}). With a numeric argument, it uses that as the | 544 | effects and possible drawbacks of this. |
| 538 | new fill column. With just @kbd{C-u} as argument, it sets | ||
| 539 | @code{fill-column} to the current horizontal position of point. | ||
| 540 | |||
| 541 | Emacs commands normally consider a period followed by two spaces or by | ||
| 542 | a newline as the end of a sentence; a period followed by just one space | ||
| 543 | indicates an abbreviation and not the end of a sentence. To preserve | ||
| 544 | the distinction between these two ways of using a period, the fill | ||
| 545 | commands do not break a line after a period followed by just one space. | ||
| 546 | |||
| 547 | If the variable @code{sentence-end-double-space} is @code{nil}, the | ||
| 548 | fill commands expect and leave just one space at the end of a sentence. | ||
| 549 | Ordinarily this variable is @code{t}, so the fill commands insist on | ||
| 550 | two spaces for the end of a sentence, as explained above. @xref{Sentences}. | ||
| 551 | 545 | ||
| 552 | @vindex colon-double-space | 546 | @vindex colon-double-space |
| 553 | If the variable @code{colon-double-space} is non-@code{nil}, the | 547 | If the variable @code{colon-double-space} is non-@code{nil}, the |
| 554 | fill commands put two spaces after a colon. | 548 | fill commands put two spaces after a colon. |
| 555 | 549 | ||
| 556 | @vindex fill-nobreak-predicate | 550 | @vindex fill-nobreak-predicate |
| 557 | The variable @code{fill-nobreak-predicate} is a hook (an abnormal | 551 | To specify additional conditions where line-breaking is not allowed, |
| 558 | hook, @pxref{Hooks}) specifying additional conditions where | 552 | customize the abnormal hook variable @code{fill-nobreak-predicate} |
| 559 | line-breaking is not allowed. Each function is called with no | 553 | (@pxref{Hooks}). Each function in this hook is called with no |
| 560 | arguments, with point at a place where Emacs is considering breaking | 554 | arguments, with point positioned where Emacs is considering breaking a |
| 561 | the line. If a function returns a non-@code{nil} value, then that's | 555 | line. If a function returns a non-@code{nil} value, Emacs will not |
| 562 | a bad place to break the line. Two standard functions you can use are | 556 | break the line there. Two functions you can use are |
| 563 | @code{fill-single-word-nobreak-p} (don't break after the first word of | 557 | @code{fill-single-word-nobreak-p} (don't break after the first word of |
| 564 | a sentence or before the last) and @code{fill-french-nobreak-p} (don't | 558 | a sentence or before the last) and @code{fill-french-nobreak-p} (don't |
| 565 | break after @samp{(} or before @samp{)}, @samp{:} or @samp{?}). | 559 | break after @samp{(} or before @samp{)}, @samp{:} or @samp{?}). |
| @@ -568,12 +562,11 @@ break after @samp{(} or before @samp{)}, @samp{:} or @samp{?}). | |||
| 568 | @subsection The Fill Prefix | 562 | @subsection The Fill Prefix |
| 569 | 563 | ||
| 570 | @cindex fill prefix | 564 | @cindex fill prefix |
| 571 | To fill a paragraph in which each line starts with a special marker | 565 | The @dfn{fill prefix} feature allows paragraphs to be filled so that |
| 572 | (which might be a few spaces, giving an indented paragraph), you can use | 566 | each line starts with a special string of characters (such as a |
| 573 | the @dfn{fill prefix} feature. The fill prefix is a string that Emacs | 567 | sequence of spaces, giving an indented paragraph). You can specify a |
| 574 | expects every line to start with, and which is not included in filling. | 568 | fill prefix explicitly; otherwise, Emacs tries to deduce one |
| 575 | You can specify a fill prefix explicitly; Emacs can also deduce the | 569 | automatically (@pxref{Adaptive Fill}). |
| 576 | fill prefix automatically (@pxref{Adaptive Fill}). | ||
| 577 | 570 | ||
| 578 | @table @kbd | 571 | @table @kbd |
| 579 | @item C-x . | 572 | @item C-x . |
| @@ -597,15 +590,15 @@ after the @kbd{C-x}.) To turn off the fill prefix, specify an empty | |||
| 597 | prefix: type @w{@kbd{C-x .}}@: with point at the beginning of a line. | 590 | prefix: type @w{@kbd{C-x .}}@: with point at the beginning of a line. |
| 598 | 591 | ||
| 599 | When a fill prefix is in effect, the fill commands remove the fill | 592 | When a fill prefix is in effect, the fill commands remove the fill |
| 600 | prefix from each line of the paragraph before filling and insert it on | 593 | prefix from each line of the paragraph before filling, and insert it |
| 601 | each line after filling. (The beginning of the first line of the | 594 | on each line after filling. (The beginning of the first line of the |
| 602 | paragraph is left unchanged, since often that is intentionally | 595 | paragraph is left unchanged, since often that is intentionally |
| 603 | different.) Auto Fill mode also inserts the fill prefix automatically | 596 | different.) Auto Fill mode also inserts the fill prefix automatically |
| 604 | when it makes a new line. The @kbd{C-o} command inserts the fill | 597 | when it makes a new line (@pxref{Auto Fill}). The @kbd{C-o} command |
| 605 | prefix on new lines it creates, when you use it at the beginning of a | 598 | inserts the fill prefix on new lines it creates, when you use it at |
| 606 | line (@pxref{Blank Lines}). Conversely, the command @kbd{M-^} deletes | 599 | the beginning of a line (@pxref{Blank Lines}). Conversely, the |
| 607 | the prefix (if it occurs) after the newline that it deletes | 600 | command @kbd{M-^} deletes the prefix (if it occurs) after the newline |
| 608 | (@pxref{Indentation}). | 601 | that it deletes (@pxref{Indentation}). |
| 609 | 602 | ||
| 610 | For example, if @code{fill-column} is 40 and you set the fill prefix | 603 | For example, if @code{fill-column} is 40 and you set the fill prefix |
| 611 | to @samp{;; }, then @kbd{M-q} in the following text | 604 | to @samp{;; }, then @kbd{M-q} in the following text |
| @@ -755,17 +748,16 @@ Convert region to upper case (@code{upcase-region}). | |||
| 755 | @findex downcase-word | 748 | @findex downcase-word |
| 756 | @findex upcase-word | 749 | @findex upcase-word |
| 757 | @findex capitalize-word | 750 | @findex capitalize-word |
| 758 | The word conversion commands are the most useful. @kbd{M-l} | 751 | @kbd{M-l} (@code{downcase-word}) converts the word after point to |
| 759 | (@code{downcase-word}) converts the word after point to lower case, moving | 752 | lower case, moving past it. Thus, repeating @kbd{M-l} converts |
| 760 | past it. Thus, repeating @kbd{M-l} converts successive words. | 753 | successive words. @kbd{M-u} (@code{upcase-word}) converts to all |
| 761 | @kbd{M-u} (@code{upcase-word}) converts to all capitals instead, while | 754 | capitals instead, while @kbd{M-c} (@code{capitalize-word}) puts the |
| 762 | @kbd{M-c} (@code{capitalize-word}) puts the first letter of the word | 755 | first letter of the word into upper case and the rest into lower case. |
| 763 | into upper case and the rest into lower case. All these commands convert | 756 | All these commands convert several words at once if given an argument. |
| 764 | several words at once if given an argument. They are especially convenient | 757 | They are especially convenient for converting a large amount of text |
| 765 | for converting a large amount of text from all upper case to mixed case, | 758 | from all upper case to mixed case, because you can move through the |
| 766 | because you can move through the text using @kbd{M-l}, @kbd{M-u} or | 759 | text using @kbd{M-l}, @kbd{M-u} or @kbd{M-c} on each word as |
| 767 | @kbd{M-c} on each word as appropriate, occasionally using @kbd{M-f} instead | 760 | appropriate, occasionally using @kbd{M-f} instead to skip a word. |
| 768 | to skip a word. | ||
| 769 | 761 | ||
| 770 | When given a negative argument, the word case conversion commands apply | 762 | When given a negative argument, the word case conversion commands apply |
| 771 | to the appropriate number of words before point, but do not move point. | 763 | to the appropriate number of words before point, but do not move point. |
| @@ -799,9 +791,10 @@ enable the command, which means it will not ask for confirmation again. | |||
| 799 | @cindex mode, Text | 791 | @cindex mode, Text |
| 800 | @findex text-mode | 792 | @findex text-mode |
| 801 | 793 | ||
| 802 | When you edit files of text in a human language, it's more convenient | 794 | Text mode is a major mode for editing files of text in a human |
| 803 | to use Text mode rather than Fundamental mode. To enter Text mode, type | 795 | language. Files which have names ending in the extension @file{.txt} |
| 804 | @kbd{M-x text-mode}. | 796 | are usually opened in Text mode (@pxref{Choosing Modes}). To |
| 797 | explicitly switch to Text mode, type @kbd{M-x text-mode}. | ||
| 805 | 798 | ||
| 806 | In Text mode, only blank lines and page delimiters separate | 799 | In Text mode, only blank lines and page delimiters separate |
| 807 | paragraphs. As a result, paragraphs can be indented, and adaptive | 800 | paragraphs. As a result, paragraphs can be indented, and adaptive |
| @@ -809,46 +802,49 @@ filling determines what indentation to use when filling a paragraph. | |||
| 809 | @xref{Adaptive Fill}. | 802 | @xref{Adaptive Fill}. |
| 810 | 803 | ||
| 811 | @kindex TAB @r{(Text mode)} | 804 | @kindex TAB @r{(Text mode)} |
| 812 | Text mode defines @key{TAB} to run @code{indent-relative} | 805 | In Text mode, the @key{TAB} (@code{indent-for-tab-command}) command |
| 813 | (@pxref{Indentation}), so that you can conveniently indent a line like | 806 | usually inserts whitespace up to the next tab stop, instead of |
| 814 | the previous line. | 807 | indenting the current line. @xref{Indentation}, for details. |
| 815 | 808 | ||
| 816 | Text mode turns off the features concerned with comments except when | 809 | Text mode turns off the features concerned with comments except when |
| 817 | you explicitly invoke them. It changes the syntax table so that | 810 | you explicitly invoke them. It changes the syntax table so that |
| 818 | single-quotes are considered part of words. However, if a word starts | 811 | single-quotes are considered part of words (e.g. @samp{don't} is |
| 819 | with single-quotes, these are treated as a prefix for purposes such as | 812 | considered one word). However, if a word starts with a single-quote, |
| 820 | capitalization. That is, @kbd{M-c} will convert @samp{'hello'} into | 813 | it is treated as a prefix for the purposes of capitalization |
| 821 | @samp{'Hello'}, as expected. | 814 | (e.g. @kbd{M-c} converts @samp{'hello'} into @samp{'Hello'}, as |
| 815 | expected). | ||
| 822 | 816 | ||
| 823 | @cindex Paragraph-Indent Text mode | 817 | @cindex Paragraph-Indent Text mode |
| 824 | @cindex mode, Paragraph-Indent Text | 818 | @cindex mode, Paragraph-Indent Text |
| 825 | @findex paragraph-indent-text-mode | 819 | @findex paragraph-indent-text-mode |
| 826 | @findex paragraph-indent-minor-mode | 820 | @findex paragraph-indent-minor-mode |
| 827 | If you indent the first lines of paragraphs, then you should use | 821 | If you indent the first lines of paragraphs, then you should use |
| 828 | Paragraph-Indent Text mode rather than Text mode. In this mode, you | 822 | Paragraph-Indent Text mode (@kbd{M-x paragraph-indent-text-mode}) |
| 829 | do not need to have blank lines between paragraphs, because the | 823 | rather than Text mode. In that mode, you do not need to have blank |
| 830 | first-line indentation is sufficient to start a paragraph; however | 824 | lines between paragraphs, because the first-line indentation is |
| 831 | paragraphs in which every line is indented are not supported. Use | 825 | sufficient to start a paragraph; however paragraphs in which every |
| 832 | @kbd{M-x paragraph-indent-text-mode} to enter this mode. Use @kbd{M-x | 826 | line is indented are not supported. Use @kbd{M-x |
| 833 | paragraph-indent-minor-mode} to enable an equivalent minor mode in | 827 | paragraph-indent-minor-mode} to enable an equivalent minor mode for |
| 834 | situations where you can't change the major mode---in mail | 828 | situations where you shouldn't change the major mode---in mail |
| 835 | composition, for instance. | 829 | composition, for instance. |
| 836 | 830 | ||
| 837 | @kindex M-TAB @r{(Text mode)} | 831 | @kindex M-TAB @r{(Text mode)} |
| 838 | Text mode, and all the modes based on it, define @kbd{M-@key{TAB}} | 832 | Text mode binds @kbd{M-@key{TAB}} to @code{ispell-complete-word}. |
| 839 | as the command @code{ispell-complete-word}, which performs completion | 833 | This command performs completion of the partial word in the buffer |
| 840 | of the partial word in the buffer before point, using the spelling | 834 | before point, using the spelling dictionary as the space of possible |
| 841 | dictionary as the space of possible words. @xref{Spelling}. If your | 835 | words. @xref{Spelling}. If your window manager defines |
| 842 | window manager defines @kbd{M-@key{TAB}} to switch windows, you can | 836 | @kbd{M-@key{TAB}} to switch windows, you can type @kbd{@key{ESC} |
| 843 | type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}. | 837 | @key{TAB}} or @kbd{C-M-i} instead. |
| 844 | 838 | ||
| 845 | @vindex text-mode-hook | 839 | @vindex text-mode-hook |
| 846 | Entering Text mode runs the hook @code{text-mode-hook}. Other major | 840 | Entering Text mode runs the mode hook @code{text-mode-hook} |
| 847 | modes related to Text mode also run this hook, followed by hooks of | 841 | (@pxref{Major Modes}). |
| 848 | their own; this includes Paragraph-Indent Text mode, Nroff mode, | 842 | |
| 849 | @TeX{} mode, Outline mode, and Message mode. Hook functions on | 843 | The following sections describe several major modes that are |
| 850 | @code{text-mode-hook} can look at the value of @code{major-mode} to | 844 | @dfn{derived} from Text mode. These derivatives share most of the |
| 851 | see which of these modes is actually being entered. @xref{Hooks}. | 845 | features of Text mode described above. In particular, derivatives of |
| 846 | Text mode run @code{text-mode-hook} prior to running their own mode | ||
| 847 | hooks. | ||
| 852 | 848 | ||
| 853 | @node Outline Mode | 849 | @node Outline Mode |
| 854 | @section Outline Mode | 850 | @section Outline Mode |
| @@ -859,29 +855,34 @@ see which of these modes is actually being entered. @xref{Hooks}. | |||
| 859 | @findex outline-mode | 855 | @findex outline-mode |
| 860 | @findex outline-minor-mode | 856 | @findex outline-minor-mode |
| 861 | @vindex outline-minor-mode-prefix | 857 | @vindex outline-minor-mode-prefix |
| 862 | Outline mode is a major mode much like Text mode but intended for | 858 | @vindex outline-mode-hook |
| 863 | editing outlines. It allows you to make parts of the text temporarily | 859 | Outline mode is a major mode derived from Text mode, which is |
| 864 | invisible so that you can see the outline structure. Type @kbd{M-x | 860 | specialized for editing outlines. It provides commands to navigate |
| 865 | outline-mode} to switch to Outline mode as the major mode of the current | 861 | between entries in the outline structure, and commands to make parts |
| 866 | buffer. | 862 | of a buffer temporarily invisible, so that the outline structure may |
| 867 | 863 | be more easily viewed. Type @kbd{M-x outline-mode} to switch to | |
| 868 | When Outline mode makes a line invisible, the line does not appear | 864 | Outline mode. Entering Outline mode runs the hook |
| 869 | on the screen. The screen appears exactly as if the invisible line | 865 | @code{text-mode-hook} followed by the hook @code{outline-mode-hook} |
| 870 | were deleted, except that an ellipsis (three periods in a row) appears | 866 | (@pxref{Hooks}). |
| 871 | at the end of the previous visible line. (Multiple consecutive | 867 | |
| 872 | invisible lines produce just one ellipsis.) | 868 | When you use an Outline mode command to make a line invisible |
| 869 | (@pxref{Outline Visibility}), the line disappears from the screen. An | ||
| 870 | ellipsis (three periods in a row) is displayed at the end of the | ||
| 871 | previous visible line, to indicate the hidden text. Multiple | ||
| 872 | consecutive invisible lines produce just one ellipsis. | ||
| 873 | 873 | ||
| 874 | Editing commands that operate on lines, such as @kbd{C-n} and | 874 | Editing commands that operate on lines, such as @kbd{C-n} and |
| 875 | @kbd{C-p}, treat the text of the invisible line as part of the previous | 875 | @kbd{C-p}, treat the text of the invisible line as part of the |
| 876 | visible line. Killing the ellipsis at the end of a visible line | 876 | previous visible line. Killing the ellipsis at the end of a visible |
| 877 | really kills all the following invisible lines. | 877 | line really kills all the following invisible text associated with the |
| 878 | 878 | ellipsis. | |
| 879 | Outline minor mode provides the same commands as the major mode, | 879 | |
| 880 | Outline mode, but you can use it in conjunction with other major modes. | 880 | Outline minor mode is a buffer-local minor mode which provides the |
| 881 | Type @kbd{M-x outline-minor-mode} to enable the Outline minor mode in | 881 | same commands as the major mode, Outline mode, but can be used in |
| 882 | the current buffer. You can also specify this in the text of a file, | 882 | conjunction with other major modes. You can type @kbd{M-x |
| 883 | with a file local variable of the form @samp{mode: outline-minor} | 883 | outline-minor-mode} to toggle Outline minor mode in the current |
| 884 | (@pxref{File Variables}). | 884 | buffer, or use a file-local variable setting to enable it in a |
| 885 | specific file (@pxref{File Variables}). | ||
| 885 | 886 | ||
| 886 | @kindex C-c @@ @r{(Outline minor mode)} | 887 | @kindex C-c @@ @r{(Outline minor mode)} |
| 887 | The major mode, Outline mode, provides special key bindings on the | 888 | The major mode, Outline mode, provides special key bindings on the |
| @@ -890,17 +891,12 @@ with a file local variable of the form @samp{mode: outline-minor} | |||
| 890 | major mode's special commands. (The variable | 891 | major mode's special commands. (The variable |
| 891 | @code{outline-minor-mode-prefix} controls the prefix used.) | 892 | @code{outline-minor-mode-prefix} controls the prefix used.) |
| 892 | 893 | ||
| 893 | @vindex outline-mode-hook | ||
| 894 | Entering Outline mode runs the hook @code{text-mode-hook} followed by | ||
| 895 | the hook @code{outline-mode-hook} (@pxref{Hooks}). | ||
| 896 | |||
| 897 | @menu | 894 | @menu |
| 898 | * Format: Outline Format. What the text of an outline looks like. | 895 | * Outline Format:: What the text of an outline looks like. |
| 899 | * Motion: Outline Motion. Special commands for moving through | 896 | * Outline Motion:: Special commands for moving through outlines. |
| 900 | outlines. | 897 | * Outline Visibility:: Commands to control what is visible. |
| 901 | * Visibility: Outline Visibility. Commands to control what is visible. | 898 | * Outline Views:: Outlines and multiple views. |
| 902 | * Views: Outline Views. Outlines and multiple views. | 899 | * Foldout:: Folding means zooming in on outlines. |
| 903 | * Foldout:: Folding means zooming in on outlines. | ||
| 904 | @end menu | 900 | @end menu |
| 905 | 901 | ||
| 906 | @node Outline Format | 902 | @node Outline Format |
| @@ -910,13 +906,13 @@ the hook @code{outline-mode-hook} (@pxref{Hooks}). | |||
| 910 | @cindex body lines (Outline mode) | 906 | @cindex body lines (Outline mode) |
| 911 | Outline mode assumes that the lines in the buffer are of two types: | 907 | Outline mode assumes that the lines in the buffer are of two types: |
| 912 | @dfn{heading lines} and @dfn{body lines}. A heading line represents a | 908 | @dfn{heading lines} and @dfn{body lines}. A heading line represents a |
| 913 | topic in the outline. Heading lines start with one or more stars; the | 909 | topic in the outline. Heading lines start with one or more asterisk |
| 914 | number of stars determines the depth of the heading in the outline | 910 | (@samp{*}) characters; the number of asterisks determines the depth of |
| 915 | structure. Thus, a heading line with one star is a major topic; all the | 911 | the heading in the outline structure. Thus, a heading line with one |
| 916 | heading lines with two stars between it and the next one-star heading | 912 | @samp{*} is a major topic; all the heading lines with two @samp{*}s |
| 917 | are its subtopics; and so on. Any line that is not a heading line is a | 913 | between it and the next one-@samp{*} heading are its subtopics; and so |
| 918 | body line. Body lines belong with the preceding heading line. Here is | 914 | on. Any line that is not a heading line is a body line. Body lines |
| 919 | an example: | 915 | belong with the preceding heading line. Here is an example: |
| 920 | 916 | ||
| 921 | @example | 917 | @example |
| 922 | * Food | 918 | * Food |
| @@ -998,12 +994,10 @@ Move point up to a lower-level (more inclusive) visible heading line | |||
| 998 | @findex outline-previous-visible-heading | 994 | @findex outline-previous-visible-heading |
| 999 | @kindex C-c C-n @r{(Outline mode)} | 995 | @kindex C-c C-n @r{(Outline mode)} |
| 1000 | @kindex C-c C-p @r{(Outline mode)} | 996 | @kindex C-c C-p @r{(Outline mode)} |
| 1001 | @kbd{C-c C-n} (@code{outline-next-visible-heading}) moves down to the next | 997 | @kbd{C-c C-n} (@code{outline-next-visible-heading}) moves down to |
| 1002 | heading line. @kbd{C-c C-p} (@code{outline-previous-visible-heading}) moves | 998 | the next heading line. @kbd{C-c C-p} |
| 1003 | similarly backward. Both accept numeric arguments as repeat counts. The | 999 | (@code{outline-previous-visible-heading}) moves similarly backward. |
| 1004 | names emphasize that invisible headings are skipped, but this is not really | 1000 | Both accept numeric arguments as repeat counts. |
| 1005 | a special feature. All editing commands that look for lines ignore the | ||
| 1006 | invisible lines automatically. | ||
| 1007 | 1001 | ||
| 1008 | @findex outline-up-heading | 1002 | @findex outline-up-heading |
| 1009 | @findex outline-forward-same-level | 1003 | @findex outline-forward-same-level |
| @@ -1011,21 +1005,19 @@ invisible lines automatically. | |||
| 1011 | @kindex C-c C-f @r{(Outline mode)} | 1005 | @kindex C-c C-f @r{(Outline mode)} |
| 1012 | @kindex C-c C-b @r{(Outline mode)} | 1006 | @kindex C-c C-b @r{(Outline mode)} |
| 1013 | @kindex C-c C-u @r{(Outline mode)} | 1007 | @kindex C-c C-u @r{(Outline mode)} |
| 1014 | More powerful motion commands understand the level structure of headings. | 1008 | The commands @kbd{C-c C-f} (@code{outline-forward-same-level}) and |
| 1015 | @kbd{C-c C-f} (@code{outline-forward-same-level}) and | ||
| 1016 | @kbd{C-c C-b} (@code{outline-backward-same-level}) move from one | 1009 | @kbd{C-c C-b} (@code{outline-backward-same-level}) move from one |
| 1017 | heading line to another visible heading at the same depth in | 1010 | heading line to another visible heading at the same depth in the |
| 1018 | the outline. @kbd{C-c C-u} (@code{outline-up-heading}) moves | 1011 | outline. @kbd{C-c C-u} (@code{outline-up-heading}) moves backward to |
| 1019 | backward to another heading that is less deeply nested. | 1012 | another heading that is less deeply nested. |
| 1020 | 1013 | ||
| 1021 | @node Outline Visibility | 1014 | @node Outline Visibility |
| 1022 | @subsection Outline Visibility Commands | 1015 | @subsection Outline Visibility Commands |
| 1023 | 1016 | ||
| 1024 | The other special commands of outline mode are used to make lines visible | 1017 | Outline mode provides several commands for temporarily hiding or |
| 1025 | or invisible. Their names all start with @code{hide} or @code{show}. | 1018 | revealing parts of the buffer, based on the outline structure. These |
| 1026 | Most of them fall into pairs of opposites. They are not undoable; instead, | 1019 | commands are not undoable; their effects are simply not recorded by |
| 1027 | you can undo right past them. Making lines visible or invisible is simply | 1020 | the undo mechanism, so you can undo right past them (@pxref{Undo}). |
| 1028 | not recorded by the undo mechanism. | ||
| 1029 | 1021 | ||
| 1030 | Many of these commands act on the ``current'' heading line. If | 1022 | Many of these commands act on the ``current'' heading line. If |
| 1031 | point is on a heading line, that is the current heading line; if point | 1023 | point is on a heading line, that is the current heading line; if point |
| @@ -1069,72 +1061,64 @@ the headings leading up from there to the top level of the outline | |||
| 1069 | @findex show-entry | 1061 | @findex show-entry |
| 1070 | @kindex C-c C-c @r{(Outline mode)} | 1062 | @kindex C-c C-c @r{(Outline mode)} |
| 1071 | @kindex C-c C-e @r{(Outline mode)} | 1063 | @kindex C-c C-e @r{(Outline mode)} |
| 1072 | Two commands that are exact opposites are @kbd{C-c C-c} | 1064 | The simplest of these commands are @kbd{C-c C-c} |
| 1073 | (@code{hide-entry}) and @kbd{C-c C-e} (@code{show-entry}). They apply | 1065 | (@code{hide-entry}), which hides the body lines directly following the |
| 1074 | to the body lines directly following the current heading line. | 1066 | current heading line, and @kbd{C-c C-e} (@code{show-entry}), which |
| 1075 | Subheadings and their bodies are not affected. | 1067 | reveals them. Subheadings and their bodies are not affected. |
| 1076 | 1068 | ||
| 1077 | @findex hide-subtree | 1069 | @findex hide-subtree |
| 1078 | @findex show-subtree | 1070 | @findex show-subtree |
| 1079 | @kindex C-c C-s @r{(Outline mode)} | 1071 | @kindex C-c C-s @r{(Outline mode)} |
| 1080 | @kindex C-c C-d @r{(Outline mode)} | 1072 | @kindex C-c C-d @r{(Outline mode)} |
| 1081 | @cindex subtree (Outline mode) | 1073 | @cindex subtree (Outline mode) |
| 1082 | Two more powerful opposites are @kbd{C-c C-d} (@code{hide-subtree}) | 1074 | The commands @kbd{C-c C-d} (@code{hide-subtree}) and @kbd{C-c C-s} |
| 1083 | and @kbd{C-c C-s} (@code{show-subtree}). Both apply to the current | 1075 | (@code{show-subtree}) are more powerful. They apply to the current |
| 1084 | heading line's @dfn{subtree}: its body, all its subheadings, both | 1076 | heading line's @dfn{subtree}: its body, all of its subheadings, both |
| 1085 | direct and indirect, and all of their bodies. In other words, the | 1077 | direct and indirect, and all of their bodies. |
| 1086 | subtree contains everything following the current heading line, up to | ||
| 1087 | and not including the next heading of the same or higher rank. | ||
| 1088 | 1078 | ||
| 1089 | @findex hide-leaves | 1079 | @findex hide-leaves |
| 1090 | @findex show-branches | 1080 | @findex show-branches |
| 1081 | @findex show-children | ||
| 1091 | @kindex C-c C-l @r{(Outline mode)} | 1082 | @kindex C-c C-l @r{(Outline mode)} |
| 1092 | @kindex C-c C-k @r{(Outline mode)} | 1083 | @kindex C-c C-k @r{(Outline mode)} |
| 1093 | Intermediate between a visible subtree and an invisible one is having | ||
| 1094 | all the subheadings visible but none of the body. There are two | ||
| 1095 | commands for doing this, depending on whether you want to hide the | ||
| 1096 | bodies or make the subheadings visible. They are @kbd{C-c C-l} | ||
| 1097 | (@code{hide-leaves}) and @kbd{C-c C-k} (@code{show-branches}). | ||
| 1098 | |||
| 1099 | @kindex C-c C-i @r{(Outline mode)} | 1084 | @kindex C-c C-i @r{(Outline mode)} |
| 1100 | @findex show-children | 1085 | The command @kbd{C-c C-l} (@code{hide-leaves}) hides the body of the |
| 1101 | A little weaker than @code{show-branches} is @kbd{C-c C-i} | 1086 | current heading line as well as all the bodies in its subtree; the |
| 1102 | (@code{show-children}). It makes just the direct subheadings | 1087 | subheadings themselves are left visible. The command @kbd{C-c C-k} |
| 1103 | visible---those one level down. Deeper subheadings remain invisible, if | 1088 | (@code{show-branches}) reveals the subheadings, if they had previously |
| 1104 | they were invisible. | 1089 | been hidden (e.g. by @kbd{C-c C-d}). The command @kbd{C-c C-i} |
| 1090 | (@code{show-children}) is a weaker version of this; it reveals just | ||
| 1091 | the direct subheadings, i.e. those one level down. | ||
| 1092 | |||
| 1093 | @findex hide-other | ||
| 1094 | @kindex C-c C-o @r{(Outline mode)} | ||
| 1095 | The command @kbd{C-c C-o} (@code{hide-other}) hides everything | ||
| 1096 | except the entry that point is in, plus its parents (the headers | ||
| 1097 | leading up from there to top level in the outline) and the top level | ||
| 1098 | headings. | ||
| 1105 | 1099 | ||
| 1106 | @findex hide-body | 1100 | @findex hide-body |
| 1107 | @findex show-all | 1101 | @findex show-all |
| 1108 | @kindex C-c C-t @r{(Outline mode)} | 1102 | @kindex C-c C-t @r{(Outline mode)} |
| 1109 | @kindex C-c C-a @r{(Outline mode)} | 1103 | @kindex C-c C-a @r{(Outline mode)} |
| 1110 | Two commands have a blanket effect on the whole file. @kbd{C-c C-t} | ||
| 1111 | (@code{hide-body}) makes all body lines invisible, so that you see just | ||
| 1112 | the outline structure (as a special exception, it will not hide lines | ||
| 1113 | at the top of the file, preceding the first header line, even though | ||
| 1114 | these are technically body lines). @kbd{C-c C-a} (@code{show-all}) | ||
| 1115 | makes all lines visible. These commands can be thought of as a pair | ||
| 1116 | of opposites even though @kbd{C-c C-a} applies to more than just body | ||
| 1117 | lines. | ||
| 1118 | |||
| 1119 | @findex hide-sublevels | 1104 | @findex hide-sublevels |
| 1120 | @kindex C-c C-q @r{(Outline mode)} | 1105 | @kindex C-c C-q @r{(Outline mode)} |
| 1121 | The command @kbd{C-c C-q} (@code{hide-sublevels}) hides all but the | 1106 | The remaining commands affect the whole buffer. @kbd{C-c C-t} |
| 1122 | top level headings. With a numeric argument @var{n}, it hides everything | 1107 | (@code{hide-body}) makes all body lines invisible, so that you see |
| 1123 | except the top @var{n} levels of heading lines. | 1108 | just the outline structure (as a special exception, it will not hide |
| 1124 | 1109 | lines at the top of the file, preceding the first header line, even | |
| 1125 | @findex hide-other | 1110 | though these are technically body lines). @kbd{C-c C-a} |
| 1126 | @kindex C-c C-o @r{(Outline mode)} | 1111 | (@code{show-all}) makes all lines visible. @kbd{C-c C-q} |
| 1127 | The command @kbd{C-c C-o} (@code{hide-other}) hides everything except | 1112 | (@code{hide-sublevels}) hides all but the top level headings; with a |
| 1128 | the heading and body text that point is in, plus its parents (the headers | 1113 | numeric argument @var{n}, it hides everything except the top @var{n} |
| 1129 | leading up from there to top level in the outline) and the top level | 1114 | levels of heading lines. |
| 1130 | headings. | ||
| 1131 | 1115 | ||
| 1132 | @findex reveal-mode | 1116 | @findex reveal-mode |
| 1133 | When incremental search finds text that is hidden by Outline mode, | 1117 | When incremental search finds text that is hidden by Outline mode, |
| 1134 | it makes that part of the buffer visible. If you exit the search | 1118 | it makes that part of the buffer visible. If you exit the search at |
| 1135 | at that position, the text remains visible. You can also | 1119 | that position, the text remains visible. You can also automatically |
| 1136 | automatically make text visible as you navigate in it by using | 1120 | make text visible as you navigate in it by using Reveal mode (@kbd{M-x |
| 1137 | @kbd{M-x reveal-mode}. | 1121 | reveal-mode}), a buffer-local minor mode. |
| 1138 | 1122 | ||
| 1139 | @node Outline Views | 1123 | @node Outline Views |
| 1140 | @subsection Viewing One Outline in Multiple Views | 1124 | @subsection Viewing One Outline in Multiple Views |
| @@ -1254,7 +1238,7 @@ it in order for this to take effect. | |||
| 1254 | 1238 | ||
| 1255 | To use the Foldout package, you can type @kbd{M-x load-library | 1239 | To use the Foldout package, you can type @kbd{M-x load-library |
| 1256 | @key{RET} foldout @key{RET}}; or you can arrange for to do that | 1240 | @key{RET} foldout @key{RET}}; or you can arrange for to do that |
| 1257 | automatically by putting this in your @file{.emacs} file: | 1241 | automatically by putting this in your init file (@pxref{Init File}): |
| 1258 | 1242 | ||
| 1259 | @example | 1243 | @example |
| 1260 | (eval-after-load "outline" '(require 'foldout)) | 1244 | (eval-after-load "outline" '(require 'foldout)) |