summaryrefslogtreecommitdiff
path: root/docutils/tools
diff options
context:
space:
mode:
authorsmerten <smerten@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2009-05-21 09:02:22 +0000
committersmerten <smerten@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2009-05-21 09:02:22 +0000
commitb492a78e65198e4ded6a8cf661fa1d4e915eced2 (patch)
tree97bd43d22c00fd23f95e4823f05095608bdcaab4 /docutils/tools
parent1d921cd101dbd5817d6d8ef66954329da8854078 (diff)
downloaddocutils-b492a78e65198e4ded6a8cf661fa1d4e915eced2.tar.gz
Reset window configuration after displaying TOC.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5954 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/tools')
-rw-r--r--docutils/tools/editors/emacs/rst.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/docutils/tools/editors/emacs/rst.el b/docutils/tools/editors/emacs/rst.el
index dedf23f60..40213d64a 100644
--- a/docutils/tools/editors/emacs/rst.el
+++ b/docutils/tools/editors/emacs/rst.el
@@ -1963,7 +1963,7 @@ document.
The Emacs buffer can be navigated, and selecting a section
brings the cursor in that section."
(interactive)
- (let* ((curbuf (current-buffer))
+ (let* ((curbuf (list (current-window-configuration) (point-marker)))
;; Get the section tree
(alldecos (rst-find-all-decorations))
@@ -2017,6 +2017,7 @@ brings the cursor in that section."
(interactive)
(let ((pos (rst-toc-mode-find-section)))
(when kill
+ (set-window-configuration (car rst-toc-return-buffer))
(kill-buffer (get-buffer rst-toc-buffer-name)))
(pop-to-buffer (marker-buffer pos))
(goto-char pos)
@@ -2049,12 +2050,13 @@ EVENT is the input event."
(defvar rst-toc-return-buffer nil
"Buffer local variable that is used to return to the original
- buffer from the TOC.")
+ window configuration from the TOC.")
(defun rst-toc-quit-window ()
(interactive)
- (quit-window)
- (pop-to-buffer rst-toc-return-buffer))
+ (let ((retbuf rst-toc-return-buffer))
+ (set-window-configuration (car retbuf))
+ (goto-char (cadr retbuf))))
(defvar rst-toc-mode-map
(let ((map (make-sparse-keymap)))