From 398286a00c41af44667da8a10e514973e1e08780 Mon Sep 17 00:00:00 2001 From: Aaron Ecay Date: Thu, 11 Dec 2014 23:34:35 -0500 Subject: [PATCH] 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: --- lisp/org-src.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/org-src.el b/lisp/org-src.el index af5336db1..67e9de472 100644 --- a/lisp/org-src.el +++ b/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")) -- 2.11.4.GIT