emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-src.el Do not ask to revert unmodified buffers
@ 2021-03-08 22:57 pillule
  2021-03-08 23:03 ` pillule
  2021-03-21 20:33 ` Kyle Meyer
  0 siblings, 2 replies; 7+ messages in thread
From: pillule @ 2021-03-08 22:57 UTC (permalink / raw)
  To: emacs-orgmode


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.

-- 




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-05-01 10:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-08 22:57 [PATCH] org-src.el Do not ask to revert unmodified buffers pillule
2021-03-08 23:03 ` pillule
2021-03-08 23:06   ` pillule
2021-03-21 20:33 ` Kyle Meyer
2021-03-26  3:10   ` pillule
2021-05-01 10:55     ` Timothy
2021-05-01 10:58       ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).