[O] Push a dependent TODO item on top of a depending one

2012-03-05 Thread Alan E. Davis
It just occurred to me to try to implement a method of pushing a TODO item
on top of another, in the manner of a Stack.  The item on top of the stack
is a task upon which performance of some other task depends.


I need to call someone, so I have a task that appears on my agenda, to call
him.  However,  I have just discovered that the phone number I have for
this person is not working.  I new need to find his phone number, so I can
write a new TODO task.  It would be fantastic to be able to push a TODO on
top of the dependant TODO, the task that is held up until one finds the
phone number.

Once  I have found the number, and "pop" the number finding task off the
agenda, the dependant task would appear as a high priority, active task.
rendering the TODO to CALL invisible, perhaps as a subtask,

I think there are many ways to do this.   Is it a nightmare to implement in
the fashion I have suggested?   Is it already easy to do?  The crux of the
matter is a dependent TODO is rendered invisible until some subtask TODO is
completed.

Thank you for all the ideas,

Alan Davis


Re: [O] [Bug] Formula editor (C-c ') does not parse first/last row/column specifications correctly

2012-03-05 Thread Achim Gratz
Achim Gratz  writes:
> Consider the following org table
[...]

I've had a look in org-table.el, I pity the person who'll have to
correct this... there are several stored and literal regex occurences
that are interacting in various ways to produce this.  I have found a
few literal regex occurences that are related to the formula editor
highlighting (but changing them broke other stuff), but I have
absolutely no idea how to correct the highlight into the table.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] [BUG] LATEX_CLASS_OPTIONS not working

2012-03-05 Thread Nick Dokos
suvayu ali  wrote:

> Hi,
> 
> I think there is a regression bug in latex export. The
> 
> #+LATEX_CLASS_OPTIONS: a4paper
> 
> directive is supposed to generate the following latex code:
> 
> \documentclass{a4paper,article}
> 
> Instead it generates:
> 
> \documentclassa4paper{article}
> 
> A minimal example is attached.
> 

I don't think it's a regression - at least I could only find two commits
that touched the relevant code (lines 1397-1405 in org-latex.el) and
they are from 2008 and 2009.

Also the latex syntax is 

   \documentclass[a4paper]{article}

and an example in the beamer section of the manual

   (info "(org) Beamer class export")

makes me believe that the expectation is that you'll enter

   #+LATEX_CLASS_OPTIONS: [a4paper]

including the square brackets.

Nick





[O] [BUG] LATEX_CLASS_OPTIONS not working

2012-03-05 Thread suvayu ali
Hi,

I think there is a regression bug in latex export. The

#+LATEX_CLASS_OPTIONS: a4paper

directive is supposed to generate the following latex code:

\documentclass{a4paper,article}

Instead it generates:

\documentclassa4paper{article}

A minimal example is attached.

Thanks,

-- 
Suvayu

Open source is the future. It sets us free.
#+LATEX_CLASS: article
#+LATEX_CLASS_OPTIONS: a4paper
#+LATEX_HEADER: \setmainfont{Linux Libertine}

* Top heading
** Meeting
  :PROPERTIES:
  :LaTeX_CLASS: article
  :EXPORT_FILE_NAME: report.pdf
  :EXPORT_TITLE: Report
  :EXPORT_OPTIONS: H:1 num:nil toc:nil ^:{}
  :END:

*** Things
+ Some item
+ Item 2
+ Last item

* Last heading


bug.tex
Description: TeX document


Re: [O] Percent justification in Beamer tables

2012-03-05 Thread Nick Dokos
François Pinard  wrote:

> Hi, Org people.
> 
> When, in an Org table, a column is made up of numbers, each of which is
> immediately followed by a percent sign, table formatting within Emacs
> right adjusts such numbers in their column, which is nice.  Moreover, if
> I publish such tables as HTML, numbers are right adjusted as well.
> 
> However, the same table inserted in a Beamer presentation shows the
> number /left/ justified in their column, which is a formatting
> discrepancy, or at least not what I expected.  Could the justification
> of percentages be made more uniform Org-wide?
> 

It's of course possible (even probable) that the latex exporter behaves
differently from the html exporter in this case (and probably many other
cases.) Historically, I believe the latex exporter was the first one and
in those days, each exporter blazed its own trail, so inevitably we have
a divergence of behavior. The new exporters based on Nicolas's
org-element parser will presumably behave a lot more consistently.

In the meantime, you can always override the latex behavior with
something like

#+ATTR_LaTeX: align=|r|r|l|r|l|r|

to set the alignment of each column explicitly without affecting the HTML
output.

Nick





[O] Percent justification in Beamer tables

2012-03-05 Thread François Pinard
Hi, Org people.

When, in an Org table, a column is made up of numbers, each of which is
immediately followed by a percent sign, table formatting within Emacs
right adjusts such numbers in their column, which is nice.  Moreover, if
I publish such tables as HTML, numbers are right adjusted as well.

However, the same table inserted in a Beamer presentation shows the
number /left/ justified in their column, which is a formatting
discrepancy, or at least not what I expected.  Could the justification
of percentages be made more uniform Org-wide?

François



Re: [O] noweb documentation

2012-03-05 Thread Eric Schulte
Done,

Daimrod  writes:

> Hi, it would be great if the documentation mentioned the syntax
> <> because the only place it's mentioned is in the
> docstring of `org-babel-expand-noweb-references'. Currently, the manual
> mentions only the syntax <>.
>
>

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



[O] noweb documentation

2012-03-05 Thread Daimrod

Hi, it would be great if the documentation mentioned the syntax
<> because the only place it's mentioned is in the
docstring of `org-babel-expand-noweb-references'. Currently, the manual
mentions only the syntax <>.




Re: [O] Including Latex Files

2012-03-05 Thread Nicolas Goaziou
Hello,

Markus Grebenstein  writes:

> So I tried
>
> #+INCLUDE: myfile.tex latex

The syntax is #+INCLUDE: "myfile.tex" src latex


Regards,

-- 
Nicolas Goaziou



Re: [O] org-odt: cannot find factory styles

2012-03-05 Thread Matthew Landis



On 3/2/2012 3:38 PM, Jambunathan K wrote:

