Преглед изворни кода

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.
Dan Davison пре 15 година
родитељ
комит
8fa55ab87d
1 измењених фајлова са 6 додато и 6 уклоњено
  1. 6 6
      lisp/org-src.el

+ 6 - 6
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