# HG changeset patch # User Juri Linkov # Date 1083383070 0 # Node ID 8362eef794e3dfd96f71f3d0c48c51d52017c980 # Parent ee2b597412c99a2581836d1c0fe73237354d3b44 (outline-blank-line): New var. (outline-next-preface, outline-show-heading) (outline-end-of-subtree): Use it. diff -r ee2b597412c9 -r 8362eef794e3 lisp/outline.el --- a/lisp/outline.el Sat May 01 03:30:24 2004 +0000 +++ b/lisp/outline.el Sat May 01 03:44:30 2004 +0000 @@ -216,6 +216,9 @@ (defvar outline-mode-hook nil "*This hook is run when outline mode starts.") +(defvar outline-blank-line nil + "*Non-nil means to leave unhidden blank line before heading.") + ;;;###autoload (define-derived-mode outline-mode text-mode "Outline" "Set major mode for editing outlines with selective display. @@ -349,7 +352,7 @@ (if (re-search-forward (concat "\n\\(?:" outline-regexp "\\)") nil 'move) (goto-char (match-beginning 0))) - (if (and (bolp) (eobp) (not (bobp))) + (if (and (bolp) (or outline-blank-line (eobp)) (not (bobp))) (forward-char -1))) (defun outline-next-heading () @@ -769,7 +772,11 @@ (defun outline-show-heading () "Show the current heading and move to its end." - (outline-flag-region (- (point) (if (bobp) 0 1)) + (outline-flag-region (- (point) + (if (bobp) 0 + (if (and outline-blank-line + (eq (char-before (1- (point))) ?\n)) + 2 1))) (progn (outline-end-of-heading) (point)) nil)) @@ -837,7 +844,10 @@ (if (bolp) (progn ;; Go to end of line before heading - (forward-char -1))))) + (forward-char -1) + (if (and outline-blank-line (bolp)) + ;; leave blank line before heading + (forward-char -1)))))) (defun show-branches () "Show all subheadings of this heading, but not their bodies."