changeset 65214:aefa34357e06

(hide-entry, hide-leaves, outline-toggle-children): Put outline-back-to-heading function call inside save-excursion.
author Juri Linkov <juri@jurta.org>
date Mon, 29 Aug 2005 20:49:01 +0000
parents 2670e0600335
children c37b7f6542ec
files lisp/outline.el
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/outline.el	Mon Aug 29 14:44:55 2005 +0000
+++ b/lisp/outline.el	Mon Aug 29 20:49:01 2005 +0000
@@ -749,8 +749,8 @@
 (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 @@
 (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 @@
 (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