emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Error when running org-babel-tangle
@ 2015-03-05 22:50 Richard Stanton
  2015-03-06  1:08 ` Charles C. Berry
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Stanton @ 2015-03-05 22:50 UTC (permalink / raw)
  To: emacs-orgmode

I’m experimenting with tangling files in org-mode, and have found that certain files cause org-babel-tangle to die with an error (Org-mode version 8.3beta (release_8.3beta-884-g9ed426). Here’s a small example:

————————————

* Sample code

#+BEGIN_SRC makefile :tangle makefile-main
circle:
	@gfortran -c circle.f90

main: circle
	@gfortran -c main.f90
	@gfortran circle.o main.o -o main

clean:
	@rm -f *.o main
#+END_SRC

Run this block to tangle out the new files.

#+BEGIN_SRC emacs-lisp
(org-babel-tangle)
#+END_SRC

#+RESULTS:
| makefile-main |

In this block I use this header:
#+BEGIN_EXAMPLE
#+BEGIN_SRC sh :results raw 
#+END_EXAMPLE

#+BEGIN_SRC sh :results raw replace
make -f makefile-main clean main
./main
#+END_SRC

————————————  

When I run org-babel-tangle on this file (or press C-c C-c in the emacs-lisp block), I get the following error:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("-l \"\\(.+\\)\"" nil)
  org-babel-tangle-single-block(5)
  org-babel-tangle-collect-blocks(nil nil)
  org-babel-tangle()
  (progn (org-babel-tangle))
  eval((progn (org-babel-tangle)))
  org-babel-execute:emacs-lisp("(org-babel-tangle)" ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "code") (:results . "replace") (:session . "none") (:hlines . "no") (:result-type . value) (:result-params "replace") (:rowname-names) (:colname-names)))
  org-babel-execute-src-block(nil)
  org-babel-execute-src-block-maybe()
  org-babel-execute-maybe()
  org-babel-execute-safely-maybe()
  run-hook-with-args-until-success(org-babel-execute-safely-maybe)
  org-ctrl-c-ctrl-c(nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)
  command-execute(org-ctrl-c-ctrl-c)


Any ideas what’s going on? If I delete either of the two blocks at the bottom of the file (the EXAMPLE block or the final SRC block), it works fine.

Thanks.

Richard Stanton

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

* Re: Error when running org-babel-tangle
  2015-03-05 22:50 Error when running org-babel-tangle Richard Stanton
@ 2015-03-06  1:08 ` Charles C. Berry
  2015-03-06  2:31   ` Charles C. Berry
  2015-03-06  4:13   ` Richard Stanton
  0 siblings, 2 replies; 4+ messages in thread
From: Charles C. Berry @ 2015-03-06  1:08 UTC (permalink / raw)
  To: Richard Stanton; +Cc: emacs-orgmode

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1031 bytes --]

On Thu, 5 Mar 2015, Richard Stanton wrote:

> I’m experimenting with tangling files in org-mode, and have found
> that certain files cause org-babel-tangle to ie with an error
> (Org-mode version 8.3beta (release_8.3beta-884-g9ed426). Here’s a
> small example:

>
> ————————————
>
> * Sample code
>
> #+BEGIN_SRC makefile :tangle makefile-main
> circle:
> 	@gfortran -c circle.f90
>
> main: circle
> 	@gfortran -c main.f90
> 	@gfortran circle.o main.o -o main
>
> clean:
> 	@rm -f *.o main
> #+END_SRC
>
> Run this block to tangle out the new files.
>
> #+BEGIN_SRC emacs-lisp
> (org-babel-tangle)
> #+END_SRC
>
> #+RESULTS:
> | makefile-main |
>
> In this block I use this header:
> #+BEGIN_EXAMPLE
> #+BEGIN_SRC sh :results raw
> #+END_EXAMPLE
>

[rest deleted]

===

#+BEGIN_EXAMPLE
   ,#+BEGIN_SRC sh :results raw 
#+END_EXAMPLE

will work. The comma is stripped on export.

If you use org-edit-src (C-c C-c) on your original example block, it
will format it in that way automagically.

HTH,

Chuck

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

* Re: Error when running org-babel-tangle
  2015-03-06  1:08 ` Charles C. Berry
@ 2015-03-06  2:31   ` Charles C. Berry
  2015-03-06  4:13   ` Richard Stanton
  1 sibling, 0 replies; 4+ messages in thread
From: Charles C. Berry @ 2015-03-06  2:31 UTC (permalink / raw)
  To: Richard Stanton; +Cc: emacs-orgmode

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1219 bytes --]

On Thu, 5 Mar 2015, Charles C. Berry wrote:

> On Thu, 5 Mar 2015, Richard Stanton wrote:
>
>> I’m experimenting with tangling files in org-mode, and have found
>> that certain files cause org-babel-tangle to ie with an error
>> (Org-mode version 8.3beta (release_8.3beta-884-g9ed426). Here’s a
>> small example:
>
>> 
>> ————————————
>> 
>> * Sample code
>> 
>> #+BEGIN_SRC makefile :tangle makefile-main
>> circle:
>> 	@gfortran -c circle.f90
>> 
>> main: circle
>> 	@gfortran -c main.f90
>> 	@gfortran circle.o main.o -o main
>> 
>> clean:
>> 	@rm -f *.o main
>> #+END_SRC
>> 
>> Run this block to tangle out the new files.
>> 
>> #+BEGIN_SRC emacs-lisp
>> (org-babel-tangle)
>> #+END_SRC
>> 
>> #+RESULTS:
>> | makefile-main |
>> 
>> In this block I use this header:
>> #+BEGIN_EXAMPLE
>> #+BEGIN_SRC sh :results raw
>> #+END_EXAMPLE
>> 
>
> [rest deleted]
>
> ===
>
> #+BEGIN_EXAMPLE
>  ,#+BEGIN_SRC sh :results raw #+END_EXAMPLE
>
> will work. The comma is stripped on export.
>
> If you use org-edit-src (C-c C-c) on your original example block, it
> will format it in that way automagically.

Whoops!

Make that =C-c ' C-c '= or (org-edit-src) followed by (org-edit-src-exit).

Chuck

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

* Re: Error when running org-babel-tangle
  2015-03-06  1:08 ` Charles C. Berry
  2015-03-06  2:31   ` Charles C. Berry
@ 2015-03-06  4:13   ` Richard Stanton
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Stanton @ 2015-03-06  4:13 UTC (permalink / raw)
  To: Charles C. Berry; +Cc: emacs-orgmode

Aha! Thanks, Chuck.

> On Mar 5, 2015, at 5:08 PM, Charles C. Berry <ccberry@ucsd.edu> wrote:
> 
> On Thu, 5 Mar 2015, Richard Stanton wrote:
> 
>> I’m experimenting with tangling files in org-mode, and have found
>> that certain files cause org-babel-tangle to ie with an error
>> (Org-mode version 8.3beta (release_8.3beta-884-g9ed426). Here’s a
>> small example:
> 
>> 
>> ————————————
>> 
>> * Sample code
>> 
>> #+BEGIN_SRC makefile :tangle makefile-main
>> circle:
>> 	@gfortran -c circle.f90
>> 
>> main: circle
>> 	@gfortran -c main.f90
>> 	@gfortran circle.o main.o -o main
>> 
>> clean:
>> 	@rm -f *.o main
>> #+END_SRC
>> 
>> Run this block to tangle out the new files.
>> 
>> #+BEGIN_SRC emacs-lisp
>> (org-babel-tangle)
>> #+END_SRC
>> 
>> #+RESULTS:
>> | makefile-main |
>> 
>> In this block I use this header:
>> #+BEGIN_EXAMPLE
>> #+BEGIN_SRC sh :results raw
>> #+END_EXAMPLE
>> 
> 
> [rest deleted]
> 
> ===
> 
> #+BEGIN_EXAMPLE
>  ,#+BEGIN_SRC sh :results raw #+END_EXAMPLE
> 
> will work. The comma is stripped on export.
> 
> If you use org-edit-src (C-c C-c) on your original example block, it
> will format it in that way automagically.
> 
> HTH,
> 
> Chuck

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

end of thread, other threads:[~2015-03-06  4:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-05 22:50 Error when running org-babel-tangle Richard Stanton
2015-03-06  1:08 ` Charles C. Berry
2015-03-06  2:31   ` Charles C. Berry
2015-03-06  4:13   ` Richard Stanton

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).