emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] tangling inline source code


From: Tyler Smith
Subject: [O] tangling inline source code
Date: Wed, 10 Aug 2016 10:02:17 -0400

Hello,

A question came up on Stack Exchange asking about less-verbose ways to
indicate code blocks:
http://emacs.stackexchange.com/questions/26163/one-liner-org-source-tangle

I suggested using the inline format, e.g., 'src_perl{set $variable =
1;}'. However, this is ignored when tangling the org file into a source
file.

The manual indicates that blocks and inline code are treated the same:
http://orgmode.org/manual/Structure-of-code-blocks.html

Is this a bug in the documentation? From the documentation, I expect
inline code to be tangled the same as a code block, at least when
appropriate `tangle` options are set in the header.

Here's a short example file illustrating the problem:

+----
* Taking notes
:PROPERTIES:
:tangle: whatever.R
:comments: org
:END:

R commands
#+BEGIN_SRC R
var1 <- 1
#+END_SRC

And here's an inline command: src_R{var2 <- 2}.

Perl unset command (just making it up... :P)
#+BEGIN_SRC R
rm(list = c("var1", "var2"))
#+END_SRC

And some more text.
+----

Tangling this will insert the two code blocks into the tangled file, but
the inline code gets treated as regular text, and is converted into a
comment.

Am I doing something wrong, or could the documentation be clarified on
this point?

Best,

Tyler

-- 
plantarum.ca



reply via email to

[Prev in Thread] Current Thread [Next in Thread]