diff options
author | Dan Davison <davison@stats.ox.ac.uk> | 2009-10-25 12:33:25 -0400 |
---|---|---|
committer | Dan Davison <davison@stats.ox.ac.uk> | 2009-10-27 14:18:00 -0400 |
commit | 8fa55ab87de3d40bd7a01382ef4b9e6117752f24 (patch) | |
tree | 9aa2e61969a9a62de1c705a5f33985d6a6115133 | |
parent | 2e20a2eea9fca56bbb9310c261a78f5cdb006b5d (diff) | |
download | org-mode-8fa55ab87de3d40bd7a01382ef4b9e6117752f24.tar.gz |
org-src-mode bug fix
In org-edit-src-save, point and mark were being restored inside the
save-window-excursion. As it happens, although mark is lost, point
nevertheless retained its position with switch-to-buffer being used to
switch between org and edit buffers, as is currently the
case. However, the failure to restore point correctly is exposed if
more complex options controlling window and frame management are
provided for the edit buffer.
-rw-r--r-- | lisp/org-src.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/org-src.el b/lisp/org-src.el index a7c5632..ae529d0 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -530,15 +530,15 @@ the language, a switch telling if the content should be in a single line." (defun org-edit-src-save () "Save parent buffer with current state source-code buffer." (interactive) - (save-window-excursion - (let ((p (point)) (m (mark)) msg) + (let ((p (point)) (m (mark)) msg) + (save-window-excursion (org-edit-src-exit) (save-buffer) (setq msg (current-message)) - (org-edit-src-code) - (push-mark m 'nomessage) - (goto-char (min p (point-max))) - (message (or msg ""))))) + (org-edit-src-code)) + (push-mark m 'nomessage) + (goto-char (min p (point-max))) + (message (or msg "")))) (defun org-src-mode-configure-edit-buffer () (when org-edit-src-from-org-mode |