[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] Working with in-line src and fill-mode/running into new line
From: |
John Hendy |
Subject: |
[O] Working with in-line src and fill-mode/running into new line |
Date: |
Sat, 26 Dec 2015 15:59:07 -0600 |
Greetings,
I don't use in-line code too often, but did recently and often found
myself undoing line wrapping since the code would spill into a new
line, failing to be recognized by C-c C-c. Here's an example (I have
fill-mode set to 90 characters):
#+begin_example
* in-line src
#+begin_src R :session r :exports none :results silent
ave <- mean(5, 7.5, 8, 9)
x <- 200000 * 2
y <- 400000 * 2
vol <- x + y
#+end_src
Based on data from John Doe (Sourcing), average yearly consumption is
src_R[:session
r]{round(1e-6 * vol * (ave - 2), 2) } {{{results(=3.6=)}}} MM lbs.
#+end_example
I was writing up a summary of some material usage at work and it was a
handy opportunity to use inline code in case my source data changed.
As is, the inline code block won't update the results since it's split
into two lines ("C-c C-c can do nothing useful at this location"). I'd
have to go to the end of the first paragraph's line, insert a space,
delete until the second line joined, and then do C-c C-c.
I'm guessing folks are already aware of this, so this post is two-fold:
- what are ways to work around this? I only created the full block
since having the values and mean() function added even more code to
the line. Are others doing the same, applying some fill-mode setting,
just dealing with it?
- could the behavior be modified? I would think this could be similar
to \( \) LaTeX formatting. When I used to run into issues with
$formula$ over new lines, I adopted using \( \), which works great no
matter how long the contents are. Could Org know to interpret
everything that follows =src_lang{= as code, perhaps inserting spaces
for any newlines encountered?
Thanks,
John
- [O] Working with in-line src and fill-mode/running into new line,
John Hendy <=