emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re: [babel] hide inline source code blocks by results
  2012-04-11 14:45 [babel] hide inline source code blocks by results Torsten Wagner
@ 2012-04-11 14:08 ` Eric Schulte
  2012-04-26  8:37   ` Eric Fraga
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Schulte @ 2012-04-11 14:08 UTC (permalink / raw)
  To: Torsten Wagner; +Cc: Org Mode Mailing List

Currently inline blocks like don't associate themselves with their
results, they are only expected to be evaluated on export, so the
functionality you suggest below would require first changing how results
are associated with inline code blocks.

Another option would be to hide everything but the body of the block,
but this may be more confusing than it is worth.

Best,

Torsten Wagner <torsten.wagner@gmail.com> writes:

> Hi,
>
> I guess we had such a discussion some time ago already.
> I just started again to use inline source code blocks
>
> e.g.
>
> text text text src_python[:session]{print((U[0]-U[1])*1000)} mV text text text
>
> if you have a lot of these in a text its rather hard to read.
> I was thinking of something similar like links in org-mode
> The inline source code gets hidden behind the result of the last
> evaluation and can be accessed in the same way like links in org-mode.
> It could even open up in a buffer of the target language like source
> code blocks.
> The above example would be reduced to
>
> text text text _355_ mV text text text
>
> C-c C-c would update the result
> mouse click open the source code in a language specific buffer
> etc.
>
> This would really make it more readable
>
> All the best
> Torsten
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

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

* [babel] hide inline source code blocks by results
@ 2012-04-11 14:45 Torsten Wagner
  2012-04-11 14:08 ` Eric Schulte
  0 siblings, 1 reply; 5+ messages in thread
From: Torsten Wagner @ 2012-04-11 14:45 UTC (permalink / raw)
  To: Org Mode Mailing List

Hi,

I guess we had such a discussion some time ago already.
I just started again to use inline source code blocks

e.g.

text text text src_python[:session]{print((U[0]-U[1])*1000)} mV text text text

if you have a lot of these in a text its rather hard to read.
I was thinking of something similar like links in org-mode
The inline source code gets hidden behind the result of the last
evaluation and can be accessed in the same way like links in org-mode.
It could even open up in a buffer of the target language like source
code blocks.
The above example would be reduced to

text text text _355_ mV text text text

C-c C-c would update the result
mouse click open the source code in a language specific buffer
etc.

This would really make it more readable

All the best
Torsten

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

* Re: [babel] hide inline source code blocks by results
  2012-04-11 14:08 ` Eric Schulte
@ 2012-04-26  8:37   ` Eric Fraga
  2012-04-26 13:08     ` Eric Schulte
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Fraga @ 2012-04-26  8:37 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode Mailing List

Eric Schulte <eric.schulte@gmx.com> writes:

> Currently inline blocks like don't associate themselves with their
> results, they are only expected to be evaluated on export, so the
> functionality you suggest below would require first changing how results
> are associated with inline code blocks.
>
> Another option would be to hide everything but the body of the block,
> but this may be more confusing than it is worth.

Eric,

I do like what Torsten suggested a lot.  I wonder if a halfway solution
would be possible.  Define a babel: link type which includes the src_xxx
code and let the description part of the link be whatever the author
wants it to be.  I wouldn't mind not knowing the result of the code
execution as I don't know that at the moment anyway.

So, something like this would be nice:

... and the result is [[babel:src_octave{3*x+5}][f(x)]] which
demonstrates ...

which would look like

... and the result is f(x) which demonstrates ...

(with f(x) highlighted as a link).

Could something like this be possible?

And, to take this further, could the highlighting differ depending on
link type?  I've not explored this latter aspect so maybe it's already
possible...

thanks,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1
: using Org-mode version 7.8.06 (release_7.8.06.181.g67694.dirty)

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

* Re: [babel] hide inline source code blocks by results
  2012-04-26  8:37   ` Eric Fraga
@ 2012-04-26 13:08     ` Eric Schulte
  2012-04-27 13:25       ` Eric Fraga
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Schulte @ 2012-04-26 13:08 UTC (permalink / raw)
  To: Torsten Wagner; +Cc: Org Mode Mailing List

Eric Fraga <e.fraga@ucl.ac.uk> writes:

> Eric Schulte <eric.schulte@gmx.com> writes:
>
>> Currently inline blocks like don't associate themselves with their
>> results, they are only expected to be evaluated on export, so the
>> functionality you suggest below would require first changing how results
>> are associated with inline code blocks.
>>
>> Another option would be to hide everything but the body of the block,
>> but this may be more confusing than it is worth.
>
> Eric,
>
> I do like what Torsten suggested a lot.  I wonder if a halfway solution
> would be possible.  Define a babel: link type which includes the src_xxx
> code and let the description part of the link be whatever the author
> wants it to be.  I wouldn't mind not knowing the result of the code
> execution as I don't know that at the moment anyway.
>
> So, something like this would be nice:
>
> ... and the result is [[babel:src_octave{3*x+5}][f(x)]] which
> demonstrates ...
>
> which would look like
>
> ... and the result is f(x) which demonstrates ...
>
> (with f(x) highlighted as a link).
>
> Could something like this be possible?
>
> And, to take this further, could the highlighting differ depending on
> link type?  I've not explored this latter aspect so maybe it's already
> possible...
>

I think both this and Torsten's original idea would both be nice
options.  Preferably the final solution would subsume either use case.
Unfortunately either implementation would require a fairly significant
amount of work on the inline source block system, work which I
unfortunately do not have time for at the moment (although I'm happy to
help if anyone else wants to jump into the code).

Thanks,

>
> thanks,
> eric

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

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

* Re: [babel] hide inline source code blocks by results
  2012-04-26 13:08     ` Eric Schulte
@ 2012-04-27 13:25       ` Eric Fraga
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Fraga @ 2012-04-27 13:25 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode Mailing List

Eric Schulte <eric.schulte@gmx.com> writes:


[...]

> I think both this and Torsten's original idea would both be nice
> options.  Preferably the final solution would subsume either use case.
> Unfortunately either implementation would require a fairly significant
> amount of work on the inline source block system, work which I
> unfortunately do not have time for at the moment (although I'm happy to
> help if anyone else wants to jump into the code).

Understood!!  You don't have to tell me about finite time resources :(
But it *is* nice to ponder new syntax for org :-) I even started
thinking of other link type syntax:

 [[inline:octave("3*x+5")]]
 [[call:f(5)]]
 etc.

It's fun.

Thanks,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1
: using Org-mode version 7.8.09 (release_7.8.09-392-ge02226 @ /home/ucecesf/git/org-mode/lisp/org-install.el)

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

end of thread, other threads:[~2012-04-27 13:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11 14:45 [babel] hide inline source code blocks by results Torsten Wagner
2012-04-11 14:08 ` Eric Schulte
2012-04-26  8:37   ` Eric Fraga
2012-04-26 13:08     ` Eric Schulte
2012-04-27 13:25       ` Eric Fraga

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