From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniele Pizzolli Subject: Re: Tentative patch to keep org-babel-results-keyword when calling org-babel-remove-result Date: Fri, 20 Sep 2013 23:56:13 +0200 Message-ID: <523CC47D.8060807@toel.it> References: <523CAFF5.8090604@toel.it> <87wqmb5h8w.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN8gp-0003mb-7x for emacs-orgmode@gnu.org; Fri, 20 Sep 2013 17:56:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VN8ge-0001WA-MK for emacs-orgmode@gnu.org; Fri, 20 Sep 2013 17:56:39 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:57570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN8ge-0001W6-G5 for emacs-orgmode@gnu.org; Fri, 20 Sep 2013 17:56:28 -0400 Received: from mfilter11-d.gandi.net (mfilter11-d.gandi.net [217.70.178.131]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id AEA88A80BE for ; Fri, 20 Sep 2013 23:56:16 +0200 (CEST) Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter11-d.gandi.net (mfilter11-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 4eJ+nN418Sqv for ; Fri, 20 Sep 2013 23:56:15 +0200 (CEST) Received: from [10.0.0.235] (host159-38-static.38-79-b.business.telecomitalia.it [79.38.38.159]) (Authenticated sender: me@toel.it) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id DA112A80C7 for ; Fri, 20 Sep 2013 23:56:14 +0200 (CEST) In-Reply-To: <87wqmb5h8w.fsf@gmail.com> 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: emacs-orgmode@gnu.org On 09/20/2013 11:13 PM, Eric Schulte wrote: > Hi Daniele, > > Thanks for the suggestion and the accompanying patch. I've just applie= d > a modified version of your patch (included below). Please let me know > if this is insufficient for your needs. Hello Eric, Wonderful! Your patch is perfect for my use case. Thanks for the quick improvement! I just re-discovered the amazing feature of "named source blocks". that unfortunately trigger a corner case: #+NAME: fig1 #+BEGIN_SRC... #+END_SRC Some text #+RESULTS: fig1 ** Other section After running: (org-babel-map-src-blocks nil (org-babel-remove-result nil t)) Will result in: #+NAME: fig1 #+BEGIN_SRC... #+END_SRC Some text #+RESULTS: f ** Other section I tried to look at the code, but the level of indirection you added makes me feel lost. I would be happy to help in testing, even with more use cases if needed. I just found that the section =E2=80=9CWriting tests with minimal Emacs-lisp knowledge=E2=80=9D at http://orgmode.org/worg/org-tests/index.html#sec-3 is not yet complete but I can have a look at the source code and follow your advises or examples. Thanks again, Daniele Pizzolli