If the Org is meant for a global distribution (as opposed to personal
installation), the distributor has to specifically ask the users to copy
the styles file to<>/etc/org.

C-h v data-directory

In your case, the data-directory is c:/emacs-23.4/etc/org/.

snipped

Style files from the git repo is here:
http://orgmode.org/w/?p=org-mode.git;a=tree;f=etc/styles;hb=HEAD

Schema files form the git repo is here:
http://orgmode.org/w/?p=org-mode.git;a=tree;f=contrib/odt/etc/schema;hb=HEAD

Remember to download the raw files if you are downloading from git repo.


dear K,
Thanks very much for your response.  Based on what you said above, I was 
able to get it working.  I downloaded the Style and Schema files from 
the git repo, and put them in to the directories that emacs was 
searching, namely:


Debug (org-odt): Using schema files under 
c:/emacs-23.4/site-lisp/contrib/odt/etc/schema/

Debug (org-odt): Using styles under c:/emacs-23.4/site-lisp/etc/styles/

In both cases, I had to create the directories.  to put them in.  I 
figured it was easier (for now) to put the files where this installation 
expected them, rather than fix the installation using ELPA etc.  When I 
update, I'm sure I will use the other approaches you mentioned.


Before I could get ODT success, I also had to install zip and unzip for 
my Windows machine, which I found at 
http://gnuwin32.sourceforge.net/packages.html


Now it works great.

thanks!

M

--
~~
Matthew Landis, Ph.D.
Research Scientist
ISciences, LLC
61 Main St. Suite 200
Burlington VT 05401
802.864.2999
www.isciences.com
~~




Re: [O] [Bug] Regression w/ insert into tables in overwrite-mode

2012-03-05 Thread Achim Gratz
Achim Gratz  writes:
> Commit 00040e7 by David Maus has introduced a regression when inserting
> into org tables while overwrite mode is on.  For each character inserted
> into a table cell, the cell (and the whole table row) gets shortened by
> one character.

*Ping*

David, are you listening?
:-)


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Terratec KOMPLEXER:
http://Synth.Stromeko.net/Downloads.html#KomplexerWaves




Re: [O] Participating in Google Summer of Code 2012

2012-03-05 Thread Thorsten
Eric Schulte  writes:

Hi Eric, Hi List, 

> Some ideas that come
> to mind include;
> - implementing a multi-programming-language "notebook" like console
>   interface build on top of Org-mode and Babel (with both Emacs and
>   HTML interfaces)
> - adding support for asynchronous code block execution
> - adding support for piping results between code blocks allowing many
>   blocks to run concurrently (probably best combined with asynchronous
>   execution)
> - adding support for handling output written to STDERR

Eric - I added these 4 proposels to the GSoC 2012 ideas page:
http://orgmode.org/worg/org-contrib/gsoc2012/orgmode-gsoc2012-ideas.html
and put you as potential mentor - is that OK with you?

Since the deadline for the GNU application is approaching rapidly (9th
of march) I would like to encourage anybody with an Org Mode related
project idea (no matter if from a mentors or a students point of view)
to add his proposol to the ideas page.

This is a good chance for students to "flip bits, not burgers" during the
summer, paid by Google, working on their favorite software-project, and
contributing to the GNU project and the idea of free software. 

-- 
cheers,
Thorsten




Re: [O] Date-tree navigation question

2012-03-05 Thread Bernt Hansen
Robert Horn  writes:

> Is there a short simple key sequence that will take you to the last
> entry in a date-tree and open that headline?  Slightly better would be
> a way to go to the last, and open the last N headlines.  It could be
> generalized into "go to end of current item and open last N items of
> whatever depth" when applied to other outline forms.
>
> I know how to do this with tabs and cursor movement to walk down the
> tree opening headlines as needed.  This requires more work and paying
> attention.
>
> I have not found a simple way to do this.  Does one exist?

Can't you just do something like this on the top-level headline for the
tree

C-c C-k C-c C-f M-7 C-c C-p

(where N=7 in this example)

That puts the cursor on the 7th-last heading (hope that makes sense)
It's not particularly short though...
  C-c C-k - show all siblings
  C-c C-f - go forward to next headline
  M-7 C-c C-p - go back to previous heading 7 times

or maybe

C-c C-f C-b C-c C-r

You should be able to build a local interactive function that takes a
prefix argument for N to get you where you want to be.

You can also use M-3 S-TAB to open show level 3 tasks and then navigate
the folded tree.

HTH,
Bernt



Re: [O] [babel] Replace results with ascii package caption

2012-03-05 Thread Thomas S. Dye
Eric Schulte  writes:

> t...@tsdye.com (Thomas S. Dye) writes:
>
>> Hi Eric,
>>
>> Eric Schulte  writes:
>>
>>> Would it be possible to swap the results and caption lines?
>>
>> The caption lines are part of the ascii output.  I think I'd have to
>> swap them manually.
>
> I didn't realize that this was being produced by an external package
> called from the code block.  If this is the case then the package itself
> will need a special setting for appending results so that it doesn't
> output a caption line.
>
> [...]
>>
>> This is an interesting case.  As other packages start to provide Org
>> Mode output this kind of problem might crop up again.  Is there any
>> limit to the Org Mode output a third party might produce?
>>
>
> There need be no limit on what types of results are output by code
> blocks.  You could always use ":results org" to wrap the results in an
> Org-mode block to make the extent of the results clear regardless of
> their contents.

Thanks Eric.  This was the missing piece to my puzzle.

Tom
>
> Best,
>
>>
>> All the best,
>> Tom
>>
>>> Best,
>>>
>>> t...@tsdye.com (Thomas S. Dye) writes:
>>>
 Aloha all,

 The code block at the bottom appends its results, rather than replacing
 them.  Here are the header arguments:

 Name: test-replace-results
 Lang: R
 Header Arguments:
