emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tyler Smith <tyler@plantarum.ca>
To: Emacs Org-Mode Help <emacs-orgmode@gnu.org>
Subject: tangling inline source code
Date: Wed, 10 Aug 2016 10:02:17 -0400	[thread overview]
Message-ID: <1470837737.1415749.691367361.00DEE9B2@webmail.messagingengine.com> (raw)

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	other threads:[~2016-08-10 14:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1470837737.1415749.691367361.00DEE9B2@webmail.messagingengine.com \
    --to=tyler@plantarum.ca \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).