aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2005-08-29 20:49:01 +0000
committerJuri Linkov2005-08-29 20:49:01 +0000
commitc95502be042ba2cc06695fe07f8be56d0495f1d4 (patch)
tree2426de485057fc208d7bc54234e3451afb69909f
parent3675c8b121c74823acf5e4dea8712a45e3c15b52 (diff)
downloademacs-c95502be042ba2cc06695fe07f8be56d0495f1d4.tar.gz
emacs-c95502be042ba2cc06695fe07f8be56d0495f1d4.zip
(hide-entry, hide-leaves, outline-toggle-children):
Put outline-back-to-heading function call inside save-excursion.
-rw-r--r--lisp/outline.el15
1 files 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."
749(defun hide-entry () 749(defun hide-entry ()
750 "Hide the body directly following this heading." 750 "Hide the body directly following this heading."
751 (interactive) 751 (interactive)
752 (outline-back-to-heading)
753 (save-excursion 752 (save-excursion
753 (outline-back-to-heading)
754 (outline-end-of-heading) 754 (outline-end-of-heading)
755 (outline-flag-region (point) (progn (outline-next-preface) (point)) t))) 755 (outline-flag-region (point) (progn (outline-next-preface) (point)) t)))
756 756
@@ -802,8 +802,8 @@ Show the heading too, if it is currently invisible."
802(defun hide-leaves () 802(defun hide-leaves ()
803 "Hide all body after this heading at deeper levels." 803 "Hide all body after this heading at deeper levels."
804 (interactive) 804 (interactive)
805 (outline-back-to-heading)
806 (save-excursion 805 (save-excursion
806 (outline-back-to-heading)
807 (outline-end-of-heading) 807 (outline-end-of-heading)
808 (hide-region-body (point) (progn (outline-end-of-subtree) (point))))) 808 (hide-region-body (point) (progn (outline-end-of-subtree) (point)))))
809 809
@@ -860,11 +860,12 @@ Show the heading too, if it is currently invisible."
860(defun outline-toggle-children () 860(defun outline-toggle-children ()
861 "Show or hide the current subtree depending on its current state." 861 "Show or hide the current subtree depending on its current state."
862 (interactive) 862 (interactive)
863 (outline-back-to-heading) 863 (save-excursion
864 (if (not (outline-invisible-p (line-end-position))) 864 (outline-back-to-heading)
865 (hide-subtree) 865 (if (not (outline-invisible-p (line-end-position)))
866 (show-children) 866 (hide-subtree)
867 (show-entry))) 867 (show-children)
868 (show-entry))))
868 869
869(defun outline-flag-subtree (flag) 870(defun outline-flag-subtree (flag)
870 (save-excursion 871 (save-excursion