Преглед на файлове

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 преди 16 години
родител
ревизия
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