comparison lisp/allout.el @ 3591:507f64624555

Apply typo patches from Paul Eggert.
author Jim Blandy <jimb@redhat.com>
date Wed, 09 Jun 1993 11:59:12 +0000
parents a4d9c9bc3994
children fe3bea12d381
comparison
equal deleted inserted replaced
3590:d5f22061277d 3591:507f64624555
9 ;;;_ + Package Identification Stuff 9 ;;;_ + Package Identification Stuff
10 10
11 ;;;_ - Author: Ken Manheimer <klm@nist.gov> 11 ;;;_ - Author: Ken Manheimer <klm@nist.gov>
12 ;;;_ - Maintainer: Ken Manheimer <klm@nist.gov> 12 ;;;_ - Maintainer: Ken Manheimer <klm@nist.gov>
13 ;;;_ - Created: Dec 1991 - first release to usenet 13 ;;;_ - Created: Dec 1991 - first release to usenet
14 ;;;_ - Version: $Id: allout.el,v 1.1 1993/06/02 17:53:31 rms Exp rms $|| 14 ;;;_ - Version: $Id: allout.el,v 1.2 1993/06/07 18:48:08 rms Exp jimb $||
15 ;;;_ - Keywords: outline mode 15 ;;;_ - Keywords: outline mode
16 16
17 ;;;_ - LCD Archive Entry 17 ;;;_ - LCD Archive Entry
18 18
19 ;; LCD Archive Entry: 19 ;; LCD Archive Entry:
20 ;; allout|Ken Manheimer|klm@nist.gov 20 ;; allout|Ken Manheimer|klm@nist.gov
21 ;; |A more thorough outline-mode 21 ;; |A more thorough outline-mode
22 ;; |27-May-1993|$Id: allout.el,v 1.1 1993/06/02 17:53:31 rms Exp rms $|| 22 ;; |27-May-1993|$Id: allout.el,v 1.2 1993/06/07 18:48:08 rms Exp jimb $||
23 23
24 ;;;_ - Description 24 ;;;_ - Description
25 ;; A full-fledged outline mode, based on the original rudimentary 25 ;; A full-fledged outline mode, based on the original rudimentary
26 ;; GNU emacs outline functionality. 26 ;; GNU emacs outline functionality.
27 ;; 27 ;;
63 "* Leading string for greater than level 0 topic headers.") 63 "* Leading string for greater than level 0 topic headers.")
64 (make-variable-buffer-local 'outline-header-subtraction) 64 (make-variable-buffer-local 'outline-header-subtraction)
65 65
66 ;;;_ = outline-primary-bullet 66 ;;;_ = outline-primary-bullet
67 (defvar outline-primary-bullet "*") ;; Changing this var disables any 67 (defvar outline-primary-bullet "*") ;; Changing this var disables any
68 ;; backwards compatability with 68 ;; backwards compatibility with
69 ;; the original outline mode. 69 ;; the original outline mode.
70 (make-variable-buffer-local 'outline-primary-bullet) 70 (make-variable-buffer-local 'outline-primary-bullet)
71 71
72 ;;;_ = outline-plain-bullets-string 72 ;;;_ = outline-plain-bullets-string
73 (defvar outline-plain-bullets-string "" 73 (defvar outline-plain-bullets-string ""
331 (concat "\\(\\`\\)\\(" outline-regexp "\\)")) 331 (concat "\\(\\`\\)\\(" outline-regexp "\\)"))
332 ) 332 )
333 333
334 ;;;_ : Key bindings 334 ;;;_ : Key bindings
335 ;;;_ = Generic minor keybindings control 335 ;;;_ = Generic minor keybindings control
336 ;;;_ ; Stallmans suggestion 336 ;;;_ ; Stallman's suggestion
337 (defvar outline-mode-map nil "") 337 (defvar outline-mode-map nil "")
338 338
339 (if outline-mode-map 339 (if outline-mode-map
340 nil 340 nil
341 (setq outline-mode-map (nconc (make-sparse-keymap) text-mode-map)) 341 (setq outline-mode-map (nconc (make-sparse-keymap) text-mode-map))
592 A topic is composed of a HEADER, a BODY, and SUBTOPICs (see below). 592 A topic is composed of a HEADER, a BODY, and SUBTOPICs (see below).
593 593
594 Exposure: Hidden (~closed~) topics are represented by ellipses ('...') 594 Exposure: Hidden (~closed~) topics are represented by ellipses ('...')
595 at the end of the visible SUPERTOPIC which contains them, 595 at the end of the visible SUPERTOPIC which contains them,
596 rather than by their actual text. Hidden topics are still 596 rather than by their actual text. Hidden topics are still
597 susceptable to editing and regular movement functions, they 597 susceptible to editing and regular movement functions, they
598 just are not displayed normally, effectively collapsed into 598 just are not displayed normally, effectively collapsed into
599 the ellipses which represent them. Outline mode provides 599 the ellipses which represent them. Outline mode provides
600 the means to selectively expose topics based on their 600 the means to selectively expose topics based on their
601 NESTING. 601 NESTING.
602 602
616 616
617 Header: The initial portion of an outline topic. It is composed of a 617 Header: The initial portion of an outline topic. It is composed of a
618 topic header PREFIX at the beginning of the line, followed by 618 topic header PREFIX at the beginning of the line, followed by
619 text to the end of the EFFECTIVE LINE. 619 text to the end of the EFFECTIVE LINE.
620 620
621 Body: Any subsequent lines of text following a topic header and preceeding 621 Body: Any subsequent lines of text following a topic header and preceding
622 the next one. This is also referred to as the entry for a topic. 622 the next one. This is also referred to as the entry for a topic.
623 623
624 Prefix: The text which distinguishes topic headers from normal text 624 Prefix: The text which distinguishes topic headers from normal text
625 lines. There are two forms, both of which start at the beginning 625 lines. There are two forms, both of which start at the beginning
626 of the topic header (EFFECTIVE) line. The length of the prefix 626 of the topic header (EFFECTIVE) line. The length of the prefix
627 represents the DEPTH of the topic. The fundamental sort begins 627 represents the DEPTH of the topic. The fundamental sort begins
628 either with solely an asterisk ('*') or else dot ('.') followed 628 either with solely an asterisk ('*') or else dot ('.') followed
629 by zero or more spaces and then an outline BULLET. [Note - you 629 by zero or more spaces and then an outline BULLET. [Note - you
630 can now designate your own, arbitrary HEADER-LEAD string, by 630 can now designate your own, arbitrary HEADER-LEAD string, by
631 setting the variable 'outline-header-prefix'.] The second form 631 setting the variable 'outline-header-prefix'.] The second form
632 is for backwards compatability with the original emacs outline 632 is for backwards compatibility with the original emacs outline
633 mode, and consists solely of asterisks. Both sorts are 633 mode, and consists solely of asterisks. Both sorts are
634 recognized by all outline commands. The first sort is generated 634 recognized by all outline commands. The first sort is generated
635 by outline topic production commands if the emacs variable 635 by outline topic production commands if the emacs variable
636 outline-old-style-prefixes is nil, otherwise the second style is 636 outline-old-style-prefixes is nil, otherwise the second style is
637 used. 637 used.
1654 NUMBER-CONTROL and nil INDEX forces non-numbered format on the 1654 NUMBER-CONTROL and nil INDEX forces non-numbered format on the
1655 bullet. Non-nil NUMBER-CONTROL and non-nil, non-number INDEX means 1655 bullet. Non-nil NUMBER-CONTROL and non-nil, non-number INDEX means
1656 that the index for the numbered prefix will be derived, by counting 1656 that the index for the numbered prefix will be derived, by counting
1657 siblings back to start of level. If INDEX is a number, then that 1657 siblings back to start of level. If INDEX is a number, then that
1658 number is used as the index for the numbered prefix (allowing, eg, 1658 number is used as the index for the numbered prefix (allowing, eg,
1659 sequential renumbering to not requre this function counting back the 1659 sequential renumbering to not require this function counting back the
1660 index for each successive sibling)." 1660 index for each successive sibling)."
1661 1661
1662 ;; The options are ordered in likely frequence of use, most common 1662 ;; The options are ordered in likely frequence of use, most common
1663 ;; highest, least lowest. Ie, more likely to be doing prefix 1663 ;; highest, least lowest. Ie, more likely to be doing prefix
1664 ;; adjustments than soliciting, and yet more than numbering. 1664 ;; adjustments than soliciting, and yet more than numbering.
1776 single-spacing is used. 1776 single-spacing is used.
1777 1777
1778 - Creation of sibling or nested topics is with respect to the topic 1778 - Creation of sibling or nested topics is with respect to the topic
1779 you're starting from, even when creating backwards. This way you 1779 you're starting from, even when creating backwards. This way you
1780 can easily create a sibling in front of the current topic without 1780 can easily create a sibling in front of the current topic without
1781 having to go to it's preceeding sibling, and then open forward 1781 having to go to its preceding sibling, and then open forward
1782 from there." 1782 from there."
1783 1783
1784 (let* ((depth (+ (outline-current-depth) relative-depth)) 1784 (let* ((depth (+ (outline-current-depth) relative-depth))
1785 (opening-on-blank (if (looking-at "^\$") 1785 (opening-on-blank (if (looking-at "^\$")
1786 (not (setq before nil)))) 1786 (not (setq before nil))))
1812 (goto-char ref-topic) 1812 (goto-char ref-topic)
1813 (setq dbl-space ; Determine double space action: 1813 (setq dbl-space ; Determine double space action:
1814 (or (and (not (> relative-depth 0)) 1814 (or (and (not (> relative-depth 0))
1815 ;; not descending, 1815 ;; not descending,
1816 (save-excursion 1816 (save-excursion
1817 ;; preceeded by a blank line? 1817 ;; preceded by a blank line?
1818 (forward-line -1) 1818 (forward-line -1)
1819 (looking-at "^\\s-*$"))) 1819 (looking-at "^\\s-*$")))
1820 (and (= ref-depth 1) 1820 (and (= ref-depth 1)
1821 (or before 1821 (or before
1822 (= depth 1) 1822 (= depth 1)
1904 ;;;_ > outline-reindent-body (old-depth new-depth) 1904 ;;;_ > outline-reindent-body (old-depth new-depth)
1905 (defun outline-reindent-body (old-depth new-depth) 1905 (defun outline-reindent-body (old-depth new-depth)
1906 " Reindent body lines which were indented at old-depth to new-depth. 1906 " Reindent body lines which were indented at old-depth to new-depth.
1907 1907
1908 Note that refill of indented paragraphs is not done, and tabs are 1908 Note that refill of indented paragraphs is not done, and tabs are
1909 not accomodated. ('untabify' your outline if you want to preserve 1909 not accommodated. ('untabify' your outline if you want to preserve
1910 hanging body indents.)" 1910 hanging body indents.)"
1911 1911
1912 (save-excursion 1912 (save-excursion
1913 (save-restriction 1913 (save-restriction
1914 (outline-goto-prefix) 1914 (outline-goto-prefix)
2290 (looking-at outline-regexp))) 2290 (looking-at outline-regexp)))
2291 (setq established-depth (- (match-end 0) (match-beginning 0)))) 2291 (setq established-depth (- (match-end 0) (match-beginning 0))))
2292 (yank arg) 2292 (yank arg)
2293 (exchange-dot-and-mark) 2293 (exchange-dot-and-mark)
2294 (if (and established-depth ; the established stuff qualifies. 2294 (if (and established-depth ; the established stuff qualifies.
2295 ;; The yanked stuff also qualfies - is topic(s): 2295 ;; The yanked stuff also qualifies - is topic(s):
2296 (looking-at (concat "\\(" outline-regexp "\\)"))) 2296 (looking-at (concat "\\(" outline-regexp "\\)")))
2297 ;; Ok, adjust the depth of the yanked stuff. Note that the 2297 ;; Ok, adjust the depth of the yanked stuff. Note that the
2298 ;; stuff may have more than a single root, so we have to 2298 ;; stuff may have more than a single root, so we have to
2299 ;; iterate over all the top level ones yanked, and do them in 2299 ;; iterate over all the top level ones yanked, and do them in
2300 ;; such a way that the adjustment of one new one won't affect 2300 ;; such a way that the adjustment of one new one won't affect
2424 (error "%s not found" file-name)) 2424 (error "%s not found" file-name))
2425 ) 2425 )
2426 ) 2426 )
2427 ) 2427 )
2428 ) 2428 )
2429 ;;;_ > outline-to-entry-end - Unmaintained compatability - ignore this! 2429 ;;;_ > outline-to-entry-end - Unmaintained compatibility - ignore this!
2430 ;------------------------------------------------------------------- 2430 ;-------------------------------------------------------------------
2431 ; Something added solely for use by a "smart menu" package someone got 2431 ; Something added solely for use by a "smart menu" package someone got
2432 ; off the net. I have no idea whether this is appropriate code. 2432 ; off the net. I have no idea whether this is appropriate code.
2433 2433
2434 (defvar next-entry-exists nil "Used by outline-to-entry-end, dunno why.") 2434 (defvar next-entry-exists nil "Used by outline-to-entry-end, dunno why.")
2536 ; Conditionally insert prefix 2536 ; Conditionally insert prefix
2537 ; leader customization: 2537 ; leader customization:
2538 (if arg (insert-string (format "\t\t\t(%s \"%s\")\n" 2538 (if arg (insert-string (format "\t\t\t(%s \"%s\")\n"
2539 "outline-lead-with-comment-string" 2539 "outline-lead-with-comment-string"
2540 arg))) 2540 arg)))
2541 ; Insert ammouncement and 2541 ; Insert announcement and
2542 ; exposure control: 2542 ; exposure control:
2543 (insert-string 2543 (insert-string
2544 (format "\t\t\t%s %s\n\t\t\t%s %s\n\t\t%s %s" 2544 (format "\t\t\t%s %s\n\t\t\t%s %s\n\t\t%s %s"
2545 "(message \"Adjusting '%s' visibility\"" 2545 "(message \"Adjusting '%s' visibility\""
2546 "(buffer-name))" 2546 "(buffer-name))"