emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Babel] Getting Info On Empty Source Block Fails
@ 2013-09-13 14:31 aditya siram
  2013-09-13 17:05 ` Eric Schulte
  0 siblings, 1 reply; 3+ messages in thread
From: aditya siram @ 2013-09-13 14:31 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1048 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Babel] Getting Info On Empty Source Block Fails
  2013-09-13 14:31 [Babel] Getting Info On Empty Source Block Fails aditya siram
@ 2013-09-13 17:05 ` Eric Schulte
  2013-09-17 22:39   ` aditya siram
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Schulte @ 2013-09-13 17:05 UTC (permalink / raw)
  To: aditya siram; +Cc: emacs-orgmode

aditya siram <aditya.siram@gmail.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Babel] Getting Info On Empty Source Block Fails
  2013-09-13 17:05 ` Eric Schulte
@ 2013-09-17 22:39   ` aditya siram
  0 siblings, 0 replies; 3+ messages in thread
From: aditya siram @ 2013-09-17 22:39 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1958 bytes --]

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 <schulte.eric@gmail.com>wrote:

> aditya siram <aditya.siram@gmail.com> 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
>

[-- Attachment #2: Type: text/html, Size: 3057 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-17 22:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-13 14:31 [Babel] Getting Info On Empty Source Block Fails aditya siram
2013-09-13 17:05 ` Eric Schulte
2013-09-17 22:39   ` aditya siram

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).