emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* tangling inline source code
@ 2016-08-10 14:02 Tyler Smith
  0 siblings, 0 replies; only message in thread
From: Tyler Smith @ 2016-08-10 14:02 UTC (permalink / raw)
  To: Emacs Org-Mode Help

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-10 14:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-10 14:02 tangling inline source code Tyler Smith

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