comparison lisp/outline.el @ 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 1dc0c9b5d66a
children ecfa88bd9638
comparison
equal deleted inserted replaced
65213:2670e0600335 65214:aefa34357e06
747 (show-entry)) 747 (show-entry))
748 748
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
757 (defun show-entry () 757 (defun show-entry ()
758 "Show the body directly following this heading. 758 "Show the body directly following this heading.
800 (outline-flag-subtree t)) 800 (outline-flag-subtree t))
801 801
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
810 (defun show-subtree () 810 (defun show-subtree ()
811 "Show everything after this heading at deeper levels." 811 "Show everything after this heading at deeper levels."
858 (run-hooks 'outline-view-change-hook)) 858 (run-hooks 'outline-view-change-hook))
859 859
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
871 (outline-back-to-heading) 872 (outline-back-to-heading)
872 (outline-end-of-heading) 873 (outline-end-of-heading)