hm I hope this is better.²

Hi, it is asked to the user if we want to revert changes when re-entering in a
org-source buffer.
Even if the buffer have no modifications.

This patch ask to revert the buffer only if there are modifications to the
source buffer.

@@ -493,8 +493,9 @@
 	 (old-edit-buffer (org-src--edit-buffer beg end))
 	 (contents (or contents (nth 2 area))))
     (if (and old-edit-buffer
-	     (or (not org-src-ask-before-returning-to-edit-buffer)
-		 (y-or-n-p "Return to existing edit buffer ([n] will revert changes)? ")))
+	  (or (not org-src-ask-before-returning-to-edit-buffer)
+	     (or (not (buffer-modified-p old-edit-buffer))
+		(y-or-n-p "Return to existing edit buffer ([n] will revert changes)? "))))
 	;; Move to existing buffer.
 	(org-src-switch-to-buffer old-edit-buffer 'return)
       ;; Discard old edit buffer.


--


Reply via email to