From mboxrd@z Thu Jan 1 00:00:00 1970 From: aditya siram Subject: Re: [Babel] Getting Info On Empty Source Block Fails Date: Tue, 17 Sep 2013 17:39:03 -0500 Message-ID: References: <87d2octzwy.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf301cc2da49e1a804e69bffbf Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VM40r-0005v6-19 for emacs-orgmode@gnu.org; Tue, 17 Sep 2013 18:44:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VM40o-0004fm-Up for emacs-orgmode@gnu.org; Tue, 17 Sep 2013 18:44:52 -0400 Received: from mail-ie0-x22d.google.com ([2607:f8b0:4001:c03::22d]:40335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VM40o-0004fe-Mc for emacs-orgmode@gnu.org; Tue, 17 Sep 2013 18:44:50 -0400 Received: by mail-ie0-f173.google.com with SMTP id ar20so11157623iec.4 for ; Tue, 17 Sep 2013 15:44:50 -0700 (PDT) In-Reply-To: <87d2octzwy.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: Eric Schulte Cc: emacs-orgmode@gnu.org --20cf301cc2da49e1a804e69bffbf Content-Type: text/plain; charset=ISO-8859-1 I believe this may have been an instance of the regex being too greedy which is fixed by the patch I submitted. -deech On Fri, Sep 13, 2013 at 12:05 PM, Eric Schulte wrote: > aditya siram writes: > > > Hi all, > > `org-babel-get-src-block-info` on an empty block fails. > > > > Given: > > #+BEGIN_SRC c > > #+END_SRC > > #+BEGIN_SRC c > > non-empty > > #+END_SRC > > > > Running `org-babel-get-src-block-info` with point at the beginning of the > > first line gives: > > ("c" "#+END_SRC > > > > #+BEGIN_SRC c > > non-empty" ((:colname-names) (:rowname-names) (:result-params "replace") > > (:result-type . value) (:comments . "") (:shebang . "") (:cache . "no") > > (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "code") > > (:results . "replace") ...) "" nil 0 8) > > > > The problem is somewhere in `org-babel-src-block-regex` but I didn't want > > to mess with it because it touches all parts of org-babel and I'm not > sure > > what else would break. > > > > Any advice on how to fix this is appreciated. > > -deech > > This works for me. With the point on the first "#" in > > > #+BEGIN_SRC c > > #+END_SRC > > > I get > > ,----[C-c C-v I] > | Lang: c > | Header Arguments: > | :cache no > | :exports code > | :hlines no > | :noweb yes > | :padnewline yes > | :results replace > | :session none > | :tangle no > | > | [back] > `---- > > and > > ,----[M-: (org-babel-get-src-block-info)] > | ("c" "" ((:colname-names) (:rowname-names) (:result-params "replace") > | (:result-type . value) (:comments . "") (:shebang . "") > | (:cache . "no") (:padline . "") (:noweb . "yes") (:tangle . > "no") > | (:exports . "code") (:results . "replace") ...) "" nil 0 882) > `---- > > Cheers, > > -- > Eric Schulte > https://cs.unm.edu/~eschulte > PGP: 0x614CA05D > --20cf301cc2da49e1a804e69bffbf Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I believe this may have been an instance of the regex bein= g too greedy which is fixed by the patch I submitted.
-deech


On Fri, Sep 13,= 2013 at 12:05 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
adit= ya siram <aditya.siram@gmail.c= om> writes:

> Hi all,
> `org-babel-get-src-block-info` on an empty block fails.
>
> Given:
> #+BEGIN_SRC c
> #+END_SRC
> #+BEGIN_SRC c
> non-empty
> #+END_SRC
>
> Running `org-babel-get-src-block-info` with point at the beginning of = the
> first line gives:
> ("c" "#+END_SRC
>
> #+BEGIN_SRC c
> non-empty" ((:colname-names) (:rowname-names) (:result-params &qu= ot;replace")
> (:result-type . value) (:comments . "") (:shebang . "&q= uot;) (:cache . "no")
> (:padline . "") (:noweb . "no") (:tangle . "n= o") (:exports . "code")
> (:results . "replace") ...) "" nil 0 8)
>
> The problem is somewhere in `org-babel-src-block-regex` but I didn'= ;t want
> to mess with it because it touches all parts of org-babel and I'm = not sure
> what else would break.
>
> Any advice on how to fix this is appreciated.
> -deech

This works for me. =A0With the point on the first "#"= in

> #+BEGIN_SRC c
> #+END_SRC


I get

,----[C-c C-v I]
| Lang: c
| Header Arguments:
| =A0 =A0 =A0 :cache =A0 =A0 =A0 =A0 =A0no
| =A0 =A0 =A0 :exports =A0 =A0 =A0 =A0code
| =A0 =A0 =A0 :hlines =A0 =A0 =A0 =A0 no
| =A0 =A0 =A0 :noweb =A0 =A0 =A0 =A0 =A0yes
| =A0 =A0 =A0 :padnewline =A0 =A0 yes
| =A0 =A0 =A0 :results =A0 =A0 =A0 =A0replace
| =A0 =A0 =A0 :session =A0 =A0 =A0 =A0none
| =A0 =A0 =A0 :tangle =A0 =A0 =A0 =A0 no
|
| [back]
`----

and

,----[M-: (org-babel-get-src-block-info)]
| ("c" "" ((:colname-names) (:rowname-names) (:result-p= arams "replace")
| =A0 =A0 =A0 =A0 =A0(:result-type . value) (:comments . = "") (:shebang . "")
| =A0 =A0 =A0 =A0 =A0(:cache . "no") (:padline . "&quo= t;) (:noweb . "yes") (:tangle . "no")
| =A0 =A0 =A0 =A0 =A0(:exports . "code") (:results . "replac= e") ...) "" nil 0 882)
`----

Cheers,

--
Eric Schulte
https://cs.unm.e= du/~eschulte
PGP: 0x614CA05D

--20cf301cc2da49e1a804e69bffbf--