:cache  no
:exportscode
:hlines no
:noweb  yes
:padnewline yes
:resultsraw output replace
:sessionnone
:tangle no

 Everything works fine without the ascii package caption argument.
  
 * Babel replace results
 #+name: test-replace-results
 #+header: :results output raw
 #+BEGIN_SRC R
 library(ascii)
 cap <- "Test replace results"
 x <- runif(100)
 y <- ascii(quantile(x),include.colnames=T,header=T,caption=cap)
 print(y,type="org")
 rm(cap,x,y)
 #+END_SRC
 #+RESULTS: test-replace-results
 #+CAPTION: Test replace results
 | 0%   | 25%  | 50%  | 75%  | 100% |
 |--+--+--+--+--|
 | 0.02 | 0.28 | 0.49 | 0.78 | 0.98 |
 #+CAPTION: Test replace results
 | 0%   | 25%  | 50%  | 75%  | 100% |
 |--+--+--+--+--|
 | 0.01 | 0.21 | 0.44 | 0.76 | 1.00 |

 I'm using Org-mode version 7.8.03 (release_7.8.03.546.gf6ea).

 All the best,
 Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] what's wrong with this sbe?

2012-03-05 Thread Eric Schulte
Myles English  writes:

>>> On Mon, 05 Mar 2012 07:34:49 -0700, Eric Schulte said:
>
>   > Myles English  writes:
>   >> Hi,
>   >> 
>   >> Please could tell me where I am going wrong with this?  I just
>   >> can't get the source block to put a result in the table.
>   [etc]
>
>   > Hi Miles,
>
>   > To force the value of "236:30:00" to be interpreted as a string
>   > (rather than have sbe try to convert it to a number prefix the
>   > reference with a "$" character).  However even doing this your
>   > example exposed a bug in this sbe functionality to which I've just
>   > pushed up a fix.  With the latest version of Org-mode the attached
>   > works as expected.
>
>
>   > #+name: workingDays #+BEGIN_SRC emacs-lisp :var hms="0" (require
>   > 'org-timer) (/ (org-timer-hms-to-secs hms) (* 60 60 8)) #+END_SRC
>
>   > Note the variable reference is prefixed with a "$" to ensure that it
>   > is interpreted as a string.  See the `sbe' documentation for full
>   > `sbe' usage information.
>
>   > -- Eric Schulte http://cs.unm.edu/~eschulte/
>
> Thanks Eryk that solves the problem!  I actually did try with an extra
> "$" but it didn't work so I assumed that I had misunderstood the
> documentation.  Reading the documentation again, I think it could be
> improved, perhaps
>
> #+begin_quote
> to force interpretation of a cell's value as a string, prefix the
> identifier with two "$"s rather than a single "$"
> #+end_quote
>
> instead of
>
> #+begin_quote
> to force interpretation of a cell's value as a string, prefix the
> identifier with another "$", (e.g. @2$2 becomes $@2$2)
> #+end_quote
>
> Thanks again,
>

Good idea, I've just pushed up a documentation improvement.

Thanks,

>
> Myles

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



Re: [O] [babel] Replace results with ascii package caption

2012-03-05 Thread Eric Schulte
t...@tsdye.com (Thomas S. Dye) writes:

> Hi Eric,
>
> Eric Schulte  writes:
>
>> Would it be possible to swap the results and caption lines?
>
> The caption lines are part of the ascii output.  I think I'd have to
> swap them manually.

I didn't realize that this was being produced by an external package
called from the code block.  If this is the case then the package itself
will need a special setting for appending results so that it doesn't
output a caption line.

[...]
>
> This is an interesting case.  As other packages start to provide Org
> Mode output this kind of problem might crop up again.  Is there any
> limit to the Org Mode output a third party might produce?
>

There need be no limit on what types of results are output by code
blocks.  You could always use ":results org" to wrap the results in an
Org-mode block to make the extent of the results clear regardless of
their contents.

Best,

>
> All the best,
> Tom
>
>> Best,
>>
>> t...@tsdye.com (Thomas S. Dye) writes:
>>
>>> Aloha all,
>>>
>>> The code block at the bottom appends its results, rather than replacing
>>> them.  Here are the header arguments:
>>>
>>> Name: test-replace-results
>>> Lang: R
>>> Header Arguments:
>>> :cache  no
>>> :exportscode
>>> :hlines no
>>> :noweb  yes
>>> :padnewline yes
>>> :resultsraw output replace
>>> :sessionnone
>>> :tangle no
>>>
>>> Everything works fine without the ascii package caption argument.
>>>  
>>> * Babel replace results
>>> #+name: test-replace-results
>>> #+header: :results output raw
>>> #+BEGIN_SRC R
>>> library(ascii)
>>> cap <- "Test replace results"
>>> x <- runif(100)
>>> y <- ascii(quantile(x),include.colnames=T,header=T,caption=cap)
>>> print(y,type="org")
>>> rm(cap,x,y)
>>> #+END_SRC
>>> #+RESULTS: test-replace-results
>>> #+CAPTION: Test replace results
>>> | 0%   | 25%  | 50%  | 75%  | 100% |
>>> |--+--+--+--+--|
>>> | 0.02 | 0.28 | 0.49 | 0.78 | 0.98 |
>>> #+CAPTION: Test replace results
>>> | 0%   | 25%  | 50%  | 75%  | 100% |
>>> |--+--+--+--+--|
>>> | 0.01 | 0.21 | 0.44 | 0.76 | 1.00 |
>>>
>>> I'm using Org-mode version 7.8.03 (release_7.8.03.546.gf6ea).
>>>
>>> All the best,
>>> Tom

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



Re: [O] [babel] Replace results with ascii package caption

2012-03-05 Thread Thomas S. Dye
Hi Eric,

Eric Schulte  writes:

> Would it be possible to swap the results and caption lines?

The caption lines are part of the ascii output.  I think I'd have to
swap them manually.
>
> e.g., this
>
>> #+RESULTS: test-replace-results
>> #+CAPTION: Test replace results
>> | 0%   | 25%  | 50%  | 75%  | 100% |
>> |--+--+--+--+--|
>> | 0.02 | 0.28 | 0.49 | 0.78 | 0.98 |
>
> to this
>
>> #+CAPTION: Test replace results
>> #+RESULTS: test-replace-results
>> | 0%   | 25%  | 50%  | 75%  | 100% |
>> |--+--+--+--+--|
>> | 0.02 | 0.28 | 0.49 | 0.78 | 0.98 |
>
> everything following #+results is expected to be part of the results,
> and it would be simpler to not add special cases to this behavior for
> lines that look like Org-mode comment constructs.
>

