From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vikas Rawal Subject: Possible bug with Org Babel source code blocks and ESS integration Date: Fri, 12 Dec 2014 07:42:26 +0530 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzFij-0006o3-J8 for emacs-orgmode@gnu.org; Thu, 11 Dec 2014 21:12:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XzFic-0002Tu-2v for emacs-orgmode@gnu.org; Thu, 11 Dec 2014 21:12:41 -0500 Received: from mail-pd0-f176.google.com ([209.85.192.176]:65387) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzFib-0002Ti-TJ for emacs-orgmode@gnu.org; Thu, 11 Dec 2014 21:12:34 -0500 Received: by mail-pd0-f176.google.com with SMTP id r10so4181127pdi.7 for ; Thu, 11 Dec 2014 18:12:32 -0800 (PST) Received: from [192.168.1.33] ([59.176.42.82]) by mx.google.com with ESMTPSA id rb2sm2546784pab.5.2014.12.11.18.12.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Dec 2014 18:12:32 -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: org-mode mailing list I am having a strange problem with R Source Blocks. Let me explain (I = hope the explanation below makes sense). When I am creating a source block, I typically create the #+BEGIN_SRC = and #+END_SRC lines, and then use C-c ' to enter ESS mode, fill the = block there, and return to my org buffer using C-c ' again.=20 While I am filling in my source block, I sometimes need to refer to my = full org file and some other source blocks in there. So my cursor in the = Org file moves. Then, if my code block is a little complex, I like to = save it while I am editing (C-x C-s). This is where the mess is created. = Instead of saving the code in the source block from where ESS was = called, the code is saved at the point where my cursor in the org file = at the moment is. As a result, I get a copy of the source code text = (without the BEGIN_SRC and END_SRC lines) at the place where my cursor = is. This obviously creates a total mess and I have to clean it up. Is this the intended behaviour? I have used source code blocks for years = and have not had this problem before. But I cannot say whether this is a = new behaviour in org or something in my behaviour has changed. In the = past, I perhaps never moved the cursor in my org buffer while editing a = source code block.=20 Of course, one advice could be not to switch back from the ESS buffer = without closing it. But a better thing would be if saving in the ESS = buffer saved the source code block in the right place. But I don=92t = know if that is too much to ask. Vikas