diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2013-09-08 08:13:35 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2013-09-08 08:13:35 +0200 |
commit | b64626ecf49b3d1504c5107ace2b2931f5dadb37 (patch) | |
tree | c646a3a9542a6901afba0bd8c02d5ef655b608bd | |
parent | ff771c5c7eab5c4d4a60e9f1270319758961338d (diff) | |
download | org-mode-b64626ecf49b3d1504c5107ace2b2931f5dadb37.tar.gz |
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.
-rw-r--r-- | lisp/org.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el index 84c1935..c92fa66 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -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. |