From c95502be042ba2cc06695fe07f8be56d0495f1d4 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 29 Aug 2005 20:49:01 +0000 Subject: [PATCH] (hide-entry, hide-leaves, outline-toggle-children): Put outline-back-to-heading function call inside save-excursion. --- lisp/outline.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lisp/outline.el b/lisp/outline.el index 714e7ec02ea..bfba50e061b 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -749,8 +749,8 @@ If FLAG is nil then text is shown, while if FLAG is t the text is hidden." (defun hide-entry () "Hide the body directly following this heading." (interactive) - (outline-back-to-heading) (save-excursion + (outline-back-to-heading) (outline-end-of-heading) (outline-flag-region (point) (progn (outline-next-preface) (point)) t))) @@ -802,8 +802,8 @@ Show the heading too, if it is currently invisible." (defun hide-leaves () "Hide all body after this heading at deeper levels." (interactive) - (outline-back-to-heading) (save-excursion + (outline-back-to-heading) (outline-end-of-heading) (hide-region-body (point) (progn (outline-end-of-subtree) (point))))) @@ -860,11 +860,12 @@ Show the heading too, if it is currently invisible." (defun outline-toggle-children () "Show or hide the current subtree depending on its current state." (interactive) - (outline-back-to-heading) - (if (not (outline-invisible-p (line-end-position))) - (hide-subtree) - (show-children) - (show-entry))) + (save-excursion + (outline-back-to-heading) + (if (not (outline-invisible-p (line-end-position))) + (hide-subtree) + (show-children) + (show-entry)))) (defun outline-flag-subtree (flag) (save-excursion -- 2.39.2