home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1993-11-09 | 9.3 KB | 150 lines | [ dELC/EMAC]
(defvar outline-regexp "[*]+" "\ *Regular expression to match the beginning of a heading line. Any line whose beginning matches this regexp is considered a heading. The recommended way to set this is with a Local Variables: list in the file it applies to.") (defvar outline-mode-map nil "\ ") (if outline-mode-map nil (setq outline-mode-map (copy-keymap text-mode-map)) (define-key outline-mode-map "" (quote outline-next-visible-heading)) (define-key outline-mode-map "" (quote outline-previous-visible-heading)) (define-key outline-mode-map " " (quote show-children)) (define-key outline-mode-map "" (quote show-subtree)) (define-key outline-mode-map "" (quote hide-subtree)) (define-key outline-mode-map "" (quote outline-up-heading)) (define-key outline-mode-map "" (quote outline-forward-same-level)) (define-key outline-mode-map "" (quote outline-backward-same-level))) (defun outline-mode nil "\ Set major mode for editing outlines with selective display. Headings are lines which start with asterisks: one for major headings, two for subheadings, etc. Lines not starting with asterisks are body lines. Body text or subheadings under a heading can be made temporarily invisible, or visible again. Invisible lines are attached to the end of the heading, so they move with it, if the line is killed and yanked back. A heading with text hidden under it is marked with an ellipsis (...). Commands: C-c C-n outline-next-visible-heading move by visible headings C-c C-p outline-previous-visible-heading C-c C-f outline-forward-same-level similar but skip subheadings C-c C-b outline-backward-same-level C-c C-u outline-up-heading move from subheading to heading Meta-x hide-body make all text invisible (not headings). Meta-x show-all make everything in buffer visible. The remaining commands are used when point is on a heading line. They apply to some of the body or subheadings of that heading. C-c C-h hide-subtree make body and subheadings invisible. C-c C-s show-subtree make body and subheadings visible. C-c C-i show-children make direct subheadings visible. No effect on body, or subheadings 2 or more levels down. With arg N, affects subheadings N levels down. M-x hide-entry make immediately following body invisible. M-x show-entry make it visible. M-x hide-leaves make body under heading and under its subheadings invisible. The subheadings remain visible. M-x show-branches make all subheadings at all levels visible. The variable outline-regexp can be changed to control what is a heading. A line is a heading if outline-regexp matches something at the beginning of the line. The longer the match, the deeper the level. Turning on outline mode calls the value of text-mode-hook and then of outline-mode-hook, if they are non-nil." (interactive) (byte-code "≈àà à¡âàÕ !àŒâàœâà–«≈\"àâà—!à“…!à ” ‘Râ à“À!à” ‘Râà’÷◊\"á" [selective-display t outline-mode-map mode-name major-mode nil local-abbrev-table text-mode-abbrev-table text-mode-syntax-table paragraph-start outline-regexp paragraph-separate kill-all-local-variables use-local-map "Outline" outline-mode define-abbrev-table set-syntax-table make-local-variable "\\|^\\(" "\\)" run-hooks text-mode-hook outline-mode-hook] 10)) (defun outline-level nil "\ Return the depth to which a statement is nested in the outline. Point must be at the beginning of a header line. This is actually the length of whatever outline-regexp matches." (byte-code "ä¡!à¬√!ƒ√!Z)á" [outline-regexp looking-at match-end 0 match-beginning] 5)) (defun outline-next-preface nil "\ Skip forward to just before the next heading line." (byte-code "¬√ƒQ¡≈#Ö Δ«!bàh»>Ö … !á" [outline-regexp nil re-search-forward "[ ]\\(" "\\)" move match-beginning 0 (10 13) forward-char -1] 4)) (defun outline-next-heading nil "\ Move to the next (possibly invisible) heading line." (interactive) (byte-code "¡à¬√ƒQ¡≈#Ö Δ«!Tbá" [outline-regexp nil re-search-forward "[ ]\\(" "\\)" move match-beginning 0] 4)) (defun outline-back-to-heading nil "\ Move to previous (possibly invisible) heading line, or to beginning of this line if it is a heading line." (byte-code "¬ à√ Ü ƒ≈ΔQ¡«#á" [outline-regexp nil beginning-of-line outline-on-heading-p re-search-backward "^\\(" "\\)" move] 6)) (defun outline-on-heading-p nil "\ Return T if point is on a header line." (byte-code "ä¡ àh¬=Ö