瀏覽代碼

org-src: fix two bugs

* lisp/org-src.el (org-src--edit-buffer): Construe equality for
markers properly.
(org-edit-src-save): Place point properly when writing back changes.

Thanks to Vikas Rawal for reporting:
<http://mid.gmane.org/C8148BF2-87AF-44A4-B103-6BD338DA8D96@agrarianresearch.org>
Aaron Ecay 10 年之前
父節點
當前提交
398286a00c
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      lisp/org-src.el

+ 5 - 2
lisp/org-src.el

@@ -216,8 +216,10 @@ Return nil if there is no such buffer."
     (dolist (b (buffer-list))
       (with-current-buffer b
 	(and (org-src-edit-buffer-p)
-	     (eq beg org-src--beg-marker)
-	     (eq end org-src--end-marker)
+	     (= beg org-src--beg-marker)
+	     (eq (marker-buffer beg) (marker-buffer org-src--beg-marker))
+	     (= end org-src--end-marker)
+	     (eq (marker-buffer end) (marker-buffer org-src--end-marker))
 	     (throw 'exit b))))))
 
 (defun org-src--source-buffer ()
@@ -779,6 +781,7 @@ Throw an error if there is no such buffer."
 	(overlay org-src--overlay))
     (with-current-buffer (org-src--source-buffer)
       (undo-boundary)
+      (goto-char beg)
       (delete-region beg end)
       (when (org-string-nw-p edited-code) (insert edited-code))
       (unless (bolp) (insert "\n"))