emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Hendy <jw.hendy@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Working with in-line src and fill-mode/running into new line
Date: Sat, 26 Dec 2015 15:59:07 -0600	[thread overview]
Message-ID: <CA+M2ft8xR9d4y3g+6m3tYsS6RZV3rxGqnvUzAaH=Li2oFPjGMQ@mail.gmail.com> (raw)

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

             reply	other threads:[~2015-12-26 21:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-26 21:59 John Hendy [this message]
2015-12-27  8:58 ` Working with in-line src and fill-mode/running into new line Nicolas Goaziou
2015-12-29 17:44   ` John Hendy

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='CA+M2ft8xR9d4y3g+6m3tYsS6RZV3rxGqnvUzAaH=Li2oFPjGMQ@mail.gmail.com' \
    --to=jw.hendy@gmail.com \
    --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).