From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [BUG] in Release 8.2 - editing code in indirect buffer Date: Tue, 24 Sep 2013 18:35:22 +0200 Message-ID: <578DF849-8046-47A6-879C-FC5874BE591B@gmail.com> References: <8F09B93E-FC4D-48B8-A9AB-3EDC0D81EEEF@gmail.com> <220E3767-24DA-494B-9512-9C4DA30CEA43@gmail.com> <86zjr2urcg.fsf@somewhere.org> Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: multipart/signed; boundary="Apple-Mail=_09DEBFC7-5622-416B-A612-096FD00AACD7"; protocol="application/pgp-signature"; micalg=pgp-sha1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOVaF-0008SB-Vm for emacs-orgmode@gnu.org; Tue, 24 Sep 2013 12:35:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOVaA-0002hI-VB for emacs-orgmode@gnu.org; Tue, 24 Sep 2013 12:35:31 -0400 Received: from mail-we0-x22b.google.com ([2a00:1450:400c:c03::22b]:34877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOVaA-0002hA-Ny for emacs-orgmode@gnu.org; Tue, 24 Sep 2013 12:35:26 -0400 Received: by mail-we0-f171.google.com with SMTP id t61so4791328wes.16 for ; Tue, 24 Sep 2013 09:35:25 -0700 (PDT) In-Reply-To: <86zjr2urcg.fsf@somewhere.org> 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: Sebastien Vauban Cc: emacs-orgmode@gnu.org --Apple-Mail=_09DEBFC7-5622-416B-A612-096FD00AACD7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 24.9.2013, at 18:17, Sebastien Vauban = wrote: > Hello Carsten, >=20 > Carsten Dominik wrote: >> On 23.9.2013, at 09:40, Rainer M Krug wrote: >>>=20 >>> When starting to edit a code block via C-c ' everything works as = expected >>> and the code block is highlighted and an indirect buffer is opened. >>>=20 >>> When I click into the highlighted block, I an "send" to the indirect = buffer. >>> This behavior changes, after saving with C-s, even when nothing has = been >>> edited: the area in the original org file looses its magic, and = looks normal >>> again and can also be edited! >>>=20 >>> The indirect buffer stays functional and, upon close via C-c ' saves = the >>> changes into the original buffer and *overwrites* changes done in = this block >>> in the org document. >>=20 >> This is a bug which is difficult to fix in all generality. What = should really >> happen is that the text in the original buffer is made read-only. But = so far >> this does not happen in our implementation (due to Dan Davison IIRC). = The >> reason for this is that read-only text properties left by accident in = a >> buffer are difficult to get rid of. >>=20 >> There are many things the user could go back and screw up the = original. >> That's why Org choses to protect with highlighting with an overlay. = Note that >> this is not a protection against editing, but it is a visual warning. >=20 > I never knew that "your" goal was to make the code block read-only in = the Org > buffer. Note that I would be really opposed to such a change. Editing = code in > the prose would really become a pain to me -- please know that I NEVER = use the > indirect buffer. Hi Sebastian, I only mean while there is a special buffer also editing this block! - Carsten >=20 > I hope that we will block such a functionality, would the read-only = feature > become possible. >=20 >> However, what happens during saving is indeed a problem - the overlay = gets >> lost (not really, it gets squeezed to zero by first removing the = source code >> and then inserting the modified version). >>=20 >> Could you please try this patch and test it to see if it is stable = and does >> the right thing? >=20 > Best regards, > Seb >=20 > --=20 > Sebastien Vauban >=20 >=20 --Apple-Mail=_09DEBFC7-5622-416B-A612-096FD00AACD7 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJSQb9KAAoJEO+gg/nAZuwMibYH/23mVgRYIFM8vzJ0Fmy1x9Bz qnprLYb6i6LW1xVg71T2SVafhDKgp905jnXYEovJ5orrWMsD7mLyO+ozpPncxzOG eiASeEXXxDNOs09jRS1IDyyJ0YJJ9DtqRG2pk169EatSdEkuOfDCnSAO1Lc5H8td AVpewVPHd5NgepgVjPDnTp5QWsJqJ2BhnGghMUYivLxzNLVUV660dJUs+8VxMZLa FkiE0S3P5FsG/surWdHCIQSaBOBvOmftVhhBeDWDluYq7d9j4mAP+s6wtXVpLUC1 oe5DEqRXafpHygLI3FkBsSrgIUckuR3X7ys+WeVfeclSqEhSnRHJSzBrh1M/Om4= =j6Jp -----END PGP SIGNATURE----- --Apple-Mail=_09DEBFC7-5622-416B-A612-096FD00AACD7--