This is an interesting case.  As other packages start to provide Org
Mode output this kind of problem might crop up again.  Is there any
limit to the Org Mode output a third party might produce?

All the best,
Tom

> Best,
>
> t...@tsdye.com (Thomas S. Dye) writes:
>
>> Aloha all,
>>
>> The code block at the bottom appends its results, rather than replacing
>> them.  Here are the header arguments:
>>
>> Name: test-replace-results
>> Lang: R
>> Header Arguments:
>>  :cache  no
>>  :exportscode
>>  :hlines no
>>  :noweb  yes
>>  :padnewline yes
>>  :resultsraw output replace
>>  :sessionnone
>>  :tangle no
>>
>> Everything works fine without the ascii package caption argument.
>>  
>> * Babel replace results
>> #+name: test-replace-results
>> #+header: :results output raw
>> #+BEGIN_SRC R
>> library(ascii)
>> cap <- "Test replace results"
>> x <- runif(100)
>> y <- ascii(quantile(x),include.colnames=T,header=T,caption=cap)
>> print(y,type="org")
>> rm(cap,x,y)
>> #+END_SRC
>> #+RESULTS: test-replace-results
>> #+CAPTION: Test replace results
>> | 0%   | 25%  | 50%  | 75%  | 100% |
>> |--+--+--+--+--|
>> | 0.02 | 0.28 | 0.49 | 0.78 | 0.98 |
>> #+CAPTION: Test replace results
>> | 0%   | 25%  | 50%  | 75%  | 100% |
>> |--+--+--+--+--|
>> | 0.01 | 0.21 | 0.44 | 0.76 | 1.00 |
>>
>> I'm using Org-mode version 7.8.03 (release_7.8.03.546.gf6ea).
>>
>> All the best,
>> Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] what's wrong with this sbe?

2012-03-05 Thread Myles English

>> On Mon, 05 Mar 2012 07:34:49 -0700, Eric Schulte said:

  > Myles English  writes:
  >> Hi,
  >> 
  >> Please could tell me where I am going wrong with this?  I just
  >> can't get the source block to put a result in the table.
  [etc]

  > Hi Miles,

  > To force the value of "236:30:00" to be interpreted as a string
  > (rather than have sbe try to convert it to a number prefix the
  > reference with a "$" character).  However even doing this your
  > example exposed a bug in this sbe functionality to which I've just
  > pushed up a fix.  With the latest version of Org-mode the attached
  > works as expected.


  > #+name: workingDays #+BEGIN_SRC emacs-lisp :var hms="0" (require
  > 'org-timer) (/ (org-timer-hms-to-secs hms) (* 60 60 8)) #+END_SRC

  > Note the variable reference is prefixed with a "$" to ensure that it
  > is interpreted as a string.  See the `sbe' documentation for full
  > `sbe' usage information.

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

Thanks Eryk that solves the problem!  I actually did try with an extra
"$" but it didn't work so I assumed that I had misunderstood the
documentation.  Reading the documentation again, I think it could be
improved, perhaps

#+begin_quote
to force interpretation of a cell's value as a string, prefix the
identifier with two "$"s rather than a single "$"
#+end_quote

instead of

#+begin_quote
to force interpretation of a cell's value as a string, prefix the
identifier with another "$", (e.g. @2$2 becomes $@2$2)
#+end_quote

Thanks again,

Myles



Re: [O] [babel] Replace results with ascii package caption

2012-03-05 Thread Eric Schulte
Would it be possible to swap the results and caption lines?

e.g., this

> #+RESULTS: test-replace-results
> #+CAPTION: Test replace results
> | 0%   | 25%  | 50%  | 75%  | 100% |
> |--+--+--+--+--|
> | 0.02 | 0.28 | 0.49 | 0.78 | 0.98 |

to this

> #+CAPTION: Test replace results
> #+RESULTS: test-replace-results
> | 0%   | 25%  | 50%  | 75%  | 100% |
> |--+--+--+--+--|
> | 0.02 | 0.28 | 0.49 | 0.78 | 0.98 |

everything following #+results is expected to be part of the results,
and it would be simpler to not add special cases to this behavior for
lines that look like Org-mode comment constructs.

Best,

t...@tsdye.com (Thomas S. Dye) writes:

> Aloha all,
>
> The code block at the bottom appends its results, rather than replacing
> them.  Here are the header arguments:
>
> Name: test-replace-results
> Lang: R
> Header Arguments:
>   :cache  no
>   :exportscode
>   :hlines no
>   :noweb  yes
>   :padnewline yes
>   :resultsraw output replace
>   :sessionnone
>   :tangle no
>
> Everything works fine without the ascii package caption argument.
>  
> * Babel replace results
> #+name: test-replace-results
> #+header: :results output raw
> #+BEGIN_SRC R
> library(ascii)
> cap <- "Test replace results"
> x <- runif(100)
> y <- ascii(quantile(x),include.colnames=T,header=T,caption=cap)
> print(y,type="org")
> rm(cap,x,y)
> #+END_SRC
> #+RESULTS: test-replace-results
> #+CAPTION: Test replace results
> | 0%   | 25%  | 50%  | 75%  | 100% |
> |--+--+--+--+--|
> | 0.02 | 0.28 | 0.49 | 0.78 | 0.98 |
> #+CAPTION: Test replace results
> | 0%   | 25%  | 50%  | 75%  | 100% |
> |--+--+--+--+--|
> | 0.01 | 0.21 | 0.44 | 0.76 | 1.00 |
>
> I'm using Org-mode version 7.8.03 (release_7.8.03.546.gf6ea).
>
> All the best,
> Tom

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



Re: [O] what's wrong with this sbe?

2012-03-05 Thread Myles English
>> On Mon, 05 Mar 2012 17:09:48 +, Myles English said:

