From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Carlos_Garc=C3=ADa?= Subject: Re: [BUG] src_blocks - :wrap blocks not being overwritten Date: Tue, 30 Oct 2018 11:35:00 +0100 Message-ID: References: <95FCF642-1CFF-4DF5-89FC-8A5876889D33@ucsd.edu> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000090dca105796fbdc4" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHRMx-0007nk-1u for emacs-orgmode@gnu.org; Tue, 30 Oct 2018 06:35:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHRMm-0005bN-FZ for emacs-orgmode@gnu.org; Tue, 30 Oct 2018 06:35:23 -0400 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]:40977) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHRMk-0005LJ-At for emacs-orgmode@gnu.org; Tue, 30 Oct 2018 06:35:18 -0400 Received: by mail-oi1-x22a.google.com with SMTP id i10-v6so9911180oik.8 for ; Tue, 30 Oct 2018 03:35:13 -0700 (PDT) In-Reply-To: <95FCF642-1CFF-4DF5-89FC-8A5876889D33@ucsd.edu> 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" To: ccberry@ucsd.edu Cc: emacs-orgmode@gnu.org --00000000000090dca105796fbdc4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Chuck, Thanks for looking into this. How difficult/desirable would it be to create another block such as "wrap-block" for those blocks created with ":wrap"? That way, the needed change would be rather elegant: :line 2478 of ob-core.el: | ;; Possible results types. | '(drawer example-block export-block fixed-width item | plain-list src-block table *wrap-block*) What would the repercussions be if `special-block' is added to the list? Regards, Carlos On Mon, Oct 29, 2018 at 5:01 PM Berry, Charles wrote: > > > > On Oct 24, 2018, at 2:29 PM, Carlos Garc=C3=ADa wr= ote: > > > > Hi List, > > > > The functionality of replacing blocks using ":wrap" seems to be broken. > > In this email [1] from 2014, a user reported that this was working: > > > > ,---- > > | * A > > | > > | #+header: :results raw replace :wrap > > | #+begin_src emacs-lisp > > | (+ 2 2) > > | #+end_src > > | > > | #+results: > > | #+BEGIN_RESULTS > > | 4 > > | #+END_RESULTS > > `---- > > > > i'm running orgmode 9.1.14 and the "BEGIN_RESULTS" blocks are not > getting overwritten. Can anybody else reproduce this problem? > > > > > Confirmed. > > The issue is that the #+BEGIN/END_results is a `special-block', which is > not recognized in `org-babel-result-end' as a result type. > > I think the fix is to add it. > > If the intention is to NOT recognize special-blocks as results, then the > empty :wrap needs to have some other effect, like enclosing the result in= a > drawer. > > HTH, > > Chuck > > --00000000000090dca105796fbdc4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Chuck,

T= hanks for looking=C2=A0into this. How difficult/desirable would it be to cr= eate another block such as "wrap-block"=C2=A0for those blocks cre= ated with ":wrap"?
That way, the needed change would be rather elegant:

:line 2478 of ob-core.el:
| ;; Possible results = types.
| = =C2=A0 =C2=A0 =C2=A0'(drawer example-block export-block fixed-w= idth item
| =C2=A0 =C2=A0 =C2=A0 plain-list src-block table wrap-block)

What would the repercussions be if `special-block' is added to the li= st?


Regards,
Carlos

On Mon, Oct 29, 2018 at 5:01 P= M Berry, Charles <ccberry@ucsd.edu> wrote:


> On Oct 24, 2018, at 2:29 PM, Carlos Garc=C3=ADa <
carloscg@gmail.com> wrote:
>
> Hi List,
>
> The functionality of replacing blocks using ":wrap" seems to= be broken.
> In this email [1] from 2014, a user reported that this was working: >
> ,----
> | * A
> |
> | #+header: :results raw replace :wrap
> | #+begin_src emacs-lisp
> |=C2=A0 =C2=A0(+ 2 2)
> | #+end_src
> |
> | #+results:
> | #+BEGIN_RESULTS
> | 4
> | #+END_RESULTS
> `----
>
> i'm running orgmode 9.1.14 and the "BEGIN_RESULTS" block= s are not getting overwritten. Can anybody else reproduce this problem?
>


Confirmed.=C2=A0

The issue is that the #+BEGIN/END_results is a `special-block', which i= s not recognized in `org-babel-result-end' as a result type.

I think the fix is to add it.

If the intention is to NOT recognize special-blocks as results, then the em= pty :wrap needs to have some other effect, like enclosing the result in a d= rawer.

HTH,

Chuck

--00000000000090dca105796fbdc4--