Org-mode mailing list
 help / color / mirror / Atom feed
From: pillule <pillule@riseup.net>
To: emacs-orgmode@gnu.org
Subject: [PATCH] org-src.el Do not ask to revert unmodified buffers
Date: Mon, 08 Mar 2021 22:57:23 +0000
Message-ID: <87blbtxnho.fsf@host.localdomain> (raw)


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	other threads:[~2021-03-08 22:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08 22:57 pillule [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://orgmode.org

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87blbtxnho.fsf@host.localdomain \
    --to=pillule@riseup.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git