Convert consecutive FSF copyright years to ranges.
[bpt/emacs.git] / lisp / outline.el
index e350cbd..d43afd9 100644 (file)
@@ -1,7 +1,7 @@
 ;;; outline.el --- outline mode commands for Emacs
 
-;; Copyright (C) 1986, 1993, 1994, 1995, 1997, 2000, 2001, 2002,
-;;   2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1986, 1993-1995, 1997, 2000-2011
+;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: outlines
@@ -41,7 +41,7 @@
 (defgroup outlines nil
   "Support for hierarchical outlining."
   :prefix "outline-"
-  :group 'editing)
+  :group 'wp)
 
 (defcustom outline-regexp "[*\^L]+"
   "Regular expression to match the beginning of a heading.
@@ -347,7 +347,7 @@ Turning on outline mode calls the value of `text-mode-hook' and then of
   (add-hook 'change-major-mode-hook 'show-all nil t))
 
 (defcustom outline-minor-mode-prefix "\C-c@"
-  "*Prefix key to use for Outline commands in Outline minor mode.
+  "Prefix key to use for Outline commands in Outline minor mode.
 The value of this variable is checked as part of loading Outline mode.
 After that, changing the prefix key requires manipulating keymaps."
   :type 'string
@@ -380,6 +380,7 @@ See the command `outline-mode' for more information on this mode."
   "*Function of no args to compute a header's nesting level in an outline.
 It can assume point is at the beginning of a header line and that the match
 data reflects the `outline-regexp'.")
+;;;###autoload(put 'outline-level 'risky-local-variable t)
 
 (defvar outline-heading-alist ()
   "Alist associating a heading for every possible level.
@@ -444,10 +445,6 @@ at the end of the buffer."
   "Non-nil if the character after point is invisible."
   (get-char-property (or pos (point)) 'invisible))
 
-(defun outline-visible ()
-  (not (outline-invisible-p)))
-(make-obsolete 'outline-visible 'outline-invisible-p "21.1")
-
 (defun outline-back-to-heading (&optional invisible-ok)
   "Move to previous heading line, or beg of this line if it's a heading.
 Only visible heading lines are considered, unless INVISIBLE-OK is non-nil."
@@ -594,7 +591,7 @@ If there are no such entries, return nil.
 ALIST defaults to `outline-heading-alist'.
 Similar to (car (rassoc LEVEL ALIST)).
 If there are several different entries with same new level, choose
-the one with the smallest distance to the assocation of HEAD in the alist.
+the one with the smallest distance to the association of HEAD in the alist.
 This makes it possible for promotion to work in modes with several
 independent sets of headings (numbered, unnumbered, appendix...)"
   (unless alist (setq alist outline-heading-alist))
@@ -905,6 +902,8 @@ Show the heading too, if it is currently invisible."
                   (goto-char (point-max))
                   ;; Keep empty last line, if available.
                   (if (bolp) (1- (point)) (point)))))
+      (if (< end beg)
+         (setq beg (prog1 end (setq end beg))))
       ;; First hide everything.
       (outline-flag-region beg end t)
       ;; Then unhide the top level headers.
@@ -912,7 +911,11 @@ Show the heading too, if it is currently invisible."
        (lambda ()
         (if (<= (funcall outline-level) levels)
             (outline-show-heading)))
-       beg end)))
+       beg end)
+      ;; Finally unhide any trailing newline.
+      (goto-char (point-max))
+      (if (and (bolp) (not (bobp)) (outline-invisible-p (1- (point))))
+          (outline-flag-region (1- (point)) (point) nil))))
   (run-hooks 'outline-view-change-hook))
 
 (defun hide-other ()
@@ -1115,5 +1118,4 @@ convenient way to make a table of contents of the buffer."
 (provide 'outline)
 (provide 'noutline)
 
-;; arch-tag: 1724410e-7d4d-4f46-b801-49e18171e874
 ;;; outline.el ends here