comparison lisp/outline.el @ 90361:a7364c1a561e

Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-40 Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 135-143) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 49-55) - Merge from emacs--devo--0 - Update from CVS - Update from CVS: Makefile.in (release-*): New targets.
author Miles Bader <miles@gnu.org>
date Thu, 09 Mar 2006 07:15:37 +0000
parents c5406394f567 c379d6c262b1
children a5812696f7bf
comparison
equal deleted inserted replaced
90360:23b7c43b24ce 90361:a7364c1a561e
44 "Support for hierarchical outlining." 44 "Support for hierarchical outlining."
45 :prefix "outline-" 45 :prefix "outline-"
46 :group 'editing) 46 :group 'editing)
47 47
48 (defcustom outline-regexp "[*\^L]+" 48 (defcustom outline-regexp "[*\^L]+"
49 "*Regular expression to match the beginning of a heading. 49 "Regular expression to match the beginning of a heading.
50 Any line whose beginning matches this regexp is considered to start a heading. 50 Any line whose beginning matches this regexp is considered to start a heading.
51 Note that Outline mode only checks this regexp at the start of a line, 51 Note that Outline mode only checks this regexp at the start of a line,
52 so the regexp need not (and usually does not) start with `^'. 52 so the regexp need not (and usually does not) start with `^'.
53 The recommended way to set this is with a Local Variables: list 53 The recommended way to set this is with a Local Variables: list
54 in the file it applies to. See also `outline-heading-end-regexp'." 54 in the file it applies to. See also `outline-heading-end-regexp'."
55 :type '(choice regexp (const nil)) 55 :type '(choice regexp (const nil))
56 :group 'outlines) 56 :group 'outlines)
57 57
58 (defcustom outline-heading-end-regexp "\n" 58 (defcustom outline-heading-end-regexp "\n"
59 "*Regular expression to match the end of a heading line. 59 "Regular expression to match the end of a heading line.
60 You can assume that point is at the beginning of a heading when this 60 You can assume that point is at the beginning of a heading when this
61 regexp is searched for. The heading ends at the end of the match. 61 regexp is searched for. The heading ends at the end of the match.
62 The recommended way to set this is with a `Local Variables:' list 62 The recommended way to set this is with a `Local Variables:' list
63 in the file it applies to." 63 in the file it applies to."
64 :type 'regexp 64 :type 'regexp
826 (progn (outline-end-of-heading) (point)) 826 (progn (outline-end-of-heading) (point))
827 nil)) 827 nil))
828 828
829 (defun hide-sublevels (levels) 829 (defun hide-sublevels (levels)
830 "Hide everything but the top LEVELS levels of headers, in whole buffer." 830 "Hide everything but the top LEVELS levels of headers, in whole buffer."
831 (interactive "p") 831 (interactive (list
832 (cond
833 (current-prefix-arg (prefix-numeric-value current-prefix-arg))
834 ((save-excursion (beginning-of-line)
835 (looking-at outline-regexp))
836 (funcall outline-level))
837 (t 1))))
832 (if (< levels 1) 838 (if (< levels 1)
833 (error "Must keep at least one level of headers")) 839 (error "Must keep at least one level of headers"))
834 (let (outline-view-change-hook) 840 (let (outline-view-change-hook)
835 (save-excursion 841 (save-excursion
836 (goto-char (point-min)) 842 (goto-char (point-min))