emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Working with in-line src and fill-mode/running into new line
@ 2015-12-26 21:59 John Hendy
  2015-12-27  8:58 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: John Hendy @ 2015-12-26 21:59 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Working with in-line src and fill-mode/running into new line
  2015-12-26 21:59 Working with in-line src and fill-mode/running into new line John Hendy
@ 2015-12-27  8:58 ` Nicolas Goaziou
  2015-12-29 17:44   ` John Hendy
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2015-12-27  8:58 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

Hello,

John Hendy <jw.hendy@gmail.com> writes:

> - 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?

It is a known, and annoying, limitation. I'll have a look at it soon.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Working with in-line src and fill-mode/running into new line
  2015-12-27  8:58 ` Nicolas Goaziou
@ 2015-12-29 17:44   ` John Hendy
  0 siblings, 0 replies; 3+ messages in thread
From: John Hendy @ 2015-12-29 17:44 UTC (permalink / raw)
  To: John Hendy, emacs-orgmode

On Sun, Dec 27, 2015 at 2:58 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Hello,
>
> John Hendy <jw.hendy@gmail.com> writes:
>
>> - 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?
>
> It is a known, and annoying, limitation. I'll have a look at it soon.

Glad others have run into this before; I wondered if it was some
misunderstanding on my part. Thanks for your quick resposne and for
taking a stab at it!


Best,
John

>
>
> Regards,
>
> --
> Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-29 17:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-26 21:59 Working with in-line src and fill-mode/running into new line John Hendy
2015-12-27  8:58 ` Nicolas Goaziou
2015-12-29 17:44   ` John Hendy

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