From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Tentative patch to keep org-babel-results-keyword when calling org-babel-remove-result Date: Fri, 20 Sep 2013 16:30:45 -0600 Message-ID: <87fvsz5dnu.fsf@gmail.com> References: <523CAFF5.8090604@toel.it> <87wqmb5h8w.fsf@gmail.com> <523CC47D.8060807@toel.it> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN9Dg-0000K2-Ow for emacs-orgmode@gnu.org; Fri, 20 Sep 2013 18:30:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VN9Dc-00023M-ES for emacs-orgmode@gnu.org; Fri, 20 Sep 2013 18:30:36 -0400 Received: from mail-pd0-x229.google.com ([2607:f8b0:400e:c02::229]:61542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN9Dc-000237-6e for emacs-orgmode@gnu.org; Fri, 20 Sep 2013 18:30:32 -0400 Received: by mail-pd0-f169.google.com with SMTP id r10so920493pdi.28 for ; Fri, 20 Sep 2013 15:30:31 -0700 (PDT) In-Reply-To: <523CC47D.8060807@toel.it> (Daniele Pizzolli's message of "Fri, 20 Sep 2013 23:56:13 +0200") 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: Daniele Pizzolli Cc: emacs-orgmode@gnu.org Hi Daniele, Thanks for catching this very large edge case which I completely ignored. I've just pushed up a fix. Best, Daniele Pizzolli writes: > On 09/20/2013 11:13 PM, Eric Schulte wrote: >> Hi Daniele, >> >> Thanks for the suggestion and the accompanying patch. I've just applied >> 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 > --=20 Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D