# HG changeset patch # User Juri Linkov # Date 1083252861 0 # Node ID 53c5c7a2f4a8d51e6dd91314b2f52ae1a0ae79b2 # Parent 193a4c33253622bfd575e4fc6870b8fdc4e8aa16 (outline-next-preface, outline-show-heading): Don't leave unhidden blank line before heading. (outline-end-of-subtree): Include last newline into subtree. (hide-entry): Leave point at beginning of heading instead of end. (outline-up-heading): Push mark for the first call of successive command calls. diff -r 193a4c332536 -r 53c5c7a2f4a8 lisp/outline.el --- a/lisp/outline.el Thu Apr 29 15:31:38 2004 +0000 +++ b/lisp/outline.el Thu Apr 29 15:34:21 2004 +0000 @@ -349,7 +349,7 @@ (if (re-search-forward (concat "\n\\(?:" outline-regexp "\\)") nil 'move) (goto-char (match-beginning 0))) - (if (and (bolp) (not (bobp))) + (if (and (bolp) (eobp) (not (bobp))) (forward-char -1))) (defun outline-next-heading () @@ -706,8 +706,8 @@ "Hide the body directly following this heading." (interactive) (outline-back-to-heading) - (outline-end-of-heading) (save-excursion + (outline-end-of-heading) (outline-flag-region (point) (progn (outline-next-preface) (point)) t))) (defun show-entry () @@ -769,10 +769,7 @@ (defun outline-show-heading () "Show the current heading and move to its end." - (outline-flag-region (- (point) - (if (bobp) 0 - (if (eq (char-before (1- (point))) ?\n) - 2 1))) + (outline-flag-region (- (point) (if (bobp) 0 1)) (progn (outline-end-of-heading) (point)) nil)) @@ -840,10 +837,7 @@ (if (bolp) (progn ;; Go to end of line before heading - (forward-char -1) - (if (bolp) - ;; leave blank line before heading - (forward-char -1)))))) + (forward-char -1))))) (defun show-branches () "Show all subheadings of this heading, but not their bodies." @@ -884,6 +878,8 @@ With argument, move up ARG levels. If INVISIBLE-OK is non-nil, also consider invisible lines." (interactive "p") + (and (eq this-command 'outline-up-heading) + (or (eq last-command 'outline-up-heading) (push-mark))) (outline-back-to-heading invisible-ok) (let ((start-level (funcall outline-level))) (if (eq start-level 1)