emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] org-src.el Do not ask to revert unmodified buffers


From: pillule
Subject: Re: [PATCH] org-src.el Do not ask to revert unmodified buffers
Date: Mon, 08 Mar 2021 23:03:47 +0000


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

[Prev in Thread] Current Thread [Next in Thread]