mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-23 00:18:38 +00:00
Preserve point when switching to overview
* lisp/org.el (org-overview): Preserve point. We want to preserve point when changing global visibility. This is a bit dangerouns, because it can leave point in an invisible location. However, we want to make sure that pressing M-TAG three times returns us to the same position as before.
This commit is contained in:
parent
ff771c5c7e
commit
b64626ecf4
|
@ -6897,7 +6897,7 @@ of the first headline in the buffer. This is important, because if the
|
|||
first headline is not level one, then (hide-sublevels 1) gives confusing
|
||||
results."
|
||||
(interactive)
|
||||
(let ((l (org-current-line))
|
||||
(let ((pos (point))
|
||||
(level (save-excursion
|
||||
(goto-char (point-min))
|
||||
(if (re-search-forward (concat "^" outline-regexp) nil t)
|
||||
|
@ -6906,7 +6906,7 @@ results."
|
|||
(funcall outline-level))))))
|
||||
(and level (hide-sublevels level))
|
||||
(recenter '(4))
|
||||
(org-goto-line l)))
|
||||
(goto-char pos)))
|
||||
|
||||
(defun org-content (&optional arg)
|
||||
"Show all headlines in the buffer, like a table of contents.
|
||||
|
|
Loading…
Reference in a new issue