From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
Received: from mp1 ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms0.migadu.com with LMTPS
	id iA3EHofS0WA8dQAAgWs5BA
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Tue, 22 Jun 2021 14:07:35 +0200
Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp1 with LMTPS
	id ON5vGofS0WCKOAAAbx9fmQ
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Tue, 22 Jun 2021 12:07:35 +0000
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id 8728A1CFF4
	for <larch@yhetil.org>; Tue, 22 Jun 2021 14:07:34 +0200 (CEST)
Received: from localhost ([::1]:35190 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	id 1lvfBl-0002Dx-Bk
	for larch@yhetil.org; Tue, 22 Jun 2021 08:07:33 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:49992)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mgiepen@posteo.net>)
 id 1lvdoX-0005pe-DY
 for emacs-orgmode@gnu.org; Tue, 22 Jun 2021 06:39:29 -0400
Received: from mout01.posteo.de ([185.67.36.65]:48493)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mgiepen@posteo.net>)
 id 1lvdoU-0002EU-Fk
 for emacs-orgmode@gnu.org; Tue, 22 Jun 2021 06:39:29 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout01.posteo.de (Postfix) with ESMTPS id D8C5C240028
 for <emacs-orgmode@gnu.org>; Tue, 22 Jun 2021 12:39:22 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1624358362; bh=QfnZ4nWgtOjCas2jDbNkeSvVERmRForCWKwtrzZkoVw=;
 h=To:From:Subject:Date:From;
 b=jbK++tl6uuo30G130HjK2LTKXfYG91u90XSUHycZG1cCapE4BV+M08RC+Jbw24UYs
 HWO3WfSQS4SRTelS549QvDbw5X+5CTuOBpQfi88gU8FaEChxTDsCX3QbjJR+tprmMB
 1juBUJ+A3sSlh57VPTFSJpHj9vMEYDo4gOVUMBqlCW8SWuHVHX9cUZmXslKMmTJFev
 8imhNNkeICzmsRrZco+60P+VHCv4sfmze3n7HRVoPgAMTthlcLWrHyLW7XmPD+x0Hr
 QPkC5LzvG0DlaG2YtH/XYjbr11qnvFLRPPp79A1pk2ufgqYhf7vbiFS6TtDSGaAhpg
 B/60RyhsxeovA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4G8NDp2gjPz9rxB
 for <emacs-orgmode@gnu.org>; Tue, 22 Jun 2021 12:39:22 +0200 (CEST)
To: emacs-orgmode@gnu.org
From: mcg <mgiepen@posteo.net>
Subject: org-edit-src-exit randomizes / mixes up code in source-buffer on exit
Message-ID: <1d8c2e28-a7c1-7d37-152c-2aac07b54978@posteo.net>
Date: Tue, 22 Jun 2021 10:39:21 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=185.67.36.65; envelope-from=mgiepen@posteo.net;
 helo=mout01.posteo.de
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Mailman-Approved-At: Tue, 22 Jun 2021 08:05:55 -0400
X-BeenThere: emacs-orgmode@gnu.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
Sender: "Emacs-orgmode" <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
X-Migadu-Flow: FLOW_IN
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1624363655;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:mime-version:mime-version:
	 content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:list-id:list-help:
	 list-unsubscribe:list-subscribe:list-post:dkim-signature;
	bh=yIk1MByt0E6xlggXKHGHgprk8Eaf3YQvSGKuNQXQxjY=;
	b=WVVDVm2QWSzqGhYAxk6pqsUxbaRf3eGXFdcEP5ZV19HymEnMVnseN8vaSq2A6Nca8/TtZ1
	K0KYEWpySxPda4F7gxOwT+AgkaOyVrBRy1pA8p7EAmLQ8PgeXSqwf47cWwM59wIk8Fv5wi
	6H4Bw1fXufiKikwTZRL95vyeXunGL5B45RfbiPjAbqTYLeF8J+HG/iT+Mkp+ANduw8Dk1o
	St+ORKx7PTnKeou/YQFPDBWE3Sg7/bhVU08XFY3udQehQfx3Q2bPHXrC3YNiIFYN0ViN8S
	xEi4IDX3pXu1GN0PPg1Pe6T+Sb0lx55QM1O8IGEUrBM+oVflt6Ch+du5sT8bcA==
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624363655; a=rsa-sha256; cv=none;
	b=a/SYTVcy+c0I7gw2dvYIKNHqrdHcCOKyMp+hFkHSGVVA6BC5nBCpABG7E/LDFSCRo+12cL
	5mi3colMmA2onqTi4jKD60CqOv89r+JyyfvRyishTLiNYRAVc8I4P3Uzy50Ehb9enp+xfV
	7s8n90+ufYFKNZhyPBLOTN5NJQPmvzR5YplRgdXb6+nwqWGAfr3WBiKyrvbY6rw1k+UxnL
	JbjA4QCzZQFXWq+C6NHRZe+2uv5oE6xfxcPDRSe/5RsP9TK7pTlhRNpzObZsDGNQ5y3yUM
	7BntMnSlBrchO0qaD0yCKwZanhd2/cvito60WEL2Sdsf/8fuCe7bGELjhL8X0Q==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=pass header.d=posteo.net header.s=2017 header.b=jbK++tl6;
	dmarc=pass (policy=none) header.from=posteo.net;
	spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org
X-Migadu-Spam-Score: -3.12
Authentication-Results: aspmx1.migadu.com;
	dkim=pass header.d=posteo.net header.s=2017 header.b=jbK++tl6;
	dmarc=pass (policy=none) header.from=posteo.net;
	spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org
X-Migadu-Queue-Id: 8728A1CFF4
X-Spam-Score: -3.12
X-Migadu-Scanner: scn1.migadu.com
X-TUID: d0tWoOk7d+a6

Hello,

org-edit-src-exit suddenly completely destroys my code after coming back 
from vacation. No known recent changes in configuration. Very strange 
error!

EXAMPLE: here a simple code before editing

#+BEGIN_SRC R

mtcars

sum(mtcars$mpg, na.rm = TRUE)

mean(mtcars$disp)

#+END_SRC

I enter to edit (org-edit-special), change the order of two lines and 
add a number:

Result I should get in source buffer after exiting:

#+BEGIN_SRC R

mtcars

mean(mtcars$disp)

123456789

sum(mtcars$mpg, na.rm = TRUE)

#+END_SRC

What I get in source buffer on org-edit-src-exit: (no joke!)

#+BEGIN_SRC R
rmtcars
s
ean(m
sums$di(p)mt123456789

cars$mpg, na.rm = TRUE)

mean

#+END_SRC


Came back from vacation and suddenly this happens. Only updates to 
server, elpa / melpa has not been updated the last three weeks. Emacs 
reinstallation did not help, launching without

Emacs 26.1 build 2 (2021-01-31) modified by debian

org version 9.4.6