emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: pillule <pillule@riseup.net>
To: pillule <pillule@riseup.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] org-src.el Do not ask to revert unmodified buffers
Date: Mon, 08 Mar 2021 23:06:58 +0000	[thread overview]
Message-ID: <878s6xxn1p.fsf@host.localdomain> (raw)
In-Reply-To: <87a6rdxn70.fsf@host.localdomain>

[-- Attachment #1: Type: text/plain, Size: 300 bytes --]

 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.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: don_t_ask_to_revert_unmodified_src_buffers --]
[-- Type: text/x-diff, Size: 590 bytes --]

@@ -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.

[-- Attachment #3: Type: text/plain, Size: 8 bytes --]


  reply	other threads:[~2021-03-08 23:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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:

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=878s6xxn1p.fsf@host.localdomain \
    --to=pillule@riseup.net \
    --cc=emacs-orgmode@gnu.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


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).