>> On Mon, 05 Mar 2012 07:34:49 -0700, Eric Schulte said:

  >> Myles English  writes:
  >>> Hi,
  >>> 
  >>> Please could tell me where I am going wrong with this?  I just
  >>> can't get the source block to put a result in the table.
  >   [etc]

  >> Hi Miles,

  >> To force the value of "236:30:00" to be interpreted as a string
  >> (rather than have sbe try to convert it to a number prefix the
  >> reference with a "$" character).  However even doing this your
  >> example exposed a bug in this sbe functionality to which I've just
  >> pushed up a fix.  With the latest version of Org-mode the attached
  >> works as expected.


  >> #+name: workingDays #+BEGIN_SRC emacs-lisp :var hms="0" (require
  >> 'org-timer) (/ (org-timer-hms-to-secs hms) (* 60 60 8)) #+END_SRC

  >> Note the variable reference is prefixed with a "$" to ensure that
  >> it is interpreted as a string.  See the `sbe' documentation for
  >> full `sbe' usage information.

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

  > Thanks Eryk that solves the problem!  I actually did try with an
  > extra "$" but it didn't work so I assumed that I had misunderstood
  > the documentation.  Reading the documentation again, I think it
  > could be improved, perhaps

Yeah, I got these two blocks the wrong way around:

  > #+begin_quote to force interpretation of a cell's value as a string,
  > prefix the identifier with two "$"s rather than a single
  > "$" #+end_quote

  > instead of

  > #+begin_quote to force interpretation of a cell's value as a string,
  > prefix the identifier with another "$", (e.g. @2$2 becomes
  > $@2$2) #+end_quote

  > Thanks again,

  > Myles


Myles



[O] [babel] Replace results with ascii package caption

2012-03-05 Thread Thomas S. Dye
Aloha all,

The code block at the bottom appends its results, rather than replacing
them.  Here are the header arguments:

Name: test-replace-results
Lang: R
Header Arguments:
:cache  no
:exportscode
:hlines no
:noweb  yes
:padnewline yes
:resultsraw output replace
:sessionnone
:tangle no

Everything works fine without the ascii package caption argument.
 
* Babel replace results
#+name: test-replace-results
#+header: :results output raw
#+BEGIN_SRC R
library(ascii)
cap <- "Test replace results"
x <- runif(100)
y <- ascii(quantile(x),include.colnames=T,header=T,caption=cap)
print(y,type="org")
rm(cap,x,y)
#+END_SRC

#+RESULTS: test-replace-results
#+CAPTION: Test replace results
| 0%   | 25%  | 50%  | 75%  | 100% |
|--+--+--+--+--|
| 0.02 | 0.28 | 0.49 | 0.78 | 0.98 |
#+CAPTION: Test replace results
| 0%   | 25%  | 50%  | 75%  | 100% |
|--+--+--+--+--|
| 0.01 | 0.21 | 0.44 | 0.76 | 1.00 |

I'm using Org-mode version 7.8.03 (release_7.8.03.546.gf6ea).

All the best,
Tom
-- 
Thomas S. Dye
http://www.tsdye.com




Re: [O] Problem with dates while generating HTML

2012-03-05 Thread Nick Dokos
François Pinard  wrote:

> 
> Given the following header contents:
> 
> * Problème date
> - [[file:2012-02-29.org::*Notes][2012-02-29]]
> - [[file:2012-02-29.org::*Notes][Du 2012-02-29]]
> 
> here is how it is shown in the Web browser after publishing:
> 
> 
> I added "Du " as a prefix to get going, but the ideal would be to
> directly use 2012-02-29 as the link description.  Is there a way, or is
> it a limitation (or a bug)?
> 

[2012-02-29] looks like an inactive date, as well as the description of
a link.  I presume the ambiguity causes this problem, so you somehow
have to disambiguate it.  Prefixing it with Du (or just about anything,
including a space) is one way to do that.

So a limitation certainly - a bug? Maybe, maybe not.

Nick




[O] Problem with dates while generating HTML

2012-03-05 Thread François Pinard

Given the following header contents:

--8<---cut here---start->8---
* Problème date
- [[file:2012-02-29.org::*Notes][2012-02-29]]
- [[file:2012-02-29.org::*Notes][Du 2012-02-29]]
--8<---cut here---end--->8---

here is how it is shown in the Web browser after publishing:

<>
I added "Du " as a prefix to get going, but the ideal would be to
directly use 2012-02-29 as the link description.  Is there a way, or is
it a limitation (or a bug)?

François


[O] Date-tree navigation question

2012-03-05 Thread Robert Horn
Is there a short simple key sequence that will take you to the last 
entry in a date-tree and open that headline?  Slightly better would be a 
way to go to the last, and open the last N headlines.  It could be 
generalized into "go to end of current item and open last N items of 
whatever depth" when applied to other outline forms.


I know how to do this with tabs and cursor movement to walk down the 
tree opening headlines as needed.  This requires more work and paying 
attention.


I have not found a simple way to do this.  Does one exist?

R Horn



Re: [O] Is it possible to run shell script src blocks as root or to export individual blocks?

2012-03-05 Thread Eric Schulte
Andreas Leha  writes:

> Eric Schulte  writes:
>
>> Leo Alekseyev  writes:
>>
>>> I was wondering if there was an easy way to execute some shell
>>> commands contained in a src block as root.  Alternatively, is there a
>>> quick way to export _just_ that one source block to a temp file so
>>> that I could run it as root manually?
>>>
>>
>> Just call org-babel-tangle with a prefix argument and it only tangles
>> the current block
>>
>>>
>
> Hi,
>
> I did not know this either.  Thanks for the hint!
>
> Shouldn't this be mentioned in the manual (14.4)?
>
> I have two questions/issues about this:
> (1) Can I get noweb-references to be expanded by this?  Or how would I
> tangle one block with noweb references expanded?

There was a conflict between the narrowing to a single code block caused
by the prefix argument, and the code which searches for replacements to
noweb elements.  I've just pushed up a fix so noweb elements should now
expand as normal.

> 
> (2) I am asked for a filename.  But the header argument :tangle somefile
> is overruling my input, which is un-expected.
>

This is now fixed as well.

Thanks,

>
> Regards,
> Andreas
>
>

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



Re: [O] Lieterate Programming for configuration settings

2012-03-05 Thread Eric Schulte
Hi Vladimir,

[...]
>
> At first, I thought about table in org file with three columns:
>
> | Keybind | Code | Description |
> |-+--+-|
>
> but I don't know how to exclude second column in html export and how
> to generate xml code excluding the third column.
>

See the attached example Org-mode file, it does what you describe above.

>
> P.P.S. Side note: why then 'tangled' example.txt the first line is empty one?

Set ":padline no" on the tangled block to change this behavior (as in
the attached example).

Best,



different-export-and-tangle.org
Description: test/org

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


[O] Including Latex Files

2012-03-05 Thread Markus Grebenstein

Dear List,

I have a question regarding the #+INCLUDE markup:

Using babel, I ran into trouble with latex equations and I do not have 
the time to sort things out (unbalance #+begin_latex...). Therefore, I 
decided to use auctex and latex files to edit the calculation parts of 
my thesis.


I know the "brute force" method of using \input etc. but I'd prefer to 
use the much better  #+INCLUDE markup, because I can open the file using 
C-C '. Using

#+INCLUDE: myfile.tex
orgmode assumes the file is in org syntax.

So I tried
#+INCLUDE: myfile.tex latex
and the files compiled fine but C-C ' does try to open a file called 
myfile.tex latex


Is there any chance to include a tex file in orgmode in a way that it 
can be opened interactively by using #+INCLUDE: or -even better- 
defining a link?



Markus




Re: [O] what's wrong with this sbe?

2012-03-05 Thread Eric Schulte
Myles English  writes:

> Hi,
>
> Please could tell me where I am going wrong with this?  I just can't get
> the source block to put a result in the table.
>
> #+name: workingDays
> #+BEGIN_SRC emacs-lisp :var hms="0"
> (require 'org-timer)
> (/ (org-timer-hms-to-secs hms) (* 60 60 8))
> #+END_SRC
>
> #+call: workingDays(hms="236:30:00")
>
> #+RESULTS: workingDays(hms="236:30:00")
> : 29
>
> | Days   | H:M:S |
> |+---|
> | #ERROR | 236:30:00 |
> #+TBLFM: @2$1='(sbe "workingDays" (hms @2$2))
>

Hi Miles,

To force the value of "236:30:00" to be interpreted as a string (rather
than have sbe try to convert it to a number prefix the reference with a
"$" character).  However even doing this your example exposed a bug in
this sbe functionality to which I've just pushed up a fix.  With the
latest version of Org-mode the attached works as expected.

#+name: workingDays
#+BEGIN_SRC emacs-lisp :var hms="0"
  (require 'org-timer)
  (/ (org-timer-hms-to-secs hms) (* 60 60 8))
#+END_SRC

Note the variable reference is prefixed with a "$" to ensure that it
is interpreted as a string.  See the `sbe' documentation for full
`sbe' usage information.

| Days | H:M:S |
|--+---|
|   29 | 236:30:00 |
#+TBLFM: @2$1='(sbe workingDays (hms $@2$2))

Cheers,

>
>
> Thanks,
>
> Myles
>

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


Re: [O] what's wrong with this sbe?

2012-03-05 Thread Myles English

Thanks Seb,

* TODO Fix the word wrapping in my emails   :gnus:
  

>> On Mon, 05 Mar 2012 15:09:49 +0100, Sebastien Vauban said:

  > Hi Myles, Myles English wrote:
  >> Please could tell me where I am going wrong with this?  I just
  >> can't get the source block to put a result in the table.
  >> 
  >> #+name: workingDays #+BEGIN_SRC emacs-lisp :var hms="0" (require
  >> 'org-timer) (/ (org-timer-hms-to-secs hms) (* 60 60 8)) #+END_SRC
  >> 
  >> #+call: workingDays(hms="236:30:00")
  >> 
  >> #+RESULTS: workingDays(hms="236:30:00") : 29
  >> 
  >> | Days | H:M:S | |+---| | #ERROR |
  >> 236:30:00 | #+TBLFM: @2$1='(sbe "workingDays" (hms @2$2))

  > This is because the string you send in the `sbe' call should be
  > (double-)quoted, as in:

  >   | Days | H:M:S | |--+-| | 29 |
  > "236:30:00" | #+TBLFM: @2$1='(sbe workingDays (hms @2$2))

  > This is really annoying for most cases, and dates back from a
  > problem to distinguish between references and strings, at some
  > point.

Yes it is quite annoying.  After your help I tried various combinations
of (quote),(print),(string),(number-to-string) and (concat), both in the
TBLFM line and in the source block but found that this is the only way
to get a slightly unsatisfactory result:

| Days | H:M:S | |
|--+---+-|
|   29 | 236:30:00 | "236:30:00" |
|  |   | |
#+TBLFM: @2$3='(print (concat "\"" @2$2 "\""))::@2$1='(sbe workingDays (hms 
@2$3))


  > I wonder whether this heavy constraint (strings must be enclosed)
  > still applies or not.

  > Best regards, Seb

  > PS- No need to quote the function name...

  > -- Sebastien Vauban

Thanks again,

Myles



[O] [bug] org-agenda-write does not handle date stamps without day of week

2012-03-05 Thread Karl Voit
Hi!

I verified the behavior below with the most current git version of
Org-mode.

Whenever I call my function to export the current agenda, it
«converts» events that do have a beginning and end time to events
that span the whole day (without begin and end times at all).

,[ my LISP command to export ]
| (defun vk-export-agenda()
|   "Exports monthly Org-mode agenda to agenda.ics file"
|   (interactive)
|   (org-agenda-list nil nil 60)
|   (org-agenda-write "~/org/agenda.ics")
| )
`

I traced down the problem to this:

* <2012-03-05 Mon 08:00-09:00> works fine
* <2012-03-05 Mon 8:00-9:00> works fine too

* <2012-03-05 08:00-09:00> Wrong: ends up as full day event

Unfortunately, I do have certain mechanisms that generate parts of
my Org-mode files where I skip the day of the week. Org-mode in
general is able to handle date stamps without day of week pretty
well. But whenever I export it to ics (in order to send it to
Google), I end up with a messed up online agenda.

I guess that org-agenda-write is the one to blame. It would be very
handy to me if somebody could fix that issue.

Let me know, if you need any further information!

Thank you very much!

-- 
Karl Voit




Re: [O] what's wrong with this sbe?

2012-03-05 Thread Sebastien Vauban
Hi Myles,

Myles English wrote:
> Please could tell me where I am going wrong with this?  I just can't get
> the source block to put a result in the table.
>
> #+name: workingDays
> #+BEGIN_SRC emacs-lisp :var hms="0"
> (require 'org-timer)
> (/ (org-timer-hms-to-secs hms) (* 60 60 8))
> #+END_SRC
>
> #+call: workingDays(hms="236:30:00")
>
> #+RESULTS: workingDays(hms="236:30:00")
> : 29
>
> | Days   | H:M:S |
> |+---|
> | #ERROR | 236:30:00 |
> #+TBLFM: @2$1='(sbe "workingDays" (hms @2$2))

This is because the string you send in the `sbe' call should be
(double-)quoted, as in:

  | Days | H:M:S   |
  |--+-|
  |   29 | "236:30:00" |
  #+TBLFM: @2$1='(sbe workingDays (hms @2$2))

This is really annoying for most cases, and dates back from a problem to
distinguish between references and strings, at some point.

I wonder whether this heavy constraint (strings must be enclosed) still
applies or not.

Best regards,
  Seb

PS- No need to quote the function name...

-- 
Sebastien Vauban




Re: [O] Export to multiple HTML files?

2012-03-05 Thread Christian Egli
Nicolas Goaziou  writes:

>> But is there such a function ready to use? I don't think so. 
>
> Ready to use, no. But since you can specify your own publishing
> function, it should be doable.

Actually if you use the mapping API[1] such a function should be fairly
easy to write.


Footnotes: 
[1]  http://orgmode.org/manual/Using-the-mapping-API.html#Using-the-mapping-API
-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland




[O] what's wrong with this sbe?

2012-03-05 Thread Myles English

Hi,

Please could tell me where I am going wrong with this?  I just can't get
the source block to put a result in the table.

#+name: workingDays
#+BEGIN_SRC emacs-lisp :var hms="0"
(require 'org-timer)
(/ (org-timer-hms-to-secs hms) (* 60 60 8))
#+END_SRC

#+call: workingDays(hms="236:30:00")

#+RESULTS: workingDays(hms="236:30:00")
: 29

| Days   | H:M:S |
|+---|
| #ERROR | 236:30:00 |
#+TBLFM: @2$1='(sbe "workingDays" (hms @2$2))


Thanks,

Myles



Re: [O] org-mode as an accountability system?

2012-03-05 Thread Darlan Cavalcante Moreira

Also, if you have anything in your agenda that you don't want to send to
him you can use tags to restrict what is shown in the agenda before you
copy/export it.

--
Darlan

At Sun, 4 Mar 2012 14:08:40 + (UTC),
Memnon Anon  wrote:
> 
> Hi Peter,
> 
> Peter Salazar  writes:
> 
> > My committed actions for a day consist of: 
> >    
> > a) TODOs for the projects I'm working on
> > b) random errands that need to be done that day
> > c) daily habits (e.g. meditating, exercising)
> >
> > I don't believe org-agenda can support me in doing this, because I
> > require: 
> >
> > a) a way to quickly enter the random tasks for that day (without
> > having to "schedule" each one for today)
> > b) more importantly: a way to record, store, and e-mail my list of
> > which tasks I've done and not done at the end of the night
> 
> I am not sure why you don't use the agenda, there really should be no
> need to compile this data manually.
> 
> Flow:
> - Enter your task with capture. This *is* a quick way, and you should be
>   able to setup a binding that schedules the new task to today by
>   default. Put the tasks wherever they should live in your org cosmos.
> - At the beginning of the day, start your agenda for today. 
>   Copy and paste it, export it to html, whatever. Send it to your
>   college.
> - Work through your tasks. If you can't finish a task, don't mark it
>   didnotdo, but simple reschedule it for tomorrow; the change will be
>   reflected in your log drawer.
> - At the end of the day, or early next day, start the agenda and use
>   org-agenda-log-mode, probably with C-u. 
> - `C-u l' should show you all there is, given it is properly configured:
>   Task you finished, tasks you did not finish and hence rescheduled for
>   later, even your sections (teaching, habits, random tasks) can be
>   reflected with categories. Just copy and paste it in your email and
>   you are done.
> 
> > Macro question: Is there a better way to manage my accountability
> > system, rather than doing it manually? Again, I don't see a way to do
> > it using agenda.
> 
> 
> hth
> 
> Memnon
> 
> 



[O] Beamer export - mille grazie!

2012-03-05 Thread James Harkins
You know, I had some hiccups when getting started with Beamer export (as could 
be expected when learning any substantial feature of pretty much any software), 
but now that I've got a halfway decent workflow going with it...

I LOVE IT!

This is saving me tons of time already, compared to:

- Writing the slide content
- Outline-formatting in open office impress
- Re-outline-formatting in org (for my archive)
- God-awful mouse-clicky formatting in impress
- Failing to synchronize edits between the presentation and the org archive

Mailing lists for software are full of complaints about things that aren't 
working or suggestions for improvement, so I wanted to take a minute to thank 
the people who worked on Beamer export for a spectacular tool (not to mention 
org in general -- my schedule is now complicated enough that I would be sunk 
without the calendar and to-do features).

THANK YOU GOOD FOLKS!

James


--
James Harkins /// dewdrop world
jamshar...@dewdrop-world.net
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman

blog: http://www.dewdrop-world.net/words
audio clips: http://www.dewdrop-world.net/audio
more audio: http://soundcloud.com/dewdrop_world/tracks



Re: [O] [dev] Implement "ref" link types

2012-03-05 Thread Jambunathan K

> On the Org side, when a link like [[something]] or [[something][text]]
> is encountered in a buffer, the search would go on like this:
>
>   1. Search any "<>" or "#+target: something"[1].

> 1. A link to an invisible target will be replaced with _nothing_
>(that's the point of being invisible).

What led you to come up with this interpretation? [3].

A target *reference* will *always* export and create a clickable link
irrespective how the target is *defined*.

Read on...

> [1] This is the replacement for invisible targets, since they cannot
> live in comments anymore.

I think there is an element of confusion about what invisible target is.
After some digging, I realize that they were originally called as
invisible anchors.  

The manual [1] has the following note:

,
|* Matt Lundin has proposed last-row references for table formulas
|  and named invisible anchors.
`

The original post [2] from Matt says
,
| # <>
| 
| should become
| 
| 
`

Now the question is what is invisible? The "description" in  
becomes invisible.  

Why was the term invisible chosen in the first place.  For this one has
to look at the the "default" behaviour for targets which is to export
with *both* the anchor name and anchor description.  

So, I think a correction is in order.

Footnotes:

[1] (info "(org) History and Acknowledgments")
[2] http://lists.gnu.org/archive/html/emacs-orgmode/2008-11/msg00327.html
[3] If I export the following unit test snippet, the produced output
from LaTeX/PDF has *just* "Paragraph" and nothing else.

,
| Paragraph.
| #+TARGET: Test
| [[Test]]
`
-- 



Re: [O] babel, executing code in background process

2012-03-05 Thread Yu
 Hello!

The trick would be in setting up the post-execution code block handling
> (namely results parsing and insertion) to run after external evaluation
> has completed.

I don't think this is a high priority necessarily. When executing e.g.
gnuplot or octave source code blocks for the sake of plotting, I'm usually
interested in runtime feedback more than collecting the text afterwards.
When doing notebook-Style work, also something like

  : #+begin_src octave :session *foo* :results silent
<>
  :   <>
  : #+end_src
  : #+begin_src octave :session *foo* :results value <>
  :<>
  : #+end_src

would be possible, though of course no convenient solution. My current
solution for long-running octave scripts isn't any more convenient though:
Define the task as functions and then switch to the session buffer manually
and run those interactively.

kind regards, Yu


2012/3/2 Eric Schulte 

> Erik Garrison  writes:
>
> > Hi Eric,
> >
> > Thanks for the background.  It looks like ob-screen may be very limited
> in
> > that it doesn't
> >
> > It seems to me that a decent method would behave similarly to the way to
> > "M-x compile" works--- another buffer opens in which the compilation
> > progresses.  Is there any reason why this might not be applicable to the
> > way babel works?
> >
>
> The approach you describe above (a process buffer with a filter) would
> be one viable approach, perhaps even something as simple as using
> `async-shell-command' would be workable.  One place to start looking
> would be in ob-eval.el for external evaluation and ob-comint for session
> based evaluation.
>
> The trick would be in setting up the post-execution code block handling
> (namely results parsing and insertion) to run after external evaluation
> has completed.
>
> If anyone wants to look into the code and write/propose a way forward
> I'm happy to help in any way I can.
>
> Cheers,
>
> >
> > Erik
> >
> > On Wed, Feb 29, 2012 at 5:55 PM, Eric Schulte 
> wrote:
> >
> >> Hi Erik,
> >>
> >> Currently there is not (to my knowledge) any support for asynchronous
> >> code block evaluation.  The one possible exception could be ob-screen
> >> which I mention only because I don't really know anything about it.
> >>
> >> This would certainly be a worthwhile feature to add to Org-mode code
> >> blocks, however a good implementation (easy to use, robust and
> >> cross-language) will be non-trivial to implement.
> >>
> >> Best,
> >>
> >> Erik Garrison  writes:
> >>
> >> > Hi,
> >> >
> >> > I'm just starting to use org-mode and babel to structure exploratory
> data
> >> > analysis which I do for my work.
> >> >
> >> > One issue that I've run into is that many of the queries I have to
> issue
> >> > will take a very long time to complete.
> >> >
> >> > Is there any method I could use to execute them in a background
> process?
> >> >
> >> > Thanks,
> >> > Erik
> >>
> >> --
> >> Eric Schulte
> >> http://cs.unm.edu/~eschulte/
> >>
>
> --
> Eric Schulte
> http://cs.unm.edu/~eschulte/
>
>


[O] Lieterate Programming for configuration settings

2012-03-05 Thread Vladimir Lomov
Hello,

- 8< -

#+TITLE: Literate Programming for configuration settings
#+AUTHOR: Vladimir Lomov
#+OPTIONS: toc:nil

* Literate Programming

I'm trying to use the Literate Programming to describe my set up of
Openbox and my workflow with Linux.

The main problem is with Openbox. I set up convenient (for me)
keybindings, like "W-x f k" to launch Krusader file manager, and now I
want to describe all my keybindings.

I see this as follow: from one source I get Org table (keybind and
description) and xml code (to be included into ~rc.xml~ using noweb).

At first, I thought about table in org file with three columns:

| Keybind | Code | Description |
|-+--+-|

but I don't know how to exclude second column in html export and how
to generate xml code excluding the third column.

So I decided to use plain txt files with the same information.

My question is: how to get table in html export and xml file with
code?

I wrote two shell scripts, first gives org table from txt file, the
second generates xml code from the same txt file, but can't figure out
how to use them with org.

(My next step would be to put both: plain txt file content and shell
script code into one org file, if my idea would work.)

** Example

Below is example of plain text file. I don't need ~example.txt~
except for shell script to generate org table and xml code, if it is
possible to get both without extracting text file it would be great.

#+name: example.txt
#+begin_src text :exports none :tangle example.txt
"Alt-F2"'gmrun'  
"Run gmrun, very useful tool"
"Alt-F4"''"Close application window"
"Alt-F9"''  "Iconify to task bar"
"Alt-Tab"   ''   "Switch focus to next window"
"Alt-S-Tab" ''   "Switch focus to 
previous window"
"Alt-space" 'client-menu' "Show 
application window menu"
#+end_src

This shell script used standalone gives correct org table. I also
don't need it except it generates org table.

#+name: txt2org-table
#+begin_src sh :exports none
#!/bin/bash

###
# Read a txt file and write to stdout it as Org table.
###

_data="$1"

###
# Each line has three fields: keystroke, xml code and description. For table 
the 1 and 3 are needed.
###

echo "|  Keybind   | Description  |"
echo "++--|"
while IFS=' ' read -r kb code descr
do
  [[ ${kb} = \#* ]] && continue
  echo "| ${kb//\"/~} | ${descr//\"} |"
done < "${_data}"
echo "++--|"

exit 0
#+end_src

** My real goal

Ideally I want to have a table (like <>) in org file, when
I export org file to html there must be table with "Keybind" and
"Description" and the same org file should generate ~rc.xml~ (I assume
it is possible to insert results of script run in place of <>).

---
Thanks in advance, Vladimir Lomov

P.S. Sorry if I description were to obscure.

P.P.S. Side note: why then 'tangled' example.txt the first line is empty one?

-- 
 I hate users
 you sound like a sysadmin already!