From mboxrd@z Thu Jan 1 00:00:00 1970 From: Le Wang Subject: [PATCH] exiting source block edit without change should not change buffer-modified sttatus Date: Sat, 12 Jan 2013 23:05:47 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=f46d043c7d6035012704d318bffb Return-path: Received: from eggs.gnu.org ([208.118.235.92]:51053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tu2ec-0007gi-QD for emacs-orgmode@gnu.org; Sat, 12 Jan 2013 10:05:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tu2ea-0002e9-IY for emacs-orgmode@gnu.org; Sat, 12 Jan 2013 10:05:50 -0500 Received: from mail-vc0-f171.google.com ([209.85.220.171]:45318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tu2ea-0002e3-Bq for emacs-orgmode@gnu.org; Sat, 12 Jan 2013 10:05:48 -0500 Received: by mail-vc0-f171.google.com with SMTP id n11so2371532vch.30 for ; Sat, 12 Jan 2013 07:05:47 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Orgmode Mailing List --f46d043c7d6035012704d318bffb Content-Type: text/plain; charset=ISO-8859-1 Currently when I press "C-c '", and immediately exit with "C-c '", the org buffer's modified flag is set, even though I didn't change anything. Code changes with testcases included. I'm not sure if this can be made generic for other types of special edit. -- Le --f46d043c7d6035012704d318bffb Content-Type: application/octet-stream; name="0001-add-tests-for-round-trip-source-block-without-change.patch" Content-Disposition: attachment; filename="0001-add-tests-for-round-trip-source-block-without-change.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hbuvx0pj0 RnJvbSBlZDlkODhmYzlhNjI4YTk5YWUxYzEzNGRiYzE4YzE0YmI0ZjY4NmZkI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KQor ICAgKHNldC1idWZmZXItbW9kaWZpZWQtcCBuaWwpCisgICAob3JnLWVkaXQtc3BlY2lhbCkKKyAg IChvcmctZWRpdC1zcmMtZXhpdCkKKyAgIChzaG91bGQgKGVxdWFsIChidWZmZXItbW9kaWZpZWQt cCkgbmlsKSkpKQorCisoZXJ0LWRlZnRlc3QgdGVzdC1vcmctc3JjL25vLWNoYW5nZS1lbXB0eS1i bG9jayAoKQorICAiTm90IGNoYW5naW5nIGNvbnRlbnRzIHNob3VsZCBjaGFuZ2UgYnVmZmVyLW1v ZGlmaWVkIHN0YXR1cword2hlbiBuZXdsaW5lIGhhcyB0byBiZSBhZGRlZC4iCisKKyAgKG9yZy10 ZXN0LXdpdGgtdGVtcC10ZXh0CisgICAiCisjK2JlZ2luX3NyYyBlbWFjcy1saXNwCisjK2VuZF9z cmMKKyIKKyAgIChnb3RvLWxpbmUgMikKKyAgIChzZXQtYnVmZmVyLW1vZGlmaWVkLXAgbmlsKQor ICAgKG9yZy1lZGl0LXNwZWNpYWwpCisgICAob3JnLWVkaXQtc3JjLWV4aXQpCisgICAoc2hvdWxk IChlcXVhbCAoYnVmZmVyLW1vZGlmaWVkLXApIHQpKSkpCisKIChwcm92aWRlICd0ZXN0LW9yZy1z cmMpCiA7OzsgdGVzdC1vcmctc3JjLmVsIGVuZHMgaGVyZQotLSAKMS43LjExLjQKCg== --f46d043c7d6035012704d318bffb Content-Type: application/octet-stream; name="0002-Fix-unmodified-source-blocking-editing-setting-buffe.patch" Content-Disposition: attachment; filename="0002-Fix-unmodified-source-blocking-editing-setting-buffe.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hbuvx0pp1 RnJvbSBjMDU5NzE5NzcyZjgzZmQ1YjUxMzE5MzY3ZTFhNWNjYTNiY2Y3NzUxIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMZSBXYW5nIDxsZS53YW5nQGFnd29ybGQuY29tLmF1PgpEYXRl OiBTYXQsIDEyIEphbi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