emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Gnuplot unevenly spaced non-numeric data plot?
@ 2010-08-21 19:30 John Hendy
  2010-08-21 20:35 ` Eric S Fraga
  2010-08-21 20:41 ` Nick Dokos
  0 siblings, 2 replies; 217+ messages in thread
From: John Hendy @ 2010-08-21 19:30 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 788 bytes --]

Hi,


I'm interested in plotting with non-numeric data for the x component of the
data points but don't want to have the gnuplot default of automatic spacing.
Does anyone know a way to have a word displayed instead of a number but have
the words unevenly spaced according to a "hidden value"?

Example:

| 1 | x: where it should be on the scale |  y |
|---+------------------------------------+----|
| a |                                  0 | 10 |
| b |                                 10 | 20 |
| c |                                 11 | 30 |
| d |                                 40 | 40 |

Does that make sense? If I just had the table minus the 2nd column, it would
space a->d evenly as if they were 0,1,2,3 or something like that. I'd like
control over their spacing.


Thanks,
John

[-- Attachment #1.2: Type: text/html, Size: 1041 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Gnuplot unevenly spaced non-numeric data plot?
  2010-08-21 19:30 Gnuplot unevenly spaced non-numeric data plot? John Hendy
@ 2010-08-21 20:35 ` Eric S Fraga
  2010-08-21 20:41 ` Nick Dokos
  1 sibling, 0 replies; 217+ messages in thread
From: Eric S Fraga @ 2010-08-21 20:35 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]

On Sat, 21 Aug 2010 14:30:48 -0500, John Hendy <jw.hendy@gmail.com> wrote:
> 
> [1  <multipart/alternative (7bit)>]
> [1.1  <text/plain; ISO-8859-1 (7bit)>]
> Hi,
> 
> 
> I'm interested in plotting with non-numeric data for the x component of the
> data points but don't want to have the gnuplot default of automatic spacing.
> Does anyone know a way to have a word displayed instead of a number but have
> the words unevenly spaced according to a "hidden value"?
> 
> Example:
> 
> | 1 | x: where it should be on the scale |  y |
> |---+------------------------------------+----|
> | a |                                  0 | 10 |
> | b |                                 10 | 20 |
> | c |                                 11 | 30 |
> | d |                                 40 | 40 |
> 
> Does that make sense? If I just had the table minus the 2nd column, it would
> space a->d evenly as if they were 0,1,2,3 or something like that. I'd like
> control over their spacing.

It does make sense and gnuplot supports this perfectly fine. From the
gnuplot info manual (commands > set-show > xtics), an example is:

: set xtics ("low" 0, "medium" 50, "high" 100)

however, how to get this from org into gnuplot is something I cannot
help with.  Sorry.  Maybe babel is the way to go but I wouldn't have a
clue where to start...

[-- Attachment #2: Type: text/plain, Size: 75 bytes --]

-- 
Eric S Fraga
GnuPG: 8F5C 279D 3907 E14A 5C29  570D C891 93D8 FFFC F67D

[-- Attachment #3: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Gnuplot unevenly spaced non-numeric data plot?
  2010-08-21 19:30 Gnuplot unevenly spaced non-numeric data plot? John Hendy
  2010-08-21 20:35 ` Eric S Fraga
@ 2010-08-21 20:41 ` Nick Dokos
  2010-08-21 21:11   ` John Hendy
  1 sibling, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2010-08-21 20:41 UTC (permalink / raw)
  To: John Hendy; +Cc: nicholas.dokos, emacs-orgmode

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

> Hi,
> 
> I'm interested in plotting with non-numeric data for the x component of the data points but don't want to have the gnuplot default of automatic spacing.
> Does anyone know a way to have a word displayed instead of a number but have the words unevenly spaced according to a "hidden value"?
> 
> Example:
> 
> | 1 | x: where it should be on the scale |  y |
> |---+------------------------------------+----|
> | a |                                  0 | 10 |
> | b |                                 10 | 20 |
> | c |                                 11 | 30 |
> | d |                                 40 | 40 |
> 
> Does that make sense? If I just had the table minus the 2nd column, it would space a->d evenly as if they were 0,1,2,3 or something like that. I'd like
> control over their spacing.

Gnuplot can certainly do it, but whether you can convince org-plot/gnuplot
to emit the right incantation, I don't know.

Try the following in gnuplot

        plot 'foo.data' using 2:3:xticlabels(1)

with the data file containing

,----
| a                                  0  10 
| b                                 10  20 
| c                                 11  30 
| d                                 40  40 
`----

HTH,
Nick

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

* Re: Gnuplot unevenly spaced non-numeric data plot?
  2010-08-21 20:41 ` Nick Dokos
@ 2010-08-21 21:11   ` John Hendy
  2010-08-21 22:41     ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2010-08-21 21:11 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1812 bytes --]

Nick,

That works from gnuplot. Not sure about orgmode... I tried

#+PLOT: using:"2:3:xticlabels(1)"

which is not working. There's no "using" option mentioned on worg:
http://orgmode.org/worg/org-tutorials/org-plot.php

<http://orgmode.org/worg/org-tutorials/org-plot.php>Perhaps it's not
possible?

I could try the org-babel method but there seems to be less documentation on
this?

John

On Sat, Aug 21, 2010 at 3:41 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> John Hendy <jw.hendy@gmail.com> wrote:
>
> > Hi,
> >
> > I'm interested in plotting with non-numeric data for the x component of
> the data points but don't want to have the gnuplot default of automatic
> spacing.
> > Does anyone know a way to have a word displayed instead of a number but
> have the words unevenly spaced according to a "hidden value"?
> >
> > Example:
> >
> > | 1 | x: where it should be on the scale |  y |
> > |---+------------------------------------+----|
> > | a |                                  0 | 10 |
> > | b |                                 10 | 20 |
> > | c |                                 11 | 30 |
> > | d |                                 40 | 40 |
> >
> > Does that make sense? If I just had the table minus the 2nd column, it
> would space a->d evenly as if they were 0,1,2,3 or something like that. I'd
> like
> > control over their spacing.
>
> Gnuplot can certainly do it, but whether you can convince org-plot/gnuplot
> to emit the right incantation, I don't know.
>
> Try the following in gnuplot
>
>        plot 'foo.data' using 2:3:xticlabels(1)
>
> with the data file containing
>
> ,----
> | a                                  0  10
> | b                                 10  20
> | c                                 11  30
> | d                                 40  40
> `----
>
> HTH,
> Nick
>

[-- Attachment #1.2: Type: text/html, Size: 2656 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Gnuplot unevenly spaced non-numeric data plot?
  2010-08-21 21:11   ` John Hendy
@ 2010-08-21 22:41     ` John Hendy
  2010-08-21 23:17       ` Nick Dokos
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2010-08-21 22:41 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2140 bytes --]

Problem solved with babel. I was able to get everything I wanted by piecing
together some examples from the mailing list and gnuplot examples/manual
around the web.

Thanks!


On Sat, Aug 21, 2010 at 4:11 PM, John Hendy <jw.hendy@gmail.com> wrote:

> Nick,
>
> That works from gnuplot. Not sure about orgmode... I tried
>
> #+PLOT: using:"2:3:xticlabels(1)"
>
> which is not working. There's no "using" option mentioned on worg:
> http://orgmode.org/worg/org-tutorials/org-plot.php
>
> <http://orgmode.org/worg/org-tutorials/org-plot.php>Perhaps it's not
> possible?
>
> I could try the org-babel method but there seems to be less documentation
> on this?
>
> John
>
>
> On Sat, Aug 21, 2010 at 3:41 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>
>> John Hendy <jw.hendy@gmail.com> wrote:
>>
>> > Hi,
>> >
>> > I'm interested in plotting with non-numeric data for the x component of
>> the data points but don't want to have the gnuplot default of automatic
>> spacing.
>> > Does anyone know a way to have a word displayed instead of a number but
>> have the words unevenly spaced according to a "hidden value"?
>> >
>> > Example:
>> >
>> > | 1 | x: where it should be on the scale |  y |
>> > |---+------------------------------------+----|
>> > | a |                                  0 | 10 |
>> > | b |                                 10 | 20 |
>> > | c |                                 11 | 30 |
>> > | d |                                 40 | 40 |
>> >
>> > Does that make sense? If I just had the table minus the 2nd column, it
>> would space a->d evenly as if they were 0,1,2,3 or something like that. I'd
>> like
>> > control over their spacing.
>>
>> Gnuplot can certainly do it, but whether you can convince org-plot/gnuplot
>> to emit the right incantation, I don't know.
>>
>> Try the following in gnuplot
>>
>>        plot 'foo.data' using 2:3:xticlabels(1)
>>
>> with the data file containing
>>
>> ,----
>> | a                                  0  10
>> | b                                 10  20
>> | c                                 11  30
>> | d                                 40  40
>> `----
>>
>> HTH,
>> Nick
>>
>
>

[-- Attachment #1.2: Type: text/html, Size: 3293 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Gnuplot unevenly spaced non-numeric data plot?
  2010-08-21 22:41     ` John Hendy
@ 2010-08-21 23:17       ` Nick Dokos
  2010-08-23 14:22         ` John Hendy
       [not found]         ` <jw.hendy@gmail.com>
  0 siblings, 2 replies; 217+ messages in thread
From: Nick Dokos @ 2010-08-21 23:17 UTC (permalink / raw)
  To: John Hendy; +Cc: nicholas.dokos, emacs-orgmode

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

> Problem solved with babel. I was able to get everything I wanted by
> piecing together some examples from the mailing list and gnuplot
> examples/manual around the web.
> 

Good! Maybe you should post the babel solution for future reference.
Here is an org-plot solution for future reference: there is a script
option that allows you to use an arbitrary gnuplot script.  The org
manual (http://orgmode.org/manual/Org_002dPlot.html#Org-Plot) describes
it very well:

,----
| script If you want total control, you can specify a script file (place
|        the file name between double-quotes) which will be used to
|        plot. Before plotting, every instance of $datafile in the
|        specified script will be replaced with the path to the generated
|        data file. Note: even if you set this option, you may still want
|        to specify the plot type, as that can impact the content of the
|        data file.
`----

foo.org:
--8<---------------cut here---------------start------------->8---
#+plot:  type:2d script:"myscript.gp"
| 1 | x: where it should be on the scale | y  |
|---+------------------------------------+----|
| a |                                  0 | 10 |
| b |                                 10 | 20 |
| c |                                 11 | 30 |
| d |                                 40 | 40 |
--8<---------------cut here---------------end--------------->8---

myscript.gp:
--8<---------------cut here---------------start------------->8---
plot '$datafile' using 2:3:xticlabels(1)
--8<---------------cut here---------------end--------------->8---

Nick

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

* Re: Gnuplot unevenly spaced non-numeric data plot?
  2010-08-21 23:17       ` Nick Dokos
@ 2010-08-23 14:22         ` John Hendy
  2010-08-23 15:16           ` Nick Dokos
       [not found]         ` <jw.hendy@gmail.com>
  1 sibling, 1 reply; 217+ messages in thread
From: John Hendy @ 2010-08-23 14:22 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1828 bytes --]

Sounds good. Where would I post the solution?

On Sat, Aug 21, 2010 at 6:17 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> John Hendy <jw.hendy@gmail.com> wrote:
>
> > Problem solved with babel. I was able to get everything I wanted by
> > piecing together some examples from the mailing list and gnuplot
> > examples/manual around the web.
> >
>
> Good! Maybe you should post the babel solution for future reference.
> Here is an org-plot solution for future reference: there is a script
> option that allows you to use an arbitrary gnuplot script.  The org
> manual (http://orgmode.org/manual/Org_002dPlot.html#Org-Plot) describes
> it very well:
>
> ,----
> | script If you want total control, you can specify a script file (place
> |        the file name between double-quotes) which will be used to
> |        plot. Before plotting, every instance of $datafile in the
> |        specified script will be replaced with the path to the generated
> |        data file. Note: even if you set this option, you may still want
> |        to specify the plot type, as that can impact the content of the
> |        data file.
> `----
>
> foo.org:
> --8<---------------cut here---------------start------------->8---
> #+plot:  type:2d script:"myscript.gp"
> | 1 | x: where it should be on the scale | y  |
> |---+------------------------------------+----|
> | a |                                  0 | 10 |
> | b |                                 10 | 20 |
> | c |                                 11 | 30 |
> | d |                                 40 | 40 |
> --8<---------------cut here---------------end--------------->8---
>
> myscript.gp:
> --8<---------------cut here---------------start------------->8---
> plot '$datafile' using 2:3:xticlabels(1)
> --8<---------------cut here---------------end--------------->8---
>
> Nick
>

[-- Attachment #1.2: Type: text/html, Size: 2608 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Gnuplot unevenly spaced non-numeric data plot?
  2010-08-23 14:22         ` John Hendy
@ 2010-08-23 15:16           ` Nick Dokos
       [not found]             ` <AANLkTi=WTLBL1Giq0GTrjCo-A1s=iP4u1Qxn57cH-xnB@mail.gmail.com>
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2010-08-23 15:16 UTC (permalink / raw)
  To: John Hendy; +Cc: nicholas.dokos, emacs-orgmode

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

> Sounds good. Where would I post the solution?
> 

I think the list is the proper place: if the question comes up again,
then it can be added to Worg.

Cheers,
Nick

> On Sat, Aug 21, 2010 at 6:17 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> 
>     John Hendy <jw.hendy@gmail.com> wrote:
>    
>     > Problem solved with babel. I was able to get everything I wanted by
>     > piecing together some examples from the mailing list and gnuplot
>     > examples/manual around the web.
>     >
>    
>     Good! Maybe you should post the babel solution for future reference.
>     Here is an org-plot solution for future reference: there is a script
>     option that allows you to use an arbitrary gnuplot script.  The org
>     manual (http://orgmode.org/manual/Org_002dPlot.html#Org-Plot) describes
>     it very well:
>    
>     ,----
>     | script If you want total control, you can specify a script file (place
>     |        the file name between double-quotes) which will be used to
>     |        plot. Before plotting, every instance of $datafile in the
>     |        specified script will be replaced with the path to the generated
>     |        data file. Note: even if you set this option, you may still want
>     |        to specify the plot type, as that can impact the content of the
>     |        data file.
>     `----
>    
>     foo.org:
>     --8<---------------cut here---------------start------------->8---
>     #+plot:  type:2d script:"myscript.gp"
>     | 1 | x: where it should be on the scale | y  |
>     |---+------------------------------------+----|
>     | a |                                  0 | 10 |
>     | b |                                 10 | 20 |
>     | c |                                 11 | 30 |
>     | d |                                 40 | 40 |
>     --8<---------------cut here---------------end--------------->8---
>    
>     myscript.gp:
>     --8<---------------cut here---------------start------------->8---
>     plot '$datafile' using 2:3:xticlabels(1)
>     --8<---------------cut here---------------end--------------->8---
>    
>     Nick
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [For Worg?] Gnuplot unevenly spaced non-numeric data plot?
       [not found]               ` <AANLkTimSVm=-2o39CQ9wSMT276Dee4Tuj9jLKJH-c+cd@mail.gmail.com>
@ 2010-08-24  2:44                 ` John Hendy
  2010-08-24  5:25                   ` suvayu ali
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2010-08-24  2:44 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 4590 bytes --]

Okay, bounced attempts with both .zip and tar. We'll try this instead... the
"attached file" mentioned below is here:

https://sites.google.com/site/jwhendytank/home/org-gnuplot-writeup.zip

-----

> Sorry if this is a duplicate. My first attempt failed, perhaps due to the
attached .zip? I'm trying .tar this time.

>
-----

> Alright Nick, careful what you wish for :) For anyone else who could use
this or do something with it:

>
- Over the weekend I figured out a bunch of stuff with gnuplot

> - I modified what I found to make it generic and wrote it up in an org file

> - The org file, resultant pics (eps), converted pngs, and exported html/pdf
are in the attached .zip *[edit: .tar] [edit: see link above]*

>

Let me know if this can be useful for worg. There's really nothing new that
can't be found, but it's tricky if you don't know what you're looking for.
The attached is the result of lots of digging on my part and some excellent
help from the mailing list. Included are gnuplot methods for:

>
- Setting axis titles with the #+PLOT method

> - Getting better image quality via eps -> png from a previous mailing list
discussion (thanks Eric & Eric)

> - The use of the 'reset' command when using multiple gnuplot babel blocks
in the same file

> - Unevenly spaced names x-tics

> - Multiple x-axis scales on the same graph

> - Broken axis example from gnuplot-tricks

>
Again, this info exists elsewhere, but this might be very nice to have on
worg. Perhaps this would serve as a nice primer for the beginner? I
footnoted everywhere I could to the original sources of my information
(mostly the mailing list and gnuplot-tricks blog).

>
Let me know if I can be of assistance with any edits if this is actually
worg-candidate material. I have no idea what the standards are or how this
works.

>

Thanks for all the help!

> John

>
>>
>> On Mon, Aug 23, 2010 at 10:16 AM, Nick Dokos <nicholas.dokos@hp.com>wrote:
>>
>>> John Hendy <jw.hendy@gmail.com> wrote:
>>>
>>> > Sounds good. Where would I post the solution?  CLOSED: [2010-08-22 Sun
>>> 15:44]
>>> >
>>>
>>> I think the list is the proper place: if the question comes up again,
>>> then it can be added to Worg.
>>>
>>> Cheers,
>>> Nick
>>>
>>> > On Sat, Aug 21, 2010 at 6:17 PM, Nick Dokos <nicholas.dokos@hp.com>
>>> wrote:
>>> >
>>> >     John Hendy <jw.hendy@gmail.com> wrote:
>>> >
>>> >     > Problem solved with babel. I was able to get everything I wanted
>>> by
>>> >     > piecing together some examples from the mailing list and gnuplot
>>> >     > examples/manual around the web.
>>> >     >
>>> >
>>> >     Good! Maybe you should post the babel solution for future
>>> reference.
>>> >     Here is an org-plot solution for future reference: there is a
>>> script
>>> >     option that allows you to use an arbitrary gnuplot script.  The org
>>> >     manual (http://orgmode.org/manual/Org_002dPlot.html#Org-Plot)
>>> describes
>>> >     it very well:
>>> >
>>> >     ,----
>>> >     | script If you want total control, you can specify a script file
>>> (place
>>> >     |        the file name between double-quotes) which will be used to
>>> >     |        plot. Before plotting, every instance of $datafile in the
>>> >     |        specified script will be replaced with the path to the
>>> generated
>>> >     |        data file. Note: even if you set this option, you may
>>> still want
>>> >     |        to specify the plot type, as that can impact the content
>>> of the
>>> >     |        data file.
>>> >     `----
>>> >
>>> >     foo.org:
>>> >     --8<---------------cut here---------------start------------->8---
>>> >     #+plot:  type:2d script:"myscript.gp"
>>> >     | 1 | x: where it should be on the scale | y  |
>>> >     |---+------------------------------------+----|
>>> >     | a |                                  0 | 10 |
>>> >     | b |                                 10 | 20 |
>>> >     | c |                                 11 | 30 |
>>> >     | d |                                 40 | 40 |
>>> >     --8<---------------cut here---------------end--------------->8---
>>> >
>>> >     myscript.gp:
>>> >     --8<---------------cut here---------------start------------->8---
>>> >     plot '$datafile' using 2:3:xticlabels(1)
>>> >     --8<---------------cut here---------------end--------------->8---
>>> >
>>> >     Nick
>>> >
>>> > _______________________________________________
>>> > Emacs-orgmode mailing list
>>> > Please use `Reply All' to send replies to the list.
>>> > Emacs-orgmode@gnu.org
>>> > http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>>
>>
>>
>

[-- Attachment #1.2: Type: text/html, Size: 11859 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [For Worg?] Gnuplot unevenly spaced non-numeric data plot?
  2010-08-24  2:44                 ` [For Worg?] " John Hendy
@ 2010-08-24  5:25                   ` suvayu ali
  0 siblings, 0 replies; 217+ messages in thread
From: suvayu ali @ 2010-08-24  5:25 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

Too good for words! Great work. :)

On 23 August 2010 19:44, John Hendy <jw.hendy@gmail.com> wrote:
> Okay, bounced attempts with both .zip and tar. We'll try this instead... the
> "attached file" mentioned below is here:
> https://sites.google.com/site/jwhendytank/home/org-gnuplot-writeup.zip
> -----
>
> Sorry if this is a duplicate. My first attempt failed, perhaps due to the
> attached .zip? I'm trying .tar this time.
>
> -----
>
> Alright Nick, careful what you wish for :) For anyone else who could use
> this or do something with it:
>
> - Over the weekend I figured out a bunch of stuff with gnuplot
>
> - I modified what I found to make it generic and wrote it up in an org file
>
> - The org file, resultant pics (eps), converted pngs, and exported html/pdf
> are in the attached .zip [edit: .tar] [edit: see link above]
>
>
> Let me know if this can be useful for worg. There's really nothing new that
> can't be found, but it's tricky if you don't know what you're looking for.
> The attached is the result of lots of digging on my part and some excellent
> help from the mailing list. Included are gnuplot methods for:
>
> - Setting axis titles with the #+PLOT method
>
> - Getting better image quality via eps -> png from a previous mailing list
> discussion (thanks Eric & Eric)
>
> - The use of the 'reset' command when using multiple gnuplot babel blocks in
> the same file
>
> - Unevenly spaced names x-tics
>
> - Multiple x-axis scales on the same graph
>
> - Broken axis example from gnuplot-tricks
>
> Again, this info exists elsewhere, but this might be very nice to have on
> worg. Perhaps this would serve as a nice primer for the beginner? I
> footnoted everywhere I could to the original sources of my information
> (mostly the mailing list and gnuplot-tricks blog).
>
> Let me know if I can be of assistance with any edits if this is actually
> worg-candidate material. I have no idea what the standards are or how this
> works.
>
>
> Thanks for all the help!
>
> John
>>>
>>>
>>> On Mon, Aug 23, 2010 at 10:16 AM, Nick Dokos <nicholas.dokos@hp.com>
>>> wrote:
>>>>
>>>> John Hendy <jw.hendy@gmail.com> wrote:
>>>>
>>>> > Sounds good. Where would I post the solution?  CLOSED: [2010-08-22 Sun
>>>> > 15:44]
>>>> >
>>>>
>>>> I think the list is the proper place: if the question comes up again,
>>>> then it can be added to Worg.
>>>>
>>>> Cheers,
>>>> Nick
>>>>
>>>> > On Sat, Aug 21, 2010 at 6:17 PM, Nick Dokos <nicholas.dokos@hp.com>
>>>> > wrote:
>>>> >
>>>> >     John Hendy <jw.hendy@gmail.com> wrote:
>>>> >
>>>> >     > Problem solved with babel. I was able to get everything I wanted
>>>> > by
>>>> >     > piecing together some examples from the mailing list and gnuplot
>>>> >     > examples/manual around the web.
>>>> >     >
>>>> >
>>>> >     Good! Maybe you should post the babel solution for future
>>>> > reference.
>>>> >     Here is an org-plot solution for future reference: there is a
>>>> > script
>>>> >     option that allows you to use an arbitrary gnuplot script.  The
>>>> > org
>>>> >     manual (http://orgmode.org/manual/Org_002dPlot.html#Org-Plot)
>>>> > describes
>>>> >     it very well:
>>>> >
>>>> >     ,----
>>>> >     | script If you want total control, you can specify a script file
>>>> > (place
>>>> >     |        the file name between double-quotes) which will be used
>>>> > to
>>>> >     |        plot. Before plotting, every instance of $datafile in the
>>>> >     |        specified script will be replaced with the path to the
>>>> > generated
>>>> >     |        data file. Note: even if you set this option, you may
>>>> > still want
>>>> >     |        to specify the plot type, as that can impact the content
>>>> > of the
>>>> >     |        data file.
>>>> >     `----
>>>> >
>>>> >     foo.org:
>>>> >     --8<---------------cut here---------------start------------->8---
>>>> >     #+plot:  type:2d script:"myscript.gp"
>>>> >     | 1 | x: where it should be on the scale | y  |
>>>> >     |---+------------------------------------+----|
>>>> >     | a |                                  0 | 10 |
>>>> >     | b |                                 10 | 20 |
>>>> >     | c |                                 11 | 30 |
>>>> >     | d |                                 40 | 40 |
>>>> >     --8<---------------cut here---------------end--------------->8---
>>>> >
>>>> >     myscript.gp:
>>>> >     --8<---------------cut here---------------start------------->8---
>>>> >     plot '$datafile' using 2:3:xticlabels(1)
>>>> >     --8<---------------cut here---------------end--------------->8---
>>>> >
>>>> >     Nick
>>>> >
>>>> > _______________________________________________
>>>> > Emacs-orgmode mailing list
>>>> > Please use `Reply All' to send replies to the list.
>>>> > Emacs-orgmode@gnu.org
>>>> > http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>>
>>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>



-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: [For Worg?] Gnuplot unevenly spaced non-numeric data plot?
       [not found]             ` <AANLkTi=WTLBL1Giq0GTrjCo-A1s=iP4u1Qxn57cH-xnB@mail.gmail.com>
       [not found]               ` <AANLkTimSVm=-2o39CQ9wSMT276Dee4Tuj9jLKJH-c+cd@mail.gmail.com>
@ 2010-08-24  5:56               ` Nick Dokos
  2010-08-25  0:32                 ` Eric Schulte
  1 sibling, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2010-08-24  5:56 UTC (permalink / raw)
  To: John Hendy; +Cc: nicholas.dokos, emacs-orgmode

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

> Alright Nick, careful what you wish for :) For anyone else who could use this or do something with it:
> 
> - Over the weekend I figured out a bunch of stuff with gnuplot
> - I modified what I found to make it generic and wrote it up in an org file
> - The org file, resultant pics (eps), converted pngs, and exported html/pdf are in the attached .zip
> 

I haven't read it in complete detail yet, but so far it looks very nice.
Much more extensive and detailed than I expected (that's a Good Thing!)

> Let me know if this can be useful for worg.

I think so.

Thanks!
Nick

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

* Re: [For Worg?] Gnuplot unevenly spaced non-numeric data plot?
  2010-08-24  5:56               ` Nick Dokos
@ 2010-08-25  0:32                 ` Eric Schulte
  2010-08-25  1:06                   ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: Eric Schulte @ 2010-08-25  0:32 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

Hi John,

Nick Dokos <nicholas.dokos@hp.com> writes:

> John Hendy <jw.hendy@gmail.com> wrote:
>
>> Alright Nick, careful what you wish for :) For anyone else who could use this or do something with it:
>> 
>> - Over the weekend I figured out a bunch of stuff with gnuplot
>> - I modified what I found to make it generic and wrote it up in an org file
>> - The org file, resultant pics (eps), converted pngs, and exported html/pdf are in the attached .zip
>> 
>
> I haven't read it in complete detail yet, but so far it looks very nice.
> Much more extensive and detailed than I expected (that's a Good Thing!)
>
>> Let me know if this can be useful for worg.
>
> I think so.
>

I Certainly agree!

This does look like Worg material.  We're trying to beef up example
heavy language specific pages for each language supported by Babel.

This material you've compiled sounds like an ideal base for the gnuplot
page.  If you're willing/able to integrate this information into such a
Worg page that would be fantastic, and I'd be very happy to help, I've
just stubbed out the beginning of a gnuplot page on Worg which could
hold your compiled instructions and examples.

it should propagate to
http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-gnuplot.php
within the next two hours or so

Cheers -- Eric

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

* Re: [For Worg?] Gnuplot unevenly spaced non-numeric data plot?
  2010-08-25  0:32                 ` Eric Schulte
@ 2010-08-25  1:06                   ` John Hendy
  2010-08-25  1:35                     ` Eric Schulte
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2010-08-25  1:06 UTC (permalink / raw)
  To: Eric Schulte; +Cc: nicholas.dokos, emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1879 bytes --]

On Wed, Aug 25, 2010 at 12:32 AM, Eric Schulte <schulte.eric@gmail.com>wrote:

> Hi John,
>
> Nick Dokos <nicholas.dokos@hp.com> writes:
>
> > John Hendy <jw.hendy@gmail.com> wrote:
> >
> >> Alright Nick, careful what you wish for :) For anyone else who could use
> this or do something with it:
> >>
> >> - Over the weekend I figured out a bunch of stuff with gnuplot
> >> - I modified what I found to make it generic and wrote it up in an org
> file
> >> - The org file, resultant pics (eps), converted pngs, and exported
> html/pdf are in the attached .zip
> >>
> >
> > I haven't read it in complete detail yet, but so far it looks very nice.
> > Much more extensive and detailed than I expected (that's a Good Thing!)
> >
> >> Let me know if this can be useful for worg.
> >
> > I think so.
> >
>
> I Certainly agree!
>
> This does look like Worg material.  We're trying to beef up example
> heavy language specific pages for each language supported by Babel.
>
> This material you've compiled sounds like an ideal base for the gnuplot
> page.  If you're willing/able to integrate this information into such a
> Worg page that would be fantastic, and I'd be very happy to help, I've
> just stubbed out the beginning of a gnuplot page on Worg which could
> hold your compiled instructions and examples.
>
>
Cool -- I'm game. What exactly is required? Can my generated html just be
plopped in or should I revise anything? If there's an example page we're
modeling after I can rearrange the pieces to match that? I'm up for pretty
much anything. I'm glad it will make it to a useful place! I've no
familiarity with how to add to word so I'll definitely need some assistance.

I see the stub page, btw.


Best regards,
John


> it should propagate to
> http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-gnuplot.php
> within the next two hours or so
>
> Cheers -- Eric
>

[-- Attachment #1.2: Type: text/html, Size: 2807 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [For Worg?] Gnuplot unevenly spaced non-numeric data plot?
  2010-08-25  1:06                   ` John Hendy
@ 2010-08-25  1:35                     ` Eric Schulte
  2010-08-25 18:38                       ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: Eric Schulte @ 2010-08-25  1:35 UTC (permalink / raw)
  To: John Hendy; +Cc: nicholas.dokos, emacs-orgmode

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

[...]
> Cool -- I'm game.

That's Great.

> What exactly is required? Can my generated html just be plopped in or
> should I revise anything? If there's an example page we're modeling
> after I can rearrange the pieces to match that?

Whatever you think is best.  Other language pages are linked to from the
table at http://orgmode.org/worg/org-contrib/babel/languages.php#langs,
so they could serve as a model.

> I'm up for pretty much anything. I'm glad it will make it to a useful
> place! I've no familiarity with how to add to word so I'll definitely
> need some assistance.
>

Worg is a git repository of org-mode files which are exported to html to
generate the resulting Worg web page.  To contribute you clone the git
repository, edit the org-mode files, and commit your changes.  See
http://orgmode.org/worg/worg-about.php for more information about Worg,
and specific instructions about how to contribute.

>
> I see the stub page, btw.
>

Wonderful.

Thanks -- Eric

>
>
> Best regards,
> John
>
>
>> it should propagate to
>> http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-gnuplot.php
>> within the next two hours or so
>>
>> Cheers -- Eric
>>

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

* Re: [For Worg?] Gnuplot unevenly spaced non-numeric data plot?
  2010-08-25  1:35                     ` Eric Schulte
@ 2010-08-25 18:38                       ` John Hendy
  2010-08-25 18:52                         ` Eric Schulte
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2010-08-25 18:38 UTC (permalink / raw)
  To: Eric Schulte; +Cc: nicholas.dokos, emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1853 bytes --]

On Tue, Aug 24, 2010 at 8:35 PM, Eric Schulte <schulte.eric@gmail.com>wrote:

> John Hendy <jw.hendy@gmail.com> writes:
>
> [...]
> > Cool -- I'm game.
>
> That's Great.
>
> > What exactly is required? Can my generated html just be plopped in or
> > should I revise anything? If there's an example page we're modeling
> > after I can rearrange the pieces to match that?
>
> Whatever you think is best.  Other language pages are linked to from the
> table at http://orgmode.org/worg/org-contrib/babel/languages.php#langs,
> so they could serve as a model.
>
> > I'm up for pretty much anything. I'm glad it will make it to a useful
> > place! I've no familiarity with how to add to word so I'll definitely
> > need some assistance.
> >
>
> Worg is a git repository of org-mode files which are exported to html to
> generate the resulting Worg web page.  To contribute you clone the git
> repository, edit the org-mode files, and commit your changes.  See
> http://orgmode.org/worg/worg-about.php for more information about Worg,
> and specific instructions about how to contribute.
>
>
Thanks -- waiting for push access after registering at the cz git repo. I'll
check some of the other language pages and try to model it after that --
both in tone and organization. It shouldn't take much to tweak it.

I'll post back if I have further questions. I kind of anticipate them. For
instance, how do I include my .png files? Do I need to put them on some
other personal server (google doc/site) and have them link to those? Or is
there a Worg pic repository?


John


> >
> > I see the stub page, btw.
> >
>
> Wonderful.
>
> Thanks -- Eric
>
> >
> >
> > Best regards,
> > John
> >
> >
> >> it should propagate to
> >> http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-gnuplot.php
> >> within the next two hours or so
> >>
> >> Cheers -- Eric
> >>
>

[-- Attachment #1.2: Type: text/html, Size: 3024 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [For Worg?] Gnuplot unevenly spaced non-numeric data plot?
  2010-08-25 18:38                       ` John Hendy
@ 2010-08-25 18:52                         ` Eric Schulte
  0 siblings, 0 replies; 217+ messages in thread
From: Eric Schulte @ 2010-08-25 18:52 UTC (permalink / raw)
  To: John Hendy; +Cc: nicholas.dokos, emacs-orgmode

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

[...]
>
> I'll post back if I have further questions. I kind of anticipate them. For
> instance, how do I include my .png files? Do I need to put them on some
> other personal server (google doc/site) and have them link to those? Or is
> there a Worg pic repository?
>

You can place pictures in the images/babel/ directory -- or
file:../../../images/babel from the languages sub-directory.

Cheers -- Eric

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

* Passing font size to exported LaTeX table
@ 2011-05-24 15:54 John Hendy
  2011-05-24 16:44 ` Sebastien Vauban
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2011-05-24 15:54 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]

Hi,


I can control a table font size directly from the .tex file like so:

---
\scriptsize{
\begin{center}
\begin{tabular}{lllrr}

table entries here

\end{tabular}
\end{center}
}
---

Any way to pass this from org-mode? Otherwise, I keep changing the org file,
exporting, and then having to add this to the tex file and re-export.

I tried:
---
#+begin_latex
\scriptsize{
#+end_latex

|org|table|here|

#+begin_latex
}
#+end_latex
---

without success.


Thanks,
John

[-- Attachment #2: Type: text/html, Size: 985 bytes --]

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

* Re: Passing font size to exported LaTeX table
  2011-05-24 15:54 Passing font size to exported LaTeX table John Hendy
@ 2011-05-24 16:44 ` Sebastien Vauban
  2011-05-24 18:57   ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: Sebastien Vauban @ 2011-05-24 16:44 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi John,

John Hendy wrote:
> I can control a table font size directly from the .tex file like so:
>
> ---
> \scriptsize{
> \begin{center}
> \begin{tabular}{lllrr}
>
> table entries here
>
> \end{tabular}
> \end{center}
> }
> ---
>
> Any way to pass this from org-mode? Otherwise, I keep changing the org file,
> exporting, and then having to add this to the tex file and re-export.
>
> I tried:
> ---
> #+begin_latex
> \scriptsize{
> #+end_latex
>
> |org|table|here|
>
> #+begin_latex
> }
> #+end_latex
> ---
>
> without success.

You put the things in the wrong order:

1. put a group around some LaTeX commands
2. add the macro \scriptsize in it

Hence:

#+begin_src org
  #+begin_latex
  {\scriptsize
  #+end_latex

  |org|table|here|

  #+begin_latex
  }
  #+end_latex
#+end_src

should do it (not tested).

Best regards,
  Seb

-- 
Sébastien Vauban

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

* Re: Passing font size to exported LaTeX table
  2011-05-24 16:44 ` Sebastien Vauban
@ 2011-05-24 18:57   ` John Hendy
  2011-05-24 19:25     ` Nick Dokos
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2011-05-24 18:57 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1733 bytes --]

On Tue, May 24, 2011 at 11:44 AM, Sebastien Vauban <
wxhgmqzgwmuf@spammotel.com> wrote:

> Hi John,
>
> John Hendy wrote:
> > I can control a table font size directly from the .tex file like so:
> >
> > ---
> > \scriptsize{
> > \begin{center}
> > \begin{tabular}{lllrr}
> >
> > table entries here
> >
> > \end{tabular}
> > \end{center}
> > }
> > ---
> >
> > Any way to pass this from org-mode? Otherwise, I keep changing the org
> file,
> > exporting, and then having to add this to the tex file and re-export.
> >
> > I tried:
> > ---
> > #+begin_latex
> > \scriptsize{
> > #+end_latex
> >
> > |org|table|here|
> >
> > #+begin_latex
> > }
> > #+end_latex
> > ---
> >
> > without success.
>
> You put the things in the wrong order:
>
> 1. put a group around some LaTeX commands
> 2. add the macro \scriptsize in it
>
> Hence:
>
> #+begin_src org
>   #+begin_latex
>  {\scriptsize
>  #+end_latex
>
>  |org|table|here|
>
>  #+begin_latex
>  }
>  #+end_latex
> #+end_src
>
> should do it (not tested).
>
>
I'm getting this error upon export (no PDF created):
---
! Argument of \frame has an extra }.
<inserted text>
                \par
l.142 }

Runaway argument?
 \par \par \par
! Paragraph ended before \frame was complete.
<to be read again>
                   \par
l.142 }

! Extra }, or forgotten \endgroup.
<recently read> }

l.142 }

! Extra }, or forgotten \endgroup.
\endframe ->\egroup
                    \begingroup \def \@currenvir {frame}
l.145 \end{frame}

)
Runaway argument?
---

I'm assuming something is not liking that dangling "}"...

Thoughts?


John


> Best regards,
>  Seb
>
> --
> Sébastien Vauban
>
>
>

[-- Attachment #2: Type: text/html, Size: 2943 bytes --]

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

* Re: Passing font size to exported LaTeX table
  2011-05-24 18:57   ` John Hendy
@ 2011-05-24 19:25     ` Nick Dokos
  2011-05-24 19:31       ` John Hendy
  2011-05-24 19:42       ` Sebastien Vauban
  0 siblings, 2 replies; 217+ messages in thread
From: Nick Dokos @ 2011-05-24 19:25 UTC (permalink / raw)
  To: John Hendy; +Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

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

> On Tue, May 24, 2011 at 11:44 AM, Sebastien Vauban <wxhgmqzgwmuf@spammotel.com> wrote:
> 
>     Hi John,
>    
>     John Hendy wrote:
>     > I can control a table font size directly from the .tex file like so:
>     >
>     > ---
>     > \scriptsize{
>     > \begin{center}
>     > \begin{tabular}{lllrr}
>     >
>     > table entries here
>     >
>     > \end{tabular}
>     > \end{center}
>     > }
>     > ---
>     >
>     > Any way to pass this from org-mode? Otherwise, I keep changing the org file,
>     > exporting, and then having to add this to the tex file and re-export.
>     >
>     > I tried:
>     > ---
>     > #+begin_latex
>     > \scriptsize{
>     > #+end_latex
>     >
>     > |org|table|here|
>     >
>     > #+begin_latex
>     > }
>     > #+end_latex
>     > ---
>     >
>     > without success.
>    
>     You put the things in the wrong order:
>    
>     1. put a group around some LaTeX commands
>     2. add the macro \scriptsize in it
>    
>     Hence:
>    
>     #+begin_src org
>      #+begin_latex
>      {\scriptsize
>      #+end_latex
>    
>      |org|table|here|
>    
>      #+begin_latex
>      }
>      #+end_latex
>     #+end_src
>    
>     should do it (not tested).
> 
> I'm getting this error upon export (no PDF created):
> ---
> ! Argument of \frame has an extra }.
> <inserted text> 
>                 \par 
> l.142 }
>        
> Runaway argument?
>  \par \par \par 
> ! Paragraph ended before \frame was complete.
> <to be read again> 
>                    \par 
> l.142 }
>        
> ! Extra }, or forgotten \endgroup.
> <recently read> }
>                  
> l.142 }
>        
> ! Extra }, or forgotten \endgroup.
> \endframe ->\egroup 
>                     \begingroup \def \@currenvir {frame}
> l.145 \end{frame}
>                  
> )
> Runaway argument?
> ---
> 
> I'm assuming something is not liking that dangling "}"...
> 
> Thoughts?
> 

I didn't try Seb's workaround but your original solution almost works:
what stops it is YAB in the latex exporter, but having been bitten by
such a couple of times in the past, I applied my usual[fn:1] workaround
and presto! it works:

,----
| 
| * foo
| 
| #+begin_latex
| \scriptsize{ %}
| #+end_latex
| 
| #+tblname: foo
| | table | here |
| |-------+------|
| | table | here |
| 
| #+begin_latex
| }
| #+end_latex
`----

The opening brace on the \scriptsize line confuses the exporter and it
leaves the table alone. Adding a commented-out closing brace unconfuses
it.

Nick

Footnotes:

[fn:1] Maybe I should add it to the FAQ?

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

* Re: Passing font size to exported LaTeX table
  2011-05-24 19:25     ` Nick Dokos
@ 2011-05-24 19:31       ` John Hendy
  2011-05-24 19:58         ` Thomas S. Dye
  2011-05-24 20:06         ` Nick Dokos
  2011-05-24 19:42       ` Sebastien Vauban
  1 sibling, 2 replies; 217+ messages in thread
From: John Hendy @ 2011-05-24 19:31 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Sebastien Vauban, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 3212 bytes --]

On Tue, May 24, 2011 at 2:25 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> John Hendy <jw.hendy@gmail.com> wrote:
>
> > On Tue, May 24, 2011 at 11:44 AM, Sebastien Vauban <
> wxhgmqzgwmuf@spammotel.com> wrote:
> >
> >     Hi John,
> >
> >     John Hendy wrote:
> >     > I can control a table font size directly from the .tex file like
> so:
> >     >
> >     > ---
> >     > \scriptsize{
> >     > \begin{center}
> >     > \begin{tabular}{lllrr}
> >     >
> >     > table entries here
> >     >
> >     > \end{tabular}
> >     > \end{center}
> >     > }
> >     > ---
> >     >
> >     > Any way to pass this from org-mode? Otherwise, I keep changing the
> org file,
> >     > exporting, and then having to add this to the tex file and
> re-export.
> >     >
> >     > I tried:
> >     > ---
> >     > #+begin_latex
> >     > \scriptsize{
> >     > #+end_latex
> >     >
> >     > |org|table|here|
> >     >
> >     > #+begin_latex
> >     > }
> >     > #+end_latex
> >     > ---
> >     >
> >     > without success.
> >
> >     You put the things in the wrong order:
> >
> >     1. put a group around some LaTeX commands
> >     2. add the macro \scriptsize in it
> >
> >     Hence:
> >
> >     #+begin_src org
> >      #+begin_latex
> >      {\scriptsize
> >      #+end_latex
> >
> >      |org|table|here|
> >
> >      #+begin_latex
> >      }
> >      #+end_latex
> >     #+end_src
> >
> >     should do it (not tested).
> >
> > I'm getting this error upon export (no PDF created):
> > ---
> > ! Argument of \frame has an extra }.
> > <inserted text>
> >                 \par
> > l.142 }
> >
> > Runaway argument?
> >  \par \par \par
> > ! Paragraph ended before \frame was complete.
> > <to be read again>
> >                    \par
> > l.142 }
> >
> > ! Extra }, or forgotten \endgroup.
> > <recently read> }
> >
> > l.142 }
> >
> > ! Extra }, or forgotten \endgroup.
> > \endframe ->\egroup
> >                     \begingroup \def \@currenvir {frame}
> > l.145 \end{frame}
> >
> > )
> > Runaway argument?
> > ---
> >
> > I'm assuming something is not liking that dangling "}"...
> >
> > Thoughts?
> >
>
> I didn't try Seb's workaround but your original solution almost works:
> what stops it is YAB in the latex exporter, but having been bitten by
> such a couple of times in the past, I applied my usual[fn:1] workaround
> and presto! it works:
>
> ,----
> |
> | * foo
> |
> | #+begin_latex
> | \scriptsize{ %}
> | #+end_latex
> |
> | #+tblname: foo
> | | table | here |
> | |-------+------|
> | | table | here |
> |
> | #+begin_latex
> | }
> | #+end_latex
> `----
>
>
Awesome!! And now I recall seeing it before on the list. Very cool.


> The opening brace on the \scriptsize line confuses the exporter and it
> leaves the table alone. Adding a commented-out closing brace unconfuses
> it.
>
> Nick
>
> Footnotes:
>
> [fn:1] Maybe I should add it to the FAQ?
>

Perhaps -- the tough things is that an issue with braces is not what I would
have expected the problem was. I thought I just wasn't combining things
right or that the org exporter was making something like this impossible
based on how it parsed the text. In any case, yes, it would be cool to have
in public written somewhere. Thanks!

[-- Attachment #2: Type: text/html, Size: 4824 bytes --]

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

* Re: Passing font size to exported LaTeX table
  2011-05-24 19:25     ` Nick Dokos
  2011-05-24 19:31       ` John Hendy
@ 2011-05-24 19:42       ` Sebastien Vauban
  1 sibling, 0 replies; 217+ messages in thread
From: Sebastien Vauban @ 2011-05-24 19:42 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi John and Nick,

Nick Dokos wrote:
> John Hendy <jw.hendy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> On Tue, May 24, 2011 at 11:44 AM, Sebastien Vauban <wxhgmqzgwmuf@spammotel.com> wrote:
>>     John Hendy wrote:
>>     > I can control a table font size directly from the .tex file like so:
>>     >
>>     > ---
>>     > \scriptsize{
>>     > \begin{center}
>>     > \begin{tabular}{lllrr}
>>     >
>>     > table entries here
>>     >
>>     > \end{tabular}
>>     > \end{center}
>>     > }
>>     > ---
>>     >
>>     > Any way to pass this from org-mode? Otherwise, I keep changing the org file,
>>     > exporting, and then having to add this to the tex file and re-export.
>>     >
>>     > I tried [...]
>>     > without success.
>>    
>>     You put the things in the wrong order:
>>    
>>     1. put a group around some LaTeX commands
>>     2. add the macro \scriptsize in it
>>    
>>     Hence:
>>    
>>     #+begin_src org
>>      #+begin_latex
>>      {\scriptsize
>>      #+end_latex
>>    
>>      |org|table|here|
>>    
>>      #+begin_latex
>>      }
>>      #+end_latex
>>     #+end_src
>>    
>>     should do it (not tested).
>> 
>> I'm getting this error upon export (no PDF created):
>> ---
>> ! Argument of \frame has an extra }.
>> <inserted text> 
>>                 \par 
>> l.142 }
>>        
>> Runaway argument?
>>  \par \par \par 
>> ! Paragraph ended before \frame was complete.
>> <to be read again> 
>>                    \par 
>> l.142 }
>>        
>> ! Extra }, or forgotten \endgroup.
>> <recently read> }
>>                  
>> l.142 }
>>        
>> ! Extra }, or forgotten \endgroup.
>> \endframe ->\egroup 
>>                     \begingroup \def \@currenvir {frame}
>> l.145 \end{frame}
>>                  
>> )
>> Runaway argument?
>> ---
>> 
>> I'm assuming something is not liking that dangling "}"...
>> 
>> Thoughts?

Now, a real-life example that used to work -- and still does!

#+LaTeX: {\fontsize{3.8}{4.2}\selectfont

#+BEGIN: columnview :hlines 1 :id local
| Task                 |  Orig. |   Time | Estim. | PRIOR | SCHEDULED | DEADLINE |
|----------------------+--------+--------+--------+-------+-----------+----------|
| * POC                | 856:00 | 698:50 | 775:55 |       |           |          |
| ** Setup             |  32:00 |   2:00 |  10:00 |       |           |          |
| *** Bugs or features |        |  32:05 |   0:15 |       |           |          |
| *** TODO Caching?    |        |        |        |       |           |          |
#+END:

#+LaTeX: }

So, diffs are here:

- I'm using an explicit size
- I don't use LaTeX blocks but just LaTeX one-liners


> I didn't try Seb's workaround but your original solution almost works:
> what stops it is YAB in the latex exporter, but having been bitten by
> such a couple of times in the past, I applied my usual[fn:1] workaround
> and presto! it works:
>
> ,----
> | 
> | * foo
> | 
> | #+begin_latex
> | \scriptsize{ %}
> | #+end_latex
> | 
> | #+tblname: foo
> | | table | here |
> | |-------+------|
> | | table | here |
> | 
> | #+begin_latex
> | }
> | #+end_latex
> `----
>
> The opening brace on the \scriptsize line confuses the exporter and it
> leaves the table alone. Adding a commented-out closing brace unconfuses
> it.
>
> [fn:1] Maybe I should add it to the FAQ?

Asking the question is answering it... ;-)

Best regards,
  Seb

-- 
Sébastien Vauban

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

* Re: Passing font size to exported LaTeX table
  2011-05-24 19:31       ` John Hendy
@ 2011-05-24 19:58         ` Thomas S. Dye
  2011-05-24 20:42           ` Nick Dokos
  2011-05-24 20:06         ` Nick Dokos
  1 sibling, 1 reply; 217+ messages in thread
From: Thomas S. Dye @ 2011-05-24 19:58 UTC (permalink / raw)
  To: John Hendy; +Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

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

> On Tue, May 24, 2011 at 2:25 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>
>> John Hendy <jw.hendy@gmail.com> wrote:
>>
>> > On Tue, May 24, 2011 at 11:44 AM, Sebastien Vauban <
>> wxhgmqzgwmuf@spammotel.com> wrote:
>> >
>> >     Hi John,
>> >
>> >     John Hendy wrote:
>> >     > I can control a table font size directly from the .tex file like
>> so:
>> >     >
>> >     > ---
>> >     > \scriptsize{
>> >     > \begin{center}
>> >     > \begin{tabular}{lllrr}
>> >     >
>> >     > table entries here
>> >     >
>> >     > \end{tabular}
>> >     > \end{center}
>> >     > }
>> >     > ---
>> >     >
>> >     > Any way to pass this from org-mode? Otherwise, I keep changing the
>> org file,
>> >     > exporting, and then having to add this to the tex file and
>> re-export.
>> >     >
>> >     > I tried:
>> >     > ---
>> >     > #+begin_latex
>> >     > \scriptsize{
>> >     > #+end_latex
>> >     >
>> >     > |org|table|here|
>> >     >
>> >     > #+begin_latex
>> >     > }
>> >     > #+end_latex
>> >     > ---
>> >     >
>> >     > without success.
>> >
>> >     You put the things in the wrong order:
>> >
>> >     1. put a group around some LaTeX commands
>> >     2. add the macro \scriptsize in it
>> >
>> >     Hence:
>> >
>> >     #+begin_src org
>> >      #+begin_latex
>> >      {\scriptsize
>> >      #+end_latex
>> >
>> >      |org|table|here|
>> >
>> >      #+begin_latex
>> >      }
>> >      #+end_latex
>> >     #+end_src
>> >
>> >     should do it (not tested).
>> >
>> > I'm getting this error upon export (no PDF created):
>> > ---
>> > ! Argument of \frame has an extra }.
>> > <inserted text>
>> >                 \par
>> > l.142 }
>> >
>> > Runaway argument?
>> >  \par \par \par
>> > ! Paragraph ended before \frame was complete.
>> > <to be read again>
>> >                    \par
>> > l.142 }
>> >
>> > ! Extra }, or forgotten \endgroup.
>> > <recently read> }
>> >
>> > l.142 }
>> >
>> > ! Extra }, or forgotten \endgroup.
>> > \endframe ->\egroup
>> >                     \begingroup \def \@currenvir {frame}
>> > l.145 \end{frame}
>> >
>> > )
>> > Runaway argument?
>> > ---
>> >
>> > I'm assuming something is not liking that dangling "}"...
>> >
>> > Thoughts?
>> >
>>
>> I didn't try Seb's workaround but your original solution almost works:
>> what stops it is YAB in the latex exporter, but having been bitten by
>> such a couple of times in the past, I applied my usual[fn:1] workaround
>> and presto! it works:
>>
>> ,----
>> |
>> | * foo
>> |
>> | #+begin_latex
>> | \scriptsize{ %}
>> | #+end_latex
>> |
>> | #+tblname: foo
>> | | table | here |
>> | |-------+------|
>> | | table | here |
>> |
>> | #+begin_latex
>> | }
>> | #+end_latex
>> `----
>>
>>
> Awesome!! And now I recall seeing it before on the list. Very cool.
>
>
>> The opening brace on the \scriptsize line confuses the exporter and it
>> leaves the table alone. Adding a commented-out closing brace unconfuses
>> it.
>>
>> Nick
>>
>> Footnotes:
>>
>> [fn:1] Maybe I should add it to the FAQ?
>>
>
> Perhaps -- the tough things is that an issue with braces is not what I would
> have expected the problem was. I thought I just wasn't combining things
> right or that the org exporter was making something like this impossible
> based on how it parsed the text. In any case, yes, it would be cool to have
> in public written somewhere. Thanks!
> On Tue, May 24, 2011 at 2:25 PM, Nick Dokos <span dir="ltr"><mailto:nicholas.dokos@hp.com></span> wrote:
> John Hendy <mailto:jw.hendy@gmail.com> wrote:
>
>> On Tue, May 24, 2011 at 11:44 AM, Sebastien Vauban <mailto:wxhgmqzgwmuf@spammotel.com> wrote:
>>
>>     Hi John,
>>
>>     John Hendy wrote:
>>     > I can control a table font size directly from the .tex file like so:
>>     >
>>     > ---
>>     > \scriptsize{
>>     > \begin{center}
>>     > \begin{tabular}{lllrr}
>>     >
>>     > table entries here
>>     >
>>     > \end{tabular}
>>     > \end{center}
>>     > }
>>     > ---
>>     >
>>     > Any way to pass this from org-mode? Otherwise, I keep changing the org file,
>>     > exporting, and then having to add this to the tex file and re-export.
>>     >
>>     > I tried:
>>     > ---
>>     > #+begin_latex
>>     > \scriptsize{
>>     > #+end_latex
>>     >
>>     > |org|table|here|
>>     >
>>     > #+begin_latex
>>     > }
>>     > #+end_latex
>>     > ---
>>     >
>>     > without success.
>>
>>     You put the things in the wrong order:
>>
>>     1. put a group around some LaTeX commands
>>     2. add the macro \scriptsize in it
>>
>>     Hence:
>>
>>     #+begin_src org
>>      #+begin_latex
>>      {\scriptsize
>>      #+end_latex
>>
>>      |org|table|here|
>>
>>      #+begin_latex
>>      }
>>      #+end_latex
>>     #+end_src
>>
>>     should do it (not tested).
>>
>> I&#39;m getting this error upon export (no PDF created):
>> ---
>> ! Argument of \frame has an extra }.
>> <inserted text> 
>>                 \par 
>> l.142 }
>>        
>> Runaway argument?
>>  \par \par \par 
>> ! Paragraph ended before \frame was complete.
>> <to be read again> 
>>                    \par 
>> l.142 }
>>        
>> ! Extra }, or forgotten \endgroup.
>> <recently read> }
>>                  
>> l.142 }
>>        
>> ! Extra }, or forgotten \endgroup.
>> \endframe ->\egroup 
>>                     \begingroup \def \@currenvir {frame}
>> l.145 \end{frame}
>>                  
>> )
>> Runaway argument?
>> ---
>>
>> I&#39;m assuming something is not liking that dangling "}"...
>>
>> Thoughts?
>>
>
> I didn&#39;t try Seb&#39;s workaround but your original solution almost works:
> what stops it is YAB in the latex exporter, but having been bitten by
> such a couple of times in the past, I applied my usual[fn:1] workaround
> and presto! it works:
>
> ,----
> |
> | * foo
> |
> | #+begin_latex
> | \scriptsize{ %}
> | #+end_latex
> |
> | #+tblname: foo
> | | table | here |
> | |-------+------|
> | | table | here |
> |
> | #+begin_latex
> | }
> | #+end_latex
> `----
> Awesome!! And now I recall seeing it before on the list. Very cool. 
>
> The opening brace on the \scriptsize line confuses the exporter and it
> leaves the table alone. Adding a commented-out closing brace unconfuses
> it.
>
> Nick
>
> Footnotes:
>
> [fn:1] Maybe I should add it to the FAQ?Perhaps -- the tough things is that an issue with braces is not what I would have expected the problem was. I thought I just wasn&#39;t combining things right or that the org exporter was making something like this impossible based on how it parsed the text. In any case, yes, it would be cool to have in public written somewhere. Thanks! 
>

Aloha all,

This appears to work for tabular environments only.  When I add a
caption the table is set normalsize and the text following it is set
scriptsize. Or, am I doing something wrong?

All the best,
Tom

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

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

* Re: Passing font size to exported LaTeX table
  2011-05-24 19:31       ` John Hendy
  2011-05-24 19:58         ` Thomas S. Dye
@ 2011-05-24 20:06         ` Nick Dokos
  1 sibling, 0 replies; 217+ messages in thread
From: Nick Dokos @ 2011-05-24 20:06 UTC (permalink / raw)
  To: John Hendy; +Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

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

>     The opening brace on the \scriptsize line confuses the exporter and it
>     leaves the table alone. Adding a commented-out closing brace unconfuses
>     it.
>    
>     Nick
>    
>     Footnotes:
>    
>     [fn:1] Maybe I should add it to the FAQ?
> 
> Perhaps -- the tough things is that an issue with braces is not what I
> would have expected the problem was. I thought I just wasn't combining
> things right or that the org exporter was making something like this
> impossible based on how it parsed the text. In any case, yes, it would
> be cool to have in public written somewhere. Thanks! 
> 
> 

The best debugging technique I can suggest here is to export to LaTeX
and then look at the .tex file. It's usually clear what broke, who is
responsible and, often, how to fix it.

In this case, the org table looked untouched by the exporter, but when I
got rid of the ``\scriptsize {'', the table was properly exported.

Nick

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

* Re: Passing font size to exported LaTeX table
  2011-05-24 19:58         ` Thomas S. Dye
@ 2011-05-24 20:42           ` Nick Dokos
  2011-05-24 21:12             ` Nick Dokos
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2011-05-24 20:42 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

Thomas S. Dye <tsd@tsdye.com> wrote:

> 
> This appears to work for tabular environments only.  When I add a
> caption the table is set normalsize and the text following it is set
> scriptsize. Or, am I doing something wrong?
> 

Oy, vey: I don't think you are doing anything wrong - I get the same
thing.

Can \scriptsize be used as a macro with argument? I don't have
my references here.  If I do it the way Seb suggested, inside an
environment, it seems to work better, in the sense that it does not
change the thing after the table - but the table is unaffected
nevertheless. I guess the table environment sets a font size explicitly,
overriding outside settings.

Nick

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

* Re: Passing font size to exported LaTeX table
  2011-05-24 20:42           ` Nick Dokos
@ 2011-05-24 21:12             ` Nick Dokos
  2011-05-24 21:19               ` Nick Dokos
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2011-05-24 21:12 UTC (permalink / raw)
  Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> wrote:

> Thomas S. Dye <tsd@tsdye.com> wrote:
> 
> > 
> > This appears to work for tabular environments only.  When I add a
> > caption the table is set normalsize and the text following it is set
> > scriptsize. Or, am I doing something wrong?
> > 
> 
> Oy, vey: I don't think you are doing anything wrong - I get the same
> thing.
> 
> Can \scriptsize be used as a macro with argument? I don't have
> my references here.  If I do it the way Seb suggested, inside an
> environment, it seems to work better, in the sense that it does not
> change the thing after the table - but the table is unaffected
> nevertheless. I guess the table environment sets a font size explicitly,
> overriding outside settings.
> 

table -> float -> xfloat -> floatboxreset -> normalsize

So you can redefine floatboreset to change the size:

scripttab.sty:
--8<---------------cut here---------------start------------->8---
\makeatletter
\def \@floatboxreset {%
        \reset@font
        \scriptsize
        \@setminipage
}
\makeatother
--8<---------------cut here---------------end--------------->8---

scripttab.org:

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

* Re: Passing font size to exported LaTeX table
  2011-05-24 21:12             ` Nick Dokos
@ 2011-05-24 21:19               ` Nick Dokos
  2011-05-25  7:22                 ` Thomas S. Dye
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2011-05-24 21:19 UTC (permalink / raw)
  Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

[Fat-fingered it and sent it prematurely - sorry about that]

Nick Dokos <nicholas.dokos@hp.com> wrote:

> Nick Dokos <nicholas.dokos@hp.com> wrote:
> 
> > Thomas S. Dye <tsd@tsdye.com> wrote:
> > 
> > > 
> > > This appears to work for tabular environments only.  When I add a
> > > caption the table is set normalsize and the text following it is set
> > > scriptsize. Or, am I doing something wrong?
> > > 
> > 
> > Oy, vey: I don't think you are doing anything wrong - I get the same
> > thing.
> > 
> > Can \scriptsize be used as a macro with argument? I don't have
> > my references here.  If I do it the way Seb suggested, inside an
> > environment, it seems to work better, in the sense that it does not
> > change the thing after the table - but the table is unaffected
> > nevertheless. I guess the table environment sets a font size explicitly,
> > overriding outside settings.
> > 
> 
> table -> float -> xfloat -> floatboxreset -> normalsize
> 

This was supposed to say that yes, indeed, the table environment sets
\normalsize explicitly, through this sequence of macro calls.

> So you can redefine floatboreset to change the size:
                      floatboxreset
> 
> scripttab.sty:
> \makeatletter
> \def \@floatboxreset {%
>         \reset@font
>         \scriptsize
>         \@setminipage
> }
> \makeatother
> 
> scripttab.org:
> 

scripttab.sty:
--8<---------------cut here---------------start------------->8---
\makeatletter
\def \@floatboxreset {%
        \reset@font
        \scriptsize
        \@setminipage
}
\makeatother
--8<---------------cut here---------------end--------------->8---

scripttab.org:
--8<---------------cut here---------------start------------->8---
#+LaTeX_HEADER: \usepackage{scripttab}

* foo

What's this?


#+tblname: foo
#+CAPTION: foo
| table | here |
|-------+------|
| table | here |

What's this?

--8<---------------cut here---------------end--------------->8---

I think this works OK.

Nick

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

* Re: Passing font size to exported LaTeX table
  2011-05-24 21:19               ` Nick Dokos
@ 2011-05-25  7:22                 ` Thomas S. Dye
  2011-05-27  0:58                   ` suvayu ali
  0 siblings, 1 reply; 217+ messages in thread
From: Thomas S. Dye @ 2011-05-25  7:22 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Sebastien Vauban, emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> writes:

> [Fat-fingered it and sent it prematurely - sorry about that]
>
> Nick Dokos <nicholas.dokos@hp.com> wrote:
>
>> Nick Dokos <nicholas.dokos@hp.com> wrote:
>> 
>> > Thomas S. Dye <tsd@tsdye.com> wrote:
>> > 
>> > > 
>> > > This appears to work for tabular environments only.  When I add a
>> > > caption the table is set normalsize and the text following it is set
>> > > scriptsize. Or, am I doing something wrong?
>> > > 
>> > 
>> > Oy, vey: I don't think you are doing anything wrong - I get the same
>> > thing.
>> > 
>> > Can \scriptsize be used as a macro with argument? I don't have
>> > my references here.  If I do it the way Seb suggested, inside an
>> > environment, it seems to work better, in the sense that it does not
>> > change the thing after the table - but the table is unaffected
>> > nevertheless. I guess the table environment sets a font size explicitly,
>> > overriding outside settings.
>> > 
>> 
>> table -> float -> xfloat -> floatboxreset -> normalsize
>> 
>
> This was supposed to say that yes, indeed, the table environment sets
> \normalsize explicitly, through this sequence of macro calls.
>
>> So you can redefine floatboreset to change the size:
>                       floatboxreset
>> 
>> scripttab.sty:
>> \makeatletter
>> \def \@floatboxreset {%
>>         \reset@font
>>         \scriptsize
>>         \@setminipage
>> }
>> \makeatother
>> 
>> scripttab.org:
>> 
>
> scripttab.sty:
> \makeatletter
> \def \@floatboxreset {%
>         \reset@font
>         \scriptsize
>         \@setminipage
> }
> \makeatother
>
> scripttab.org:
> #+LaTeX_HEADER: \usepackage{scripttab}
>
> * foo
>
> What's this?
>
>
> #+tblname: foo
> #+CAPTION: foo
> | table | here |
> |-------+------|
> | table | here |
>
> What's this?
>
>
> I think this works OK.
>
> Nick
>
Aloha Nick,

This works like a charm.  Thanks!

All the best,
Tom

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

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

* Re: Passing font size to exported LaTeX table
  2011-05-25  7:22                 ` Thomas S. Dye
@ 2011-05-27  0:58                   ` suvayu ali
  2011-05-27  6:46                     ` Thomas S. Dye
  0 siblings, 1 reply; 217+ messages in thread
From: suvayu ali @ 2011-05-27  0:58 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

Hello,

On Wed, May 25, 2011 at 12:22 AM, Thomas S. Dye <tsd@tsdye.com> wrote:
>> #+LaTeX_HEADER: \usepackage{scripttab}
>>
>> * foo
>>
>> What's this?
>>
>>
>> #+tblname: foo
>> #+CAPTION: foo
>> | table | here |
>> |-------+------|
>> | table | here |
>>
>> What's this?
>>
>>
>> I think this works OK.
>>
>> Nick
>>
> Aloha Nick,
>
> This works like a charm.  Thanks!

Although this is solved now, I found a very simple solution.

e.g. for footnotesize just add the line:

#+ATTR_LaTeX: placement=[<options>]\footnotesize

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Passing font size to exported LaTeX table
  2011-05-27  0:58                   ` suvayu ali
@ 2011-05-27  6:46                     ` Thomas S. Dye
  2011-05-27  7:07                       ` suvayu ali
  0 siblings, 1 reply; 217+ messages in thread
From: Thomas S. Dye @ 2011-05-27  6:46 UTC (permalink / raw)
  To: suvayu ali; +Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

suvayu ali <fatkasuvayu+linux@gmail.com> writes:

> Hello,
>
> On Wed, May 25, 2011 at 12:22 AM, Thomas S. Dye <tsd@tsdye.com> wrote:
>>> #+LaTeX_HEADER: \usepackage{scripttab}
>>>
>>> * foo
>>>
>>> What's this?
>>>
>>>
>>> #+tblname: foo
>>> #+CAPTION: foo
>>> | table | here |
>>> |-------+------|
>>> | table | here |
>>>
>>> What's this?
>>>
>>>
>>> I think this works OK.
>>>
>>> Nick
>>>
>> Aloha Nick,
>>
>> This works like a charm.  Thanks!
>
> Although this is solved now, I found a very simple solution.
>
> e.g. for footnotesize just add the line:
>
> #+ATTR_LaTeX: placement=[<options>]\footnotesize

Aloha Suvayu,

And this works, too.  Thanks!

Can I ask where you found this simple solution?

All the best,
Tom

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

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

* Re: Passing font size to exported LaTeX table
  2011-05-27  6:46                     ` Thomas S. Dye
@ 2011-05-27  7:07                       ` suvayu ali
  2011-05-27 16:17                         ` Thomas S. Dye
  0 siblings, 1 reply; 217+ messages in thread
From: suvayu ali @ 2011-05-27  7:07 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

Hi Tom,

On Thu, May 26, 2011 at 11:46 PM, Thomas S. Dye <tsd@tsdye.com> wrote:
>> Although this is solved now, I found a very simple solution.
>>
>> e.g. for footnotesize just add the line:
>>
>> #+ATTR_LaTeX: placement=[<options>]\footnotesize
>
> Aloha Suvayu,
>
> And this works, too.  Thanks!
>
> Can I ask where you found this simple solution?

Of course you may. :) I came across a few very nicely written articles
by LF Mori in The Practex Journal. This particular solution was
discussed in section 3.1 of the following article:

<http://www.tug.org/pracjourn/2007-1/mori/>

HTH

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Passing font size to exported LaTeX table
  2011-05-27  7:07                       ` suvayu ali
@ 2011-05-27 16:17                         ` Thomas S. Dye
  2011-05-27 16:50                           ` Suvayu Ali
  0 siblings, 1 reply; 217+ messages in thread
From: Thomas S. Dye @ 2011-05-27 16:17 UTC (permalink / raw)
  To: suvayu ali; +Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

suvayu ali <fatkasuvayu+linux@gmail.com> writes:

> Hi Tom,
>
> On Thu, May 26, 2011 at 11:46 PM, Thomas S. Dye <tsd@tsdye.com> wrote:
>>> Although this is solved now, I found a very simple solution.
>>>
>>> e.g. for footnotesize just add the line:
>>>
>>> #+ATTR_LaTeX: placement=[<options>]\footnotesize
>>
>> Aloha Suvayu,
>>
>> And this works, too.  Thanks!
>>
>> Can I ask where you found this simple solution?
>
> Of course you may. :) I came across a few very nicely written articles
> by LF Mori in The Practex Journal. This particular solution was
> discussed in section 3.1 of the following article:
>
> <http://www.tug.org/pracjourn/2007-1/mori/>
>
> HTH

Aloha Suvayu,

Thank you for the link to the Mori article.  It is nicely written.

My question was poorly written, though.  I'm interested to know where
you found the Org-mode line:

#+ATTR_LaTeX: placement=[<options>]\footnotesize

I haven't been able to find this solution anywhere else.

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

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

* Re: Passing font size to exported LaTeX table
  2011-05-27 16:17                         ` Thomas S. Dye
@ 2011-05-27 16:50                           ` Suvayu Ali
  2011-05-27 17:37                             ` Thomas S. Dye
  0 siblings, 1 reply; 217+ messages in thread
From: Suvayu Ali @ 2011-05-27 16:50 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

Hello Tom,

On Fri, 27 May 2011 06:17:04 -1000
tsd@tsdye.com (Thomas S. Dye) wrote:

> Aloha Suvayu,
> 
> Thank you for the link to the Mori article.  It is nicely written.
> 
> My question was poorly written, though.  I'm interested to know where
> you found the Org-mode line:
> 
> #+ATTR_LaTeX: placement=[<options>]\footnotesize
> 
> I haven't been able to find this solution anywhere else.
> 

I got the solution by reading between the lines and some
experimentation. The placement option is documented in the section
referenced below[1]. Note that this does not say anything about tables.
I think I found it by experimenting that this also works for tables.
When I saw the LaTeX solution in the article I mentioned earlier, I
tried out and found exporting as above works. :)

> All the best,
> Tom

HTH

Footnotes:

[1] <http://orgmode.org/manual/Images-in-LaTeX-export.html#Images-in-LaTeX-export>
-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Passing font size to exported LaTeX table
  2011-05-27 16:50                           ` Suvayu Ali
@ 2011-05-27 17:37                             ` Thomas S. Dye
  2011-05-27 18:30                               ` Suvayu Ali
  0 siblings, 1 reply; 217+ messages in thread
From: Thomas S. Dye @ 2011-05-27 17:37 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> Hello Tom,
>
> On Fri, 27 May 2011 06:17:04 -1000
> tsd@tsdye.com (Thomas S. Dye) wrote:
>
>> Aloha Suvayu,
>> 
>> Thank you for the link to the Mori article.  It is nicely written.
>> 
>> My question was poorly written, though.  I'm interested to know where
>> you found the Org-mode line:
>> 
>> #+ATTR_LaTeX: placement=[<options>]\footnotesize
>> 
>> I haven't been able to find this solution anywhere else.
>> 
>
> I got the solution by reading between the lines and some
> experimentation. The placement option is documented in the section
> referenced below[1]. Note that this does not say anything about tables.
> I think I found it by experimenting that this also works for tables.
> When I saw the LaTeX solution in the article I mentioned earlier, I
> tried out and found exporting as above works. :)
>
>> All the best,
>> Tom
>
> HTH
>
> Footnotes:
>
> [1] <http://orgmode.org/manual/Images-in-LaTeX-export.html#Images-in-LaTeX-export>

Aloha Suvayu,

I think #+ATTR_LaTeX: needs more documentation.  I worked very hard to
read between the lines of the Org-mode manual to arrive at your simple
solution but didn't manage to come close!

Are you able to summarize the possibilities of #+ATTR_LaTeX?  I'm
thinking that a general description somewhere in the Org-mode manual
might be useful.  It would probably also be good to augment the existing
descriptions of its use in the manual, as well.  Perhaps it would be
possible to propose a patch to the documentation?

All the best,
Tom

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

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

* Re: Passing font size to exported LaTeX table
  2011-05-27 17:37                             ` Thomas S. Dye
@ 2011-05-27 18:30                               ` Suvayu Ali
  2011-05-27 21:25                                 ` Thomas S. Dye
  0 siblings, 1 reply; 217+ messages in thread
From: Suvayu Ali @ 2011-05-27 18:30 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 912 bytes --]

Hello Tom,

On Fri, 27 May 2011 07:37:50 -1000
tsd@tsdye.com (Thomas S. Dye) wrote:

> Aloha Suvayu,
> 
> I think #+ATTR_LaTeX: needs more documentation.  I worked very hard to
> read between the lines of the Org-mode manual to arrive at your simple
> solution but didn't manage to come close!
> 
> Are you able to summarize the possibilities of #+ATTR_LaTeX?  I'm
> thinking that a general description somewhere in the Org-mode manual
> might be useful.  It would probably also be good to augment the
> existing descriptions of its use in the manual, as well.  Perhaps it
> would be possible to propose a patch to the documentation?
> 

I am not very familiar with org-latex internals. Based on my limited
understanding I wrote the attached patch to the org manual. I hope it
is up to par.

> All the best,
> Tom

Thanks a lot for your encouragement. :)

-- 
Suvayu

Open source is the future. It sets us free.

[-- Attachment #2: 0001-Documentation-on-placement-options-in-LaTeX-export.patch --]
[-- Type: text/plain, Size: 2140 bytes --]

From 431d7e275a0b374c7b1e8135fe7e5c7d72f46a75 Mon Sep 17 00:00:00 2001
From: Suvayu Ali <fatkasuvayu+linux@gmail.com>
Date: Fri, 27 May 2011 11:18:35 -0700
Subject: [PATCH] Documentation on placement options in LaTeX export.

* Placement options can be passed to floating environments
  like 'figure' or 'table' with the '#+ATTR_LaTeX:' line
  during LaTeX export. Added an example to demonstrate that.
---
 doc/org.texi |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index aa34cd3..5fa1e22 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -10160,7 +10160,7 @@ All lines between these markers are exported literally
 @subsection Tables in @LaTeX{} export
 @cindex tables, in @LaTeX{} export
 
-For @LaTeX{} export of a table, you can specify a label and a caption
+For @LaTeX{} export of a table, you can specify a label, a caption and placement options
 (@pxref{Images and tables}).  You can also use the @code{ATTR_LaTeX} line to
 request a @code{longtable} environment for the table, so that it may span
 several pages, or to change the default table environment from @code{table}
@@ -10207,7 +10207,20 @@ element.  You can use an @code{#+ATTR_LaTeX:} line to specify the various
 options that can be used in the optional argument of the
 @code{\includegraphics} macro.  To modify the placement option of the
 @code{figure} environment, add something like @samp{placement=[h!]} to the
-Attributes.
+Attributes. It is to be noted this option can be used with tables as well.
+The options are passed as the placement option to floating environments like
+@code{figure} or @code{table}. One can pass other compatible options as well.
+For example the @code{#+ATTR_LaTeX:} line below is exported as the
+@code{figure} environment below it.
+
+@cindex #+ATTR_LaTeX
+@example
+#+ATTR_LaTeX: placement=[<options>]\footnotesize
+
+\begin{figure}[<options>]\footnotesize
+...
+\end{figure}
+@end example
 
 If you would like to let text flow around the image, add the word @samp{wrap}
 to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left
-- 
1.7.5.1


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

* Re: Passing font size to exported LaTeX table
  2011-05-27 18:30                               ` Suvayu Ali
@ 2011-05-27 21:25                                 ` Thomas S. Dye
  2011-05-28  7:17                                   ` Sebastien Vauban
  2011-06-01 18:50                                   ` Nick Dokos
  0 siblings, 2 replies; 217+ messages in thread
From: Thomas S. Dye @ 2011-05-27 21:25 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> Hello Tom,
>
> On Fri, 27 May 2011 07:37:50 -1000
> tsd@tsdye.com (Thomas S. Dye) wrote:
>
>> Aloha Suvayu,
>> 
>> I think #+ATTR_LaTeX: needs more documentation.  I worked very hard to
>> read between the lines of the Org-mode manual to arrive at your simple
>> solution but didn't manage to come close!
>> 
>> Are you able to summarize the possibilities of #+ATTR_LaTeX?  I'm
>> thinking that a general description somewhere in the Org-mode manual
>> might be useful.  It would probably also be good to augment the
>> existing descriptions of its use in the manual, as well.  Perhaps it
>> would be possible to propose a patch to the documentation?
>> 
>
> I am not very familiar with org-latex internals. Based on my limited
> understanding I wrote the attached patch to the org manual. I hope it
> is up to par.
>
>> All the best,
>> Tom
>
> Thanks a lot for your encouragement. :)
>
> -- 
> Suvayu
>
> Open source is the future. It sets us free.
>
> From 431d7e275a0b374c7b1e8135fe7e5c7d72f46a75 Mon Sep 17 00:00:00 2001
> From: Suvayu Ali <fatkasuvayu+linux@gmail.com>
> Date: Fri, 27 May 2011 11:18:35 -0700
> Subject: [PATCH] Documentation on placement options in LaTeX export.
>
> * Placement options can be passed to floating environments
>   like 'figure' or 'table' with the '#+ATTR_LaTeX:' line
>   during LaTeX export. Added an example to demonstrate that.
> ---
>  doc/org.texi |   17 +++++++++++++++--
>  1 files changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/doc/org.texi b/doc/org.texi
> index aa34cd3..5fa1e22 100644
> --- a/doc/org.texi
> +++ b/doc/org.texi
> @@ -10160,7 +10160,7 @@ All lines between these markers are exported literally
>  @subsection Tables in @LaTeX{} export
>  @cindex tables, in @LaTeX{} export
>  
> -For @LaTeX{} export of a table, you can specify a label and a caption
> +For @LaTeX{} export of a table, you can specify a label, a caption and placement options
>  (@pxref{Images and tables}).  You can also use the @code{ATTR_LaTeX} line to
>  request a @code{longtable} environment for the table, so that it may span
>  several pages, or to change the default table environment from @code{table}
> @@ -10207,7 +10207,20 @@ element.  You can use an @code{#+ATTR_LaTeX:} line to specify the various
>  options that can be used in the optional argument of the
>  @code{\includegraphics} macro.  To modify the placement option of the
>  @code{figure} environment, add something like @samp{placement=[h!]} to the
> -Attributes.
> +Attributes. It is to be noted this option can be used with tables as well.
> +The options are passed as the placement option to floating environments like
> +@code{figure} or @code{table}. One can pass other compatible options as well.
> +For example the @code{#+ATTR_LaTeX:} line below is exported as the
> +@code{figure} environment below it.
> +
> +@cindex #+ATTR_LaTeX
> +@example
> +#+ATTR_LaTeX: placement=[<options>]\footnotesize
> +
> +\begin{figure}[<options>]\footnotesize
> +...
> +\end{figure}
> +@end example
>  
>  If you would like to let text flow around the image, add the word @samp{wrap}
>  to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left
Aloha Suvayu,

This looks like an improvement to me.  I'd be interested to hear what
Nick and Seb might have to say.  They often catch things I miss.

If you don't get other comments, I'd encourage you to submit this as a
patch (I think this requires [PATCH] in the subject line) to see what
Carsten and crew have to say about it.

Thanks again for finding this solution to specifying the font size for
floating tables on a table-by-table basis in LaTeX export.  I'd been
looking for your solution, and for Nick's solution that works on a
per-document or buffer basis, for many months without success.

All the best,
Tom

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

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

* Re: Passing font size to exported LaTeX table
  2011-05-27 21:25                                 ` Thomas S. Dye
@ 2011-05-28  7:17                                   ` Sebastien Vauban
  2011-05-28 10:14                                     ` Suvayu Ali
  2011-06-01 18:50                                   ` Nick Dokos
  1 sibling, 1 reply; 217+ messages in thread
From: Sebastien Vauban @ 2011-05-28  7:17 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Thomas and Suvayu,

Thomas S. Dye wrote:
> Suvayu Ali <fatkasuvayu+linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>> diff --git a/doc/org.texi b/doc/org.texi
>> index aa34cd3..5fa1e22 100644
>> --- a/doc/org.texi
>> +++ b/doc/org.texi
>> @@ -10160,7 +10160,7 @@ All lines between these markers are exported literally
>>  @subsection Tables in @LaTeX{} export
>>  @cindex tables, in @LaTeX{} export
>>  
>> -For @LaTeX{} export of a table, you can specify a label and a caption
>> +For @LaTeX{} export of a table, you can specify a label, a caption and placement options
>>  (@pxref{Images and tables}).  You can also use the @code{ATTR_LaTeX} line to
>>  request a @code{longtable} environment for the table, so that it may span
>>  several pages, or to change the default table environment from @code{table}
>> @@ -10207,7 +10207,20 @@ element.  You can use an @code{#+ATTR_LaTeX:} line to specify the various
>>  options that can be used in the optional argument of the
>>  @code{\includegraphics} macro.  To modify the placement option of the
>>  @code{figure} environment, add something like @samp{placement=[h!]} to the
>> -Attributes.
>> +Attributes. It is to be noted this option can be used with tables as well.
>> +The options are passed as the placement option to floating environments like
>> +@code{figure} or @code{table}. One can pass other compatible options as well.
>> +For example the @code{#+ATTR_LaTeX:} line below is exported as the
>> +@code{figure} environment below it.
>> +
>> +@cindex #+ATTR_LaTeX
>> +@example
>> +#+ATTR_LaTeX: placement=[<options>]\footnotesize
>> +
>> +\begin{figure}[<options>]\footnotesize
>> +...
>> +\end{figure}
>> +@end example
>>  
>>  If you would like to let text flow around the image, add the word @samp{wrap}
>>  to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left
>
> This looks like an improvement to me.

I think so too. The real test will be, though, the day I will search for
additional info about the tables. And the above text seems neat to me.

> I'd be interested to hear what Nick and Seb might have to say. They often
> catch things I miss.

;-)

> If you don't get other comments, I'd encourage you to submit this as a patch
> (I think this requires [PATCH] in the subject line) to see what Carsten and
> crew have to say about it.
>
> Thanks again for finding this solution to specifying the font size for
> floating tables on a table-by-table basis in LaTeX export. I'd been looking
> for your solution, and for Nick's solution that works on a per-document or
> buffer basis, for many months without success.

Thanks to both of you, for closing this loop up to the documentation stuff!

Best regards,
  Seb

-- 
Sébastien Vauban

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

* Re: Passing font size to exported LaTeX table
  2011-05-28  7:17                                   ` Sebastien Vauban
@ 2011-05-28 10:14                                     ` Suvayu Ali
  2011-05-28 15:21                                       ` Nick Dokos
  0 siblings, 1 reply; 217+ messages in thread
From: Suvayu Ali @ 2011-05-28 10:14 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Hi Tom and Seb,

On Sat, 28 May 2011 09:17:18 +0200
"Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> wrote:

> > This looks like an improvement to me.  
> 
> I think so too. The real test will be, though, the day I will search
> for additional info about the tables. And the above text seems neat
> to me.
> 

Great! All is in order then. :)

> 
> > If you don't get other comments, I'd encourage you to submit this
> > as a patch (I think this requires [PATCH] in the subject line) to
> > see what Carsten and crew have to say about it.
> >

From what I understand the patchwork server queues messages based on
the MIME type and contents of the attachment. If that is correct this
should be picked up just fine.

> > Thanks again for finding this solution to specifying the font size
> > for floating tables on a table-by-table basis in LaTeX export. I'd
> > been looking for your solution, and for Nick's solution that works
> > on a per-document or buffer basis, for many months without
> > success.  
> 
> Thanks to both of you, for closing this loop up to the documentation
> stuff!

Thanks everyone, :)

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Passing font size to exported LaTeX table
  2011-05-28 10:14                                     ` Suvayu Ali
@ 2011-05-28 15:21                                       ` Nick Dokos
  2011-05-28 18:10                                         ` Suvayu Ali
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2011-05-28 15:21 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:

> > > If you don't get other comments, I'd encourage you to submit this
> > > as a patch (I think this requires [PATCH] in the subject line) to
> > > see what Carsten and crew have to say about it.
> > >
> 
> =46rom what I understand the patchwork server queues messages based on
> the MIME type and contents of the attachment. If that is correct this
> should be picked up just fine.
> 

I just checked: so far at least, it's not on patchwork.

Nick

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

* Re: Passing font size to exported LaTeX table
  2011-05-28 15:21                                       ` Nick Dokos
@ 2011-05-28 18:10                                         ` Suvayu Ali
  0 siblings, 0 replies; 217+ messages in thread
From: Suvayu Ali @ 2011-05-28 18:10 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Sebastien Vauban, emacs-orgmode

On Sat, 28 May 2011 11:21:15 -0400
Nick Dokos <nicholas.dokos@hp.com> wrote:

> Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:
> 
> > > > If you don't get other comments, I'd encourage you to submit
> > > > this as a patch (I think this requires [PATCH] in the subject
> > > > line) to see what Carsten and crew have to say about it.
> > > >
> > 
> > =46rom what I understand the patchwork server queues messages based
> > on the MIME type and contents of the attachment. If that is correct
> > this should be picked up just fine.
> > 
> 
> I just checked: so far at least, it's not on patchwork.
> 

Okay, I'll send it again on a separate thread with a proper subject
line.

> Nick

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Passing font size to exported LaTeX table
  2011-05-27 21:25                                 ` Thomas S. Dye
  2011-05-28  7:17                                   ` Sebastien Vauban
@ 2011-06-01 18:50                                   ` Nick Dokos
  2011-06-01 19:08                                     ` Suvayu Ali
  1 sibling, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2011-06-01 18:50 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Sebastien Vauban, emacs-orgmode, nicholas.dokos

Thomas S. Dye <tsd@tsdye.com> wrote:

> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
> 
> > I am not very familiar with org-latex internals. Based on my limited
> > understanding I wrote the attached patch to the org manual. I hope it
> > is up to par.
> >
>
> [patch snipped]
> 
> This looks like an improvement to me.  I'd be interested to hear what
> Nick and Seb might have to say.  They often catch things I miss.
> 
> If you don't get other comments, I'd encourage you to submit this as a
> patch (I think this requires [PATCH] in the subject line) to see what
> Carsten and crew have to say about it.
> 
> Thanks again for finding this solution to specifying the font size for
> floating tables on a table-by-table basis in LaTeX export.  I'd been
> looking for your solution, and for Nick's solution that works on a
> per-document or buffer basis, for many months without success.
> 

Maybe I can contribute some commentary to the code and ask Suvayu to perhaps
amend the patch to clarify some things (but see my editorial comment at
the end of the email):

<code commentary>
There are two parts to the code: one is in org-exp.el,
org-export-attach-captions-and-attributes(), which matches caption,
label and attr_latex lines and adds text properties for later use by the
export backend. It figures out whether the following item is a table or
a link and it adds the appropriate text property (or properties - one or
more can be present for a given itme) to the item: either the whole
table[fn:1] or the line containing the link. There are three different
properties corresponding to the #+foo construct: 'org-caption,
'org-labeland and 'org-attributes.

The second part is in the specific backend - latex in this case (I did
not look at the others). There are two cases: tables and links.


The table case is handled by org-export-latex tables. It gets the
caption label and attributes from the corresponding text property. It
then further parses the string it gets from the 'org-attributes property
to figure out:

    - whether this is a longtable (a table spanning multiple pages)
      (syntax: the string "longtable" as a word)
    - whether it's a table or a table* (syntax: the string itself)
    - whether it's a tabular (syntax: the string "tabular" followed by a
      single char - that's to catch the tabular*, tabularx and tabulary
      cases I believe).
    - what the width is (syntax: "width=XXX" where XXX is a sequence of
      anything but white space and there is a word boundary before
      "width" - i.e. " width=foo" will set the width to foo but "
      linewidth=foo" will not).
    - what the alignment is (syntax: same as width but with "align"
      instead)
    - what the placement is (syntax: "placement=XXX" - where XXX is a
      string of one or more non-white-space characters.

Suvayu's method works by taking advantage of the fact that the placement
"value" (i.e. the string to the right of the equal sign) does not
contain white space and copies the whole thing as the placement value in
the correct place in the table environment. LaTeX then parses this and
breaks it up into placement and \scriptsize constructs. Since org adds
the placement info to the table environment, \scriptsize sneaks in by
the back door, so to speak.

In the case of a link (which presumably points to an image and handled by
org-export-latex-links and org-export-latex-format-image), the parsing
of the property figures out

   - whether to use wrapfigure (syntax: "wrap" as a word)
   - whether to use the figure env (syntax: "float" as a word)
   - whether to use the figure* env (syntax: "multicolumn" as a word)
   - what the placement is (syntax: same as above)

In addition, whether there is a caption or a label determines whether
the figure is floated or inlined.

</code commentary>

<soapbox> I've tried to keep a neutral tone in (most of) the rest of the
mail, but I have to say that I think clever hacks like this are too
clever for their own good - they are at best an accident of
implementation. The fact that the trick uses the placement option in
order to change the font testifies to that. They should certainly be
documented as hacks on Worg, but I'm not sure they should be documented
in the manual. Of course, it may happen that a really good hack (by some
definition of "really good") should be elevated to a standard and
documented in the manual, but IMO this one does not qualify.  </soapbox>

Comments, corrections, additions are more than welcome.

Nick

Footnotes:

[fn:1] BTW, the documentation of the function says that the property is
added to the first line of the table, but unless I misread the code,
that's wrong: it gets added to the whole table.

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

* Re: Passing font size to exported LaTeX table
  2011-06-01 18:50                                   ` Nick Dokos
@ 2011-06-01 19:08                                     ` Suvayu Ali
  2011-06-10 22:31                                       ` Suvayu Ali
  0 siblings, 1 reply; 217+ messages in thread
From: Suvayu Ali @ 2011-06-01 19:08 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Sebastien Vauban, emacs-orgmode

Hi Nick,

A very big thank you for that crystal clear code commentary.

On Wed, 01 Jun 2011 14:50:34 -0400
Nick Dokos <nicholas.dokos@hp.com> wrote:

> <soapbox> I've tried to keep a neutral tone in (most of) the rest of
> the mail, but I have to say that I think clever hacks like this are
> too clever for their own good - they are at best an accident of
> implementation. The fact that the trick uses the placement option in
> order to change the font testifies to that.

After the very clear description above, I agree 100%. I will remove my
addition to the manual and instead try to improve the #+ATTR_LaTeX:
documentation based on your code commentary. At the moment I am facing a
very important deadline for the 8th of June, I will submit a revised
patch after that.

> They should certainly be documented as hacks on Worg, but I'm not sure
> they should be documented in the manual. Of course, it may happen that
> a really good hack (by some definition of "really good") should be
> elevated to a standard and documented in the manual, but IMO this one
> does not qualify. </soapbox>
> 

Along with the revisions for the manual, I will document my hack on Worg.

> Comments, corrections, additions are more than welcome.
> 

Thanks a lot! :)

> Nick

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Passing font size to exported LaTeX table
  2011-06-01 19:08                                     ` Suvayu Ali
@ 2011-06-10 22:31                                       ` Suvayu Ali
  2011-06-13  1:38                                         ` suvayu ali
  2011-06-13  1:52                                         ` Nick Dokos
  0 siblings, 2 replies; 217+ messages in thread
From: Suvayu Ali @ 2011-06-10 22:31 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Sebastien Vauban, nicholas.dokos

[-- Attachment #1: Type: text/plain, Size: 1684 bytes --]

Hello everyone,

On Wed, 1 Jun 2011 12:08:25 -0700
Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:

> On Wed, 01 Jun 2011 14:50:34 -0400
> Nick Dokos <nicholas.dokos@hp.com> wrote:
> 
> > <soapbox> I've tried to keep a neutral tone in (most of) the rest of
> > the mail, but I have to say that I think clever hacks like this are
> > too clever for their own good - they are at best an accident of
> > implementation. The fact that the trick uses the placement option in
> > order to change the font testifies to that.
> 
> After the very clear description above, I agree 100%. I will remove my
> addition to the manual and instead try to improve the #+ATTR_LaTeX:
> documentation based on your code commentary. At the moment I am
> facing a very important deadline for the 8th of June, I will submit a
> revised patch after that.
> 

I have attached a patch removing the hack from the manual and making
some other small improvements to the latex export of images. However I
did leave in one sentence regarding the placement option which alludes
that a hack is possible.

Please let me know if this is an improvement.

> > They should certainly be documented as hacks on Worg, but I'm not
> > sure they should be documented in the manual. Of course, it may
> > happen that a really good hack (by some definition of "really
> > good") should be elevated to a standard and documented in the
> > manual, but IMO this one does not qualify. </soapbox>
> > 
> 
> Along with the revisions for the manual, I will document my hack on
> Worg.

I made an account with repo.or.cz. I will soon push the changes
documenting the hack on Worg.

-- 
Suvayu

Open source is the future. It sets us free.

[-- Attachment #2: 0001-Improve-Images-in-LaTeX-export-documentation.patch --]
[-- Type: text/plain, Size: 2915 bytes --]

From 7f66dba736136fc1a2ee8e2d4fbce47e07db3ca6 Mon Sep 17 00:00:00 2001
From: Suvayu Ali (ThinkPad) <fatkasuvayu+linux@gmail.com>
Date: Fri, 10 Jun 2011 14:57:48 -0700
Subject: [PATCH] Improve "Images in LaTeX export" documentation

* Mention use of keywords like multicolumn and float
* Remove previous mention of hack with placement option
  as per comments on the mailing list. Hack better
  suited for Worg.
---
 doc/org.texi |   30 ++++++++++++------------------
 1 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index 92343de..c98bd53 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -10207,24 +10207,14 @@ output file resulting from @LaTeX{} processing.  Org will use an
 @code{\includegraphics} macro to insert the image.  If you have specified a
 caption and/or a label as described in @ref{Images and tables}, the figure
 will be wrapped into a @code{figure} environment and thus become a floating
-element.  You can use an @code{#+ATTR_LaTeX:} line to specify the various
-options that can be used in the optional argument of the
-@code{\includegraphics} macro.  To modify the placement option of the
-@code{figure} environment, add something like @samp{placement=[h!]} to the
-Attributes. It is to be noted this option can be used with tables as well.
-The options are passed as the placement option to floating environments like
-@code{figure} or @code{table}. One can pass other compatible options as well.
-For example the @code{#+ATTR_LaTeX:} line below is exported as the
-@code{figure} environment below it.
-
-@cindex #+ATTR_LaTeX
-@example
-#+ATTR_LaTeX: placement=[<options>]\footnotesize
-
-\begin@{figure@}[<options>]\footnotesize
-...
-\end@{figure@}
-@end example
+element.  You can use an @code{#+ATTR_LaTeX:} line to specify various other
+options.  You can ask org to export an image as a float without specifying
+a label or a caption by using the keyword @code{float} in this line.  Various
+optional arguments to the @code{\includegraphics} macro can also be specified
+in this fashion.  To modify the placement option of the floating environment,
+add something like @samp{placement=[h!]} to the attributes.  It is to be noted
+this option can be used with tables as well.  One can also pass other
+compatible options.
 
 If you would like to let text flow around the image, add the word @samp{wrap}
 to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left
@@ -10246,6 +10236,10 @@ for @code{\includegraphics} and @code{wrapfigure}.
 [[./img/hst.png]]
 @end example
 
+If you wish to include an image which spans multiple columns in a page,
+you can use the keyword @code{multicolumn} in the @code{#+ATTR_LaTeX}
+line. This will export the image wrapped in a @code{figure*} environment.
+
 If you need references to a label created in this way, write
 @samp{\ref@{fig:SED-HR4049@}} just like in @LaTeX{}.
 
-- 
1.7.4.4


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

* Re: Passing font size to exported LaTeX table
  2011-06-10 22:31                                       ` Suvayu Ali
@ 2011-06-13  1:38                                         ` suvayu ali
  2011-06-13  1:52                                         ` Nick Dokos
  1 sibling, 0 replies; 217+ messages in thread
From: suvayu ali @ 2011-06-13  1:38 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Sebastien Vauban, nicholas.dokos

On Fri, Jun 10, 2011 at 3:31 PM, Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:
>
>> > They should certainly be documented as hacks on Worg, but I'm not
>> > sure they should be documented in the manual. Of course, it may
>> > happen that a really good hack (by some definition of "really
>> > good") should be elevated to a standard and documented in the
>> > manual, but IMO this one does not qualify. </soapbox>
>> >
>>
>> Along with the revisions for the manual, I will document my hack on
>> Worg.
>
> I made an account with repo.or.cz. I will soon push the changes
> documenting the hack on Worg.

Here is the documentation on Worg. Comments are welcome.

<http://orgmode.org/worg/org-hacks.html#sec-1_6_1>

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Passing font size to exported LaTeX table
  2011-06-10 22:31                                       ` Suvayu Ali
  2011-06-13  1:38                                         ` suvayu ali
@ 2011-06-13  1:52                                         ` Nick Dokos
  2011-06-13  2:40                                           ` Suvayu Ali
  2011-06-13  3:45                                           ` Thomas S. Dye
  1 sibling, 2 replies; 217+ messages in thread
From: Nick Dokos @ 2011-06-13  1:52 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:

> Hello everyone,
> 
> On Wed, 1 Jun 2011 12:08:25 -0700
> Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:
> 
> > On Wed, 01 Jun 2011 14:50:34 -0400
> > Nick Dokos <nicholas.dokos@hp.com> wrote:
> > 
> > > <soapbox> I've tried to keep a neutral tone in (most of) the rest of
> > > the mail, but I have to say that I think clever hacks like this are
> > > too clever for their own good - they are at best an accident of
> > > implementation. The fact that the trick uses the placement option in
> > > order to change the font testifies to that.
> > 
> > After the very clear description above, I agree 100%. I will remove my
> > addition to the manual and instead try to improve the #+ATTR_LaTeX:
> > documentation based on your code commentary. At the moment I am
> > facing a very important deadline for the 8th of June, I will submit a
> > revised patch after that.
> > 
> 
> I have attached a patch removing the hack from the manual and making
> some other small improvements to the latex export of images. However I
> did leave in one sentence regarding the placement option which alludes
> that a hack is possible.
> 
> Please let me know if this is an improvement.
> 
> > > They should certainly be documented as hacks on Worg, but I'm not
> > > sure they should be documented in the manual. Of course, it may
> > > happen that a really good hack (by some definition of "really
> > > good") should be elevated to a standard and documented in the
> > > manual, but IMO this one does not qualify. </soapbox>
> > > 
> > 
> > Along with the revisions for the manual, I will document my hack on
> > Worg.
> 
> I made an account with repo.or.cz. I will soon push the changes
> documenting the hack on Worg.
> 
> -- 
> Suvayu
> 
> Open source is the future. It sets us free.
> >From 7f66dba736136fc1a2ee8e2d4fbce47e07db3ca6 Mon Sep 17 00:00:00 2001
> From: Suvayu Ali (ThinkPad) <fatkasuvayu+linux@gmail.com>
> Date: Fri, 10 Jun 2011 14:57:48 -0700
> Subject: [PATCH] Improve "Images in LaTeX export" documentation
> 
> * Mention use of keywords like multicolumn and float
> * Remove previous mention of hack with placement option
>   as per comments on the mailing list. Hack better
>   suited for Worg.
> ---
>  doc/org.texi |   30 ++++++++++++------------------
>  1 files changed, 12 insertions(+), 18 deletions(-)
> 
> diff --git a/doc/org.texi b/doc/org.texi
> index 92343de..c98bd53 100644
> --- a/doc/org.texi
> +++ b/doc/org.texi
> @@ -10207,24 +10207,14 @@ output file resulting from @LaTeX{} processing.  Org will use an
>  @code{\includegraphics} macro to insert the image.  If you have specified a
>  caption and/or a label as described in @ref{Images and tables}, the figure
>  will be wrapped into a @code{figure} environment and thus become a floating
> -element.  You can use an @code{#+ATTR_LaTeX:} line to specify the various
> -options that can be used in the optional argument of the
> -@code{\includegraphics} macro.  To modify the placement option of the
> -@code{figure} environment, add something like @samp{placement=[h!]} to the
> -Attributes. It is to be noted this option can be used with tables as well.
> -The options are passed as the placement option to floating environments like
> -@code{figure} or @code{table}. One can pass other compatible options as well.
> -For example the @code{#+ATTR_LaTeX:} line below is exported as the
> -@code{figure} environment below it.
> -
> -@cindex #+ATTR_LaTeX
> -@example
> -#+ATTR_LaTeX: placement=[<options>]\footnotesize
> -
> -\begin@{figure@}[<options>]\footnotesize
> -...
> -\end@{figure@}
> -@end example
> +element.  You can use an @code{#+ATTR_LaTeX:} line to specify various other
> +options.  You can ask org to export an image as a float without specifying
> +a label or a caption by using the keyword @code{float} in this line.  Various
> +optional arguments to the @code{\includegraphics} macro can also be specified
> +in this fashion.  To modify the placement option of the floating environment,
> +add something like @samp{placement=[h!]} to the attributes.  It is to be noted
> +this option can be used with tables as well.  One can also pass other
> +compatible options.
>  

The question here is: what does "compatible" mean? Compatible with what?
Now that you added the hack to Worg, it might be better to say: 

"One can also take advantage of this option to pass other, unrelated options
into the figure or table environment (see
[[http://orgmode.org/worg/org-hacks.html#sec-1_6_1][here]] for an example.)"

or something like that.


>  If you would like to let text flow around the image, add the word @samp{wrap}
>  to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left
> @@ -10246,6 +10236,10 @@ for @code{\includegraphics} and @code{wrapfigure}.
>  [[./img/hst.png]]
>  @end example
>  
> +If you wish to include an image which spans multiple columns in a page,
> +you can use the keyword @code{multicolumn} in the @code{#+ATTR_LaTeX}
> +line. This will export the image wrapped in a @code{figure*} environment.
> +
>  If you need references to a label created in this way, write
>  @samp{\ref@{fig:SED-HR4049@}} just like in @LaTeX{}.


Otherwise, this looks good to me.

Thanks,
Nick

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

* Re: Passing font size to exported LaTeX table
  2011-06-13  1:52                                         ` Nick Dokos
@ 2011-06-13  2:40                                           ` Suvayu Ali
  2011-06-13  3:29                                             ` Nick Dokos
  2011-06-13  3:45                                           ` Thomas S. Dye
  1 sibling, 1 reply; 217+ messages in thread
From: Suvayu Ali @ 2011-06-13  2:40 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Sebastien Vauban, emacs-orgmode

Hi Nick,

On Sun, 12 Jun 2011 21:52:51 -0400
Nick Dokos <nicholas.dokos@hp.com> wrote:

> The question here is: what does "compatible" mean? Compatible with
> what? Now that you added the hack to Worg, it might be better to say: 
> 
> "One can also take advantage of this option to pass other, unrelated
> options into the figure or table environment (see
> [[http://orgmode.org/worg/org-hacks.html#sec-1_6_1][here]] for an
> example.)"
> 
> or something like that.

Thanks for the comment.

I modified the patch as per your suggestion. For the link however,
instead of a direct link to the section I linked to the org hacks page
and named the section, just in case the section ordering changes in
the future for some reason.

Here is my submission:
<http://thread.gmane.org/gmane.emacs.orgmode/42776>

:)

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Passing font size to exported LaTeX table
  2011-06-13  2:40                                           ` Suvayu Ali
@ 2011-06-13  3:29                                             ` Nick Dokos
  0 siblings, 0 replies; 217+ messages in thread
From: Nick Dokos @ 2011-06-13  3:29 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:

> Hi Nick,
> 
> On Sun, 12 Jun 2011 21:52:51 -0400
> Nick Dokos <nicholas.dokos@hp.com> wrote:
> 
> > The question here is: what does "compatible" mean? Compatible with
> > what? Now that you added the hack to Worg, it might be better to say: 
> > 
> > "One can also take advantage of this option to pass other, unrelated
> > options into the figure or table environment (see
> > [[http://orgmode.org/worg/org-hacks.html#sec-1_6_1][here]] for an
> > example.)"
> > 
> > or something like that.
> 
> Thanks for the comment.
> 
> I modified the patch as per your suggestion. For the link however,
> instead of a direct link to the section I linked to the org hacks page
> and named the section, just in case the section ordering changes in
> the future for some reason.
> 
> Here is my submission:
> <http://thread.gmane.org/gmane.emacs.orgmode/42776>
> 
> :)
> 

Looks good to me.

Thanks,
Nick

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

* Re: Passing font size to exported LaTeX table
  2011-06-13  1:52                                         ` Nick Dokos
  2011-06-13  2:40                                           ` Suvayu Ali
@ 2011-06-13  3:45                                           ` Thomas S. Dye
  2011-06-13  4:27                                             ` Nick Dokos
  1 sibling, 1 reply; 217+ messages in thread
From: Thomas S. Dye @ 2011-06-13  3:45 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Sebastien Vauban, emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> writes:

> Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:
>
>> Hello everyone,
>> 
>> On Wed, 1 Jun 2011 12:08:25 -0700
>> Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:
>> 
>> > On Wed, 01 Jun 2011 14:50:34 -0400
>> > Nick Dokos <nicholas.dokos@hp.com> wrote:
>> > 
>> > > <soapbox> I've tried to keep a neutral tone in (most of) the rest of
>> > > the mail, but I have to say that I think clever hacks like this are
>> > > too clever for their own good - they are at best an accident of
>> > > implementation. The fact that the trick uses the placement option in
>> > > order to change the font testifies to that.
>> > 
>> > After the very clear description above, I agree 100%. I will remove my
>> > addition to the manual and instead try to improve the #+ATTR_LaTeX:
>> > documentation based on your code commentary. At the moment I am
>> > facing a very important deadline for the 8th of June, I will submit a
>> > revised patch after that.
>> > 
>> 
>> I have attached a patch removing the hack from the manual and making
>> some other small improvements to the latex export of images. However I
>> did leave in one sentence regarding the placement option which alludes
>> that a hack is possible.
>> 
>> Please let me know if this is an improvement.
>> 
>> > > They should certainly be documented as hacks on Worg, but I'm not
>> > > sure they should be documented in the manual. Of course, it may
>> > > happen that a really good hack (by some definition of "really
>> > > good") should be elevated to a standard and documented in the
>> > > manual, but IMO this one does not qualify. </soapbox>
>> > > 
>> > 
>> > Along with the revisions for the manual, I will document my hack on
>> > Worg.
>> 
>> I made an account with repo.or.cz. I will soon push the changes
>> documenting the hack on Worg.
>> 
>> -- 
>> Suvayu
>> 
>> Open source is the future. It sets us free.
>> >From 7f66dba736136fc1a2ee8e2d4fbce47e07db3ca6 Mon Sep 17 00:00:00 2001
>> From: Suvayu Ali (ThinkPad) <fatkasuvayu+linux@gmail.com>
>> Date: Fri, 10 Jun 2011 14:57:48 -0700
>> Subject: [PATCH] Improve "Images in LaTeX export" documentation
>> 
>> * Mention use of keywords like multicolumn and float
>> * Remove previous mention of hack with placement option
>>   as per comments on the mailing list. Hack better
>>   suited for Worg.
>> ---
>>  doc/org.texi |   30 ++++++++++++------------------
>>  1 files changed, 12 insertions(+), 18 deletions(-)
>> 
>> diff --git a/doc/org.texi b/doc/org.texi
>> index 92343de..c98bd53 100644
>> --- a/doc/org.texi
>> +++ b/doc/org.texi
>> @@ -10207,24 +10207,14 @@ output file resulting from @LaTeX{} processing.  Org will use an
>>  @code{\includegraphics} macro to insert the image.  If you have specified a
>>  caption and/or a label as described in @ref{Images and tables}, the figure
>>  will be wrapped into a @code{figure} environment and thus become a floating
>> -element.  You can use an @code{#+ATTR_LaTeX:} line to specify the various
>> -options that can be used in the optional argument of the
>> -@code{\includegraphics} macro.  To modify the placement option of the
>> -@code{figure} environment, add something like @samp{placement=[h!]} to the
>> -Attributes. It is to be noted this option can be used with tables as well.
>> -The options are passed as the placement option to floating environments like
>> -@code{figure} or @code{table}. One can pass other compatible options as well.
>> -For example the @code{#+ATTR_LaTeX:} line below is exported as the
>> -@code{figure} environment below it.
>> -
>> -@cindex #+ATTR_LaTeX
>> -@example
>> -#+ATTR_LaTeX: placement=[<options>]\footnotesize
>> -
>> -\begin@{figure@}[<options>]\footnotesize
>> -...
>> -\end@{figure@}
>> -@end example
>> +element.  You can use an @code{#+ATTR_LaTeX:} line to specify various other
>> +options.  You can ask org to export an image as a float without specifying
>> +a label or a caption by using the keyword @code{float} in this line.  Various
>> +optional arguments to the @code{\includegraphics} macro can also be specified
>> +in this fashion.  To modify the placement option of the floating environment,
>> +add something like @samp{placement=[h!]} to the attributes.  It is to be noted
>> +this option can be used with tables as well.  One can also pass other
>> +compatible options.
>>  
>
> The question here is: what does "compatible" mean? Compatible with what?
> Now that you added the hack to Worg, it might be better to say: 
>
> "One can also take advantage of this option to pass other, unrelated options
> into the figure or table environment (see
> [[http://orgmode.org/worg/org-hacks.html#sec-1_6_1][here]] for an example.)"
>
> or something like that.
>
>
>>  If you would like to let text flow around the image, add the word @samp{wrap}
>>  to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left
>> @@ -10246,6 +10236,10 @@ for @code{\includegraphics} and @code{wrapfigure}.
>>  [[./img/hst.png]]
>>  @end example
>>  
>> +If you wish to include an image which spans multiple columns in a page,
>> +you can use the keyword @code{multicolumn} in the @code{#+ATTR_LaTeX}
>> +line. This will export the image wrapped in a @code{figure*} environment.
>> +
>>  If you need references to a label created in this way, write
>>  @samp{\ref@{fig:SED-HR4049@}} just like in @LaTeX{}.
>
>
> Otherwise, this looks good to me.
>
> Thanks,
> Nick
>
>
>

Nick's got a good editorial eye: "compatible options" is probably not
correct.  In the example on Worg hacks, \footnotesize is not an optional
argument to the \table environment, it is a LaTeX command whose scope is
determined by the \table environment within which it is issued.  So,
instead of "One can also pass other compatible options" it would be good
to say "One can also pass LaTeX commands into the \table environment" or
something along those lines.

The entry in Worg hacks looks good to me.  Thanks for taking care of
this, Suvayu.

Many thanks to Nick and Suvayu for figuring out how to get inside the
table environment from Org-mode.  I can't remember how many times I
tried and failed to figure this out on my own ...

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

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

* Re: Passing font size to exported LaTeX table
  2011-06-13  3:45                                           ` Thomas S. Dye
@ 2011-06-13  4:27                                             ` Nick Dokos
  2011-06-13  4:56                                               ` Suvayu Ali
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2011-06-13  4:27 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Sebastien Vauban, emacs-orgmode, nicholas.dokos

Thomas S. Dye <tsd@tsdye.com> wrote:

> Nick's got a good editorial eye: "compatible options" is probably not
> correct.  In the example on Worg hacks, \footnotesize is not an optional
> argument to the \table environment, it is a LaTeX command whose scope is
> determined by the \table environment within which it is issued.  So,
> instead of "One can also pass other compatible options" it would be good
> to say "One can also pass LaTeX commands into the \table environment" or
> something along those lines.
> 
> The entry in Worg hacks looks good to me.  Thanks for taking care of
> this, Suvayu.
> 
> Many thanks to Nick and Suvayu for figuring out how to get inside the
> table environment from Org-mode.  I can't remember how many times I
> tried and failed to figure this out on my own ...
> 

Now that the Worg entry exists, I'd like to expand it a bit to add
essentially what Tom mentions in his first paragraph and also to add a
pointer to the "other" solution of this problem.

Suvauy, is that OK with you? Or would you rather I created a
separate hack?

Nick

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

* Re: Passing font size to exported LaTeX table
  2011-06-13  4:27                                             ` Nick Dokos
@ 2011-06-13  4:56                                               ` Suvayu Ali
  2011-06-13  5:29                                                 ` Nick Dokos
  0 siblings, 1 reply; 217+ messages in thread
From: Suvayu Ali @ 2011-06-13  4:56 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Sebastien Vauban, emacs-orgmode

Hi Nick and Tom,

On Mon, 13 Jun 2011 00:27:31 -0400
Nick Dokos <nicholas.dokos@hp.com> wrote:

> Thomas S. Dye <tsd@tsdye.com> wrote:
> 
> > Nick's got a good editorial eye: "compatible options" is probably
> > not correct.  In the example on Worg hacks, \footnotesize is not an
> > optional argument to the \table environment, it is a LaTeX command
> > whose scope is determined by the \table environment within which it
> > is issued.  So, instead of "One can also pass other compatible
> > options" it would be good to say "One can also pass LaTeX commands
> > into the \table environment" or something along those lines.
> > 
> > The entry in Worg hacks looks good to me.  Thanks for taking care of
> > this, Suvayu.
> > 
> > Many thanks to Nick and Suvayu for figuring out how to get inside
> > the table environment from Org-mode.  I can't remember how many
> > times I tried and failed to figure this out on my own ...
> > 
> 
> Now that the Worg entry exists, I'd like to expand it a bit to add
> essentially what Tom mentions in his first paragraph and also to add a
> pointer to the "other" solution of this problem.
> 

I have modified the Worg entry like this

*** Specifying LaTeX commands to floating environments

The keyword ~placement~ can be used to specify placement options to
floating environments (like =\begin{figure}= and =\begin{table}=}) in
LaTeX export. Org passes along everything passed in options as long as
there are no spaces. One can take advantage of this to pass other
LaTeX commands limited within the scope of the floating environment.

For example one can set the fontsize of a table different from the
rest of the document by putting something like =\footnotesize= right
after the placement options. During LaTeX export using the
~#+ATTR_LaTeX:~ line below:

#+begin_src org
  ,#+ATTR_LaTeX: placement=[<options>]\footnotesize
#+end_src

exports the associated floating environment as shown in the following
block.

#+begin_src latex
\begin{table}[<options>]\footnotesize
...
\end{table}
#+end_src

If both of you agree and there is no important detail or subtlety
missing, I will commit this to Worg.

> Suvauy, is that OK with you? Or would you rather I created a
> separate hack?
> 

Worg is a community resource. I would definitely be okay with and
encourage others improving upon whatever I contribute. :)

> Nick
> 


-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Passing font size to exported LaTeX table
  2011-06-13  4:56                                               ` Suvayu Ali
@ 2011-06-13  5:29                                                 ` Nick Dokos
  2011-06-13  6:42                                                   ` Suvayu Ali
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2011-06-13  5:29 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: Sebastien Vauban, nicholas.dokos, emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:

> Hi Nick and Tom,
> 
> On Mon, 13 Jun 2011 00:27:31 -0400
> Nick Dokos <nicholas.dokos@hp.com> wrote:
> 
> > Thomas S. Dye <tsd@tsdye.com> wrote:
> > 
> > > Nick's got a good editorial eye: "compatible options" is probably
> > > not correct.  In the example on Worg hacks, \footnotesize is not an
> > > optional argument to the \table environment, it is a LaTeX command
> > > whose scope is determined by the \table environment within which it
> > > is issued.  So, instead of "One can also pass other compatible
> > > options" it would be good to say "One can also pass LaTeX commands
> > > into the \table environment" or something along those lines.
> > > 
> > > The entry in Worg hacks looks good to me.  Thanks for taking care of
> > > this, Suvayu.
> > > 
> > > Many thanks to Nick and Suvayu for figuring out how to get inside
> > > the table environment from Org-mode.  I can't remember how many
> > > times I tried and failed to figure this out on my own ...
> > > 
> > 
> > Now that the Worg entry exists, I'd like to expand it a bit to add
> > essentially what Tom mentions in his first paragraph and also to add a
> > pointer to the "other" solution of this problem.
> > 
> 
> I have modified the Worg entry like this
> 
> *** Specifying LaTeX commands to floating environments
> 
> The keyword ~placement~ can be used to specify placement options to
> floating environments (like =\begin{figure}= and =\begin{table}=}) in
> LaTeX export. Org passes along everything passed in options as long as
> there are no spaces. One can take advantage of this to pass other
> LaTeX commands limited within the scope of the floating environment.
> 

I'd rewrite this last line slightly - the scope belongs to the command and
the environment withing which the command is placed, limits the scope of the
command:

"...LaTeX commands and have their scope limited to the floating environment."

> For example one can set the fontsize of a table different from the
> rest of the document by putting something like =\footnotesize= right

This is not quite right: the fontsize in the table is by default set to
normal size, but the rest of the document does not have to be normal
size. I suggest

"...For example one can set the fontsize of a table different from the
default normal size by putting something like =\footnotesize= right..."

> after the placement options. During LaTeX export using the
> ~#+ATTR_LaTeX:~ line below:
> 
> #+begin_src org
>   ,#+ATTR_LaTeX: placement=[<options>]\footnotesize
> #+end_src
> 
> exports the associated floating environment as shown in the following
> block.
> 
> #+begin_src latex
> \begin{table}[<options>]\footnotesize
> ...
> \end{table}
> #+end_src
> 
> If both of you agree and there is no important detail or subtlety
> missing, I will commit this to Worg.
> 

Otherwise, looks good.

> > Suvauy, is that OK with you? Or would you rather I created a
> > separate hack?
> > 
> 
> Worg is a community resource. I would definitely be okay with and
> encourage others improving upon whatever I contribute. :)
> 

But common courtesy dictates that I should at least ask :-) In any case,
I'm planning to post to the ML for review whatever changes I come up
with.

Thanks,
Nick

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

* Re: Passing font size to exported LaTeX table
  2011-06-13  5:29                                                 ` Nick Dokos
@ 2011-06-13  6:42                                                   ` Suvayu Ali
  0 siblings, 0 replies; 217+ messages in thread
From: Suvayu Ali @ 2011-06-13  6:42 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Sebastien Vauban, emacs-orgmode

Hi Nick,

On Mon, 13 Jun 2011 01:29:03 -0400
Nick Dokos <nicholas.dokos@hp.com> wrote:

> > LaTeX commands limited within the scope of the floating environment.
> >   
> 
> I'd rewrite this last line slightly - the scope belongs to the
> command and the environment withing which the command is placed,
> limits the scope of the command:
> 
> "...LaTeX commands and have their scope limited to the floating
> environment."
> 
> > For example one can set the fontsize of a table different from the
> > rest of the document by putting something like =\footnotesize=
> > right  
> 
> This is not quite right: the fontsize in the table is by default set
> to normal size, but the rest of the document does not have to be
> normal size. I suggest
> 
> "...For example one can set the fontsize of a table different from the
> default normal size by putting something like =\footnotesize=
> right..."
>

Done and pushed. :)

> Thanks,
> Nick
> 

Thanks for the comments,

-- 
Suvayu

Open source is the future. It sets us free.

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

* BUG: Newest org-mode interferes with desktop save
@ 2011-06-15 10:29 Rainer M Krug
  2011-06-15 16:49 ` Eric Schulte
  0 siblings, 1 reply; 217+ messages in thread
From: Rainer M Krug @ 2011-06-15 10:29 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

Hi

when using the newest version of org-mode (Org-mode version 7.5
(release_7.5.391.gfacc)), I get the following warning when closing emacs,

"Current desktop was not loaded from a file. Overwrite this desktop file?"

although it has loaded the desktop file. When I use 7.5 (and te one from I
guess yesterday), the message did not occur.

I have (desktop-save-mode 1) on my emacs.org.


Cheers,

Rainer

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax (F):       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug

[-- Attachment #2: Type: text/html, Size: 1119 bytes --]

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

* Re: BUG: Newest org-mode interferes with desktop save
  2011-06-15 10:29 BUG: Newest org-mode interferes with desktop save Rainer M Krug
@ 2011-06-15 16:49 ` Eric Schulte
  2011-06-15 17:35   ` Nick Dokos
  2011-06-15 18:21   ` Rainer M Krug
  0 siblings, 2 replies; 217+ messages in thread
From: Eric Schulte @ 2011-06-15 16:49 UTC (permalink / raw)
  To: Rainer M Krug; +Cc: emacs-orgmode

Hi Rainer,

I was able to reproduce this query-on-close behavior with the following
minimal config.

#+begin_src sh
  emacs -Q -l ~/.emacs.d/src/org/lisp/org.el --eval "(desktop-save-mode 1)"
#+end_src

however, I think this prompting behavior is expected, and when I
switched to the following alternative

#+begin_src sh
  emacs -Q -l ~/.emacs.d/src/org/lisp/org.el --eval '(desktop-read "~/Desktop/")'
#+end_src

I received no prompt on exit.  As far as I can tell there is not an
Org-mode bug here, however I could very well have missed something.

Cheers -- Eric

Rainer M Krug <r.m.krug@gmail.com> writes:

> Hi
>
> when using the newest version of org-mode (Org-mode version 7.5
> (release_7.5.391.gfacc)), I get the following warning when closing emacs,
>
> "Current desktop was not loaded from a file. Overwrite this desktop file?"
>
> although it has loaded the desktop file. When I use 7.5 (and te one from I
> guess yesterday), the message did not occur.
>
> I have (desktop-save-mode 1) on my emacs.org.
>
>
> Cheers,
>
> Rainer

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

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

* Re: BUG: Newest org-mode interferes with desktop save
  2011-06-15 16:49 ` Eric Schulte
@ 2011-06-15 17:35   ` Nick Dokos
  2011-06-15 18:23     ` Rainer M Krug
  2011-06-15 18:21   ` Rainer M Krug
  1 sibling, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2011-06-15 17:35 UTC (permalink / raw)
  To: Eric Schulte; +Cc: nicholas.dokos, emacs-orgmode

Eric Schulte <schulte.eric@gmail.com> wrote:


> I was able to reproduce this query-on-close behavior with the following
> minimal config.
> 
> #+begin_src sh
>   emacs -Q -l ~/.emacs.d/src/org/lisp/org.el --eval "(desktop-save-mode 1)"
> #+end_src
> 
> however, I think this prompting behavior is expected, and when I
> switched to the following alternative
> 
> #+begin_src sh
>   emacs -Q -l ~/.emacs.d/src/org/lisp/org.el --eval '(desktop-read "~/Desktop/")'
> #+end_src
> 
> I received no prompt on exit.  As far as I can tell there is not an
> Org-mode bug here, however I could very well have missed something.
> 

> Rainer M Krug <r.m.krug@gmail.com> writes:
> 
> > when using the newest version of org-mode (Org-mode version 7.5
> > (release_7.5.391.gfacc)), I get the following warning when closing emacs,
> >
> > "Current desktop was not loaded from a file. Overwrite this desktop file?"
> >
> > although it has loaded the desktop file. When I use 7.5 (and te one from I
> > guess yesterday), the message did not occur.
> >
> > I have (desktop-save-mode 1) on my emacs.org.
> >


Maybe this will help?

,----
| desktop-save is a variable defined in `desktop.el'.
| Its value is ask-if-new
| 
| Documentation:
| Specifies whether the desktop should be saved when it is killed.
| A desktop is killed when the user changes desktop or quits Emacs.
| Possible values are:
|    t             -- always save.
|    ask           -- always ask.
|    ask-if-new    -- ask if no desktop file exists, otherwise just save.
|    ask-if-exists -- ask if desktop file exists, otherwise don't save.
|    if-exists     -- save if desktop file exists, otherwise don't save.
|    nil           -- never save.
| The desktop is never saved when `desktop-save-mode' is nil.
| The variables `desktop-dirname' and `desktop-base-file-name'
| determine where the desktop is saved.
`----

Nick

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

* Re: BUG: Newest org-mode interferes with desktop save
  2011-06-15 16:49 ` Eric Schulte
  2011-06-15 17:35   ` Nick Dokos
@ 2011-06-15 18:21   ` Rainer M Krug
  2011-06-15 18:31     ` Eric Schulte
  1 sibling, 1 reply; 217+ messages in thread
From: Rainer M Krug @ 2011-06-15 18:21 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2329 bytes --]

On Wed, Jun 15, 2011 at 6:49 PM, Eric Schulte <schulte.eric@gmail.com>wrote:

> Hi Rainer,
>
> I was able to reproduce this query-on-close behavior with the following
> minimal config.
>
> #+begin_src sh
>  emacs -Q -l ~/.emacs.d/src/org/lisp/org.el --eval "(desktop-save-mode 1)"
> #+end_src
>
> however, I think this prompting behavior is expected, and when I
> switched to the following alternative
>
> #+begin_src sh
>  emacs -Q -l ~/.emacs.d/src/org/lisp/org.el --eval '(desktop-read
> "~/Desktop/")'
> #+end_src
>
> I received no prompt on exit.  As far as I can tell there is not an
> Org-mode bug here, however I could very well have missed something.
>

I can not reproduce your example, as I am getting an "can not open
org-entities", but have you tried it with org-mode 7.5 as well as the newest
git? My point is, that up to a recent git version (probably yesterday), this
question was *not* there, but it is there at with the newest git version.

I agree, that emacs should ask where to save if there is no .emacs.desktop
 if where to save the desktop file, but the final question

"Current desktop was not loaded from a file. Overwrite this desktop file?"

(which I did not see in your example) should not be there as the desktop
file was definitely loaded. I attache my emacs.org file for reference.

Hope this clarifies the issue,
Rainer


> Cheers -- Eric
>
> Rainer M Krug <r.m.krug@gmail.com> writes:
>
> > Hi
> >
> > when using the newest version of org-mode (Org-mode version 7.5
> > (release_7.5.391.gfacc)), I get the following warning when closing emacs,
> >
> > "Current desktop was not loaded from a file. Overwrite this desktop
> file?"
> >
> > although it has loaded the desktop file. When I use 7.5 (and te one from
> I
> > guess yesterday), the message did not occur.
> >
> > I have (desktop-save-mode 1) on my emacs.org.
> >
> >
> > Cheers,
> >
> > Rainer
>
> --
> Eric Schulte
> http://cs.unm.edu/~eschulte/
>



-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax (F):       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug

[-- Attachment #1.2: Type: text/html, Size: 3451 bytes --]

[-- Attachment #2: emacs.org --]
[-- Type: application/octet-stream, Size: 42920 bytes --]

#+TITLE: .emacs file 
#+AUTHOR:    Rainer M Krug
#+EMAIL:     rkrug@ecolmod
#+DATE:      2010-09-17 Fri
#+DESCRIPTION: 
#+KEYWORDS: 
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:nil -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:   
#+LINK_HOME: 
#+XSLT: 
##+OPTIONS: toc:nil num:nil ^:nil 

#+LATEX_HEADER: \usepackage[landscape, top=0.5in,bottom=0.5in,left=0.75in,right=0.75in]{geometry}

* General settings
** Save desktop
#+begin_src emacs-lisp
  (desktop-save-mode 1)
#+end_src
** Do not show font locking messages
#+begin_src emacs-lisp
  '(font-lock-verbose nil)
#+end_src
** COMMENT Autosave desktop every hour
#+begin_src emacs-lisp :tangle no
  (run-at-time "00:59" 3600 'org-save-all-org-buffers)
#+end_src
** Search path definitions
#+begin_src emacs-lisp
  (add-to-list 'load-path "~/.emacs.d/site-lisp")
#+end_src
* COMMENT Load markchars
#+begin_src emacs-lisp :tangle no
  (load "~/.emacs.d/nxhtml/autostart.el")
  
#+end_src
* COMMENT CEDET
  See cedet/common/cedet.info for configuration details.
#+begin_src emacs-lisp :tangle no
   (add-to-list 'load-path "~/.emacs.d/cedet")
   (load-file "~/.emacs.d/cedet/common/cedet.el")
#+end_src
  Optional other options
#+begin_src emacs-lisp :tangle no
  ;; Enable EDE (Project Management) features
  (global-ede-mode 1)

  ;; Enable EDE for a pre-existing C++ project
  ;; (ede-cpp-root-project "NAME" :file "~/myproject/Makefile")


  ;; Enabling Semantic (code-parsing, smart completion) features
  ;; Select one of the following:

  ;; * This enables the database and idle reparse engines
  ; (semantic-load-enable-minimum-features)

  ;; * This enables some tools useful for coding, such as summary mode
  ;;   imenu support, and the semantic navigator
  ; (semantic-load-enable-code-helpers)

  ;; * This enables even more coding tools such as intellisense mode
  ;;   decoration mode, and stickyfunc mode (plus regular code helpers)
  ;; (semantic-load-enable-gaudy-code-helpers)

  ;; * This enables the use of Exuberent ctags if you have it installed.
  ;;   If you use C++ templates or boost, you should NOT enable it.
  ;; (semantic-load-enable-all-exuberent-ctags-support)

  ;; Enable SRecode (Template management) minor-mode.
  (global-srecode-minor-mode 1)
#+end_src
* COMMENT Ecb 
#+begin_src emacs-lisp :tangle no
  (add-to-list 'load-path "~/.emacs.d/ecb")
  (require 'ecb-autoloads)
  (setq ecb-layout-name "left3")
  (setq ecb-layout-window-sizes (quote (("left8" (0.23076923076923078 . 0.23333333333333334) (0.23076923076923078 . 0.25) (0.23076923076923078 . 0.2833333333333333) (0.23076923076923078 . 0.21666666666666667)) ("left3" (0.22162162162162163 . 0.10344827586206896) (0.22162162162162163 . 0.46551724137931033) (0.22162162162162163 . 0.41379310344827586)))))
  (setq ecb-options-version "2.32")
  (setq ecb-toggle-layout-sequence (quote ("left9" "left14" "left3")))
#+end_src
* ESS
** Load ess
#+begin_src emacs-lisp
  (add-to-list 'load-path "~/.emacs.d/ess")
  (load "~/.emacs.d/ess/lisp/ess-site")
  (require 'ess-site)
#+end_src
** ESS help
*** kill "bogus" help buffers
#+begin_src emacs-lisp
  (setq ess-help-kill-bogus-buffers t)
#+end_src 
*** all help in one window and in own frame
#+begin_src emacs-lisp
(setq ess-help-own-frame 'one)
#+end_src 

** Add highlighting for certain keywords
#+begin_src emacs-lisp
  (font-lock-add-keywords 'ess-mode
   '(("\\<\\(FIXME\\|TODO\\|COMMENT\\|DONE\\|CHANGES\\|FIXED\\)\\>" 1 font-lock-warning-face prepend)))
#+end_src
** Further customisations
#+begin_src emacs-lisp
  (setq inferior-R-args "--vanilla")
  (setq ess-eval-visibly-p nil)
  (setq inferior-ess-same-window t)
  (setq inferior-ess-client-command "Initial")
  (setq inferior-ess-own-frame nil)
  (setq ess-ask-for-ess-directory nil)
#+end_src
** r-utils
#+begin_src emacs-lisp
   (require 'r-utils)
#+end_src
** R-object tooltips
based on [[http://blogisticreflections.wordpress.com/2009/10/01/r-object-tooltips-in-ess/]]
Here are the comments as on the website:
;; ess-R-object-tooltip.el
;; 
;; I have defined a function, ess-R-object-tooltip, that when
;; invoked, will return a tooltip with some information about
;; the object at point.  The information returned is
;; determined by which R function is called.  This is controlled
;; by an alist, called ess-R-object-tooltip-alist.  The default is
;; given below.  The keys are the classes of R object that will
;; use the associated function.  For example, when the function
;; is called while point is on a factor object, a table of that
;; factor will be shown in the tooltip.  The objects must of course
;; exist in the associated inferior R process for this to work.
;; The special key "other" in the alist defines which function
;; to call when the class is not mached in the alist.  By default,
;; the str function is called, which is actually a fairly useful
;; default for data.frame and function objects.
;; 
;; The last line of this file shows my default keybinding.
;; I simply save this file in a directory in my load-path
;; and then place (require 'ess-R-object-tooltip) in my .emacs
#+begin_src emacs-lisp
  ;; the alist
  (setq ess-R-object-tooltip-alist
        '((numeric    . "summary")
          (factor     . "table")
          (integer    . "summary")
          (lm         . "summary")
          (other      . "str")))
  
  (defun ess-R-object-tooltip ()
    "Get info for object at point, and display it in a tooltip."
    (interactive)
    (let ((objname (current-word))
          (curbuf (current-buffer))
          (tmpbuf (get-buffer-create "**ess-R-object-tooltip**")))
      (if objname
          (progn
            (ess-command (concat "class(" objname ")\n")  tmpbuf )
            (set-buffer tmpbuf)
            (let ((bs (buffer-string)))
              (if (not(string-match "\(object .* not found\)\|unexpected" bs))
                  (let* ((objcls (buffer-substring
                                  (+ 2 (string-match "\".*\"" bs))
                                  (- (point-max) 2)))
                         (myfun (cdr(assoc-string objcls
                                                  ess-R-object-tooltip-alist))))
                    (progn
                      (if (eq myfun nil)
                          (setq myfun
                                (cdr(assoc-string "other"
                                                  ess-R-object-tooltip-alist))))
                      (ess-command (concat myfun "(" objname ")\n") tmpbuf)
                      (let ((bs (buffer-string)))
                        (progn
                          (set-buffer curbuf)
                          (tooltip-show-at-point bs 0 30)))))))))
      (kill-buffer tmpbuf)))
  
  ;; key map for R files and inferior mode
  (define-key ess-mode-map "\C-c\C-g" 'ess-R-object-tooltip)
  (define-key inferior-ess-mode-map "\C-c\C-g" 'ess-R-object-tooltip)
  
  (provide 'ess-R-object-tooltip)
#+end_src
** Shift Enter
From [[http://www.emacswiki.org/emacs/ESSShiftEnter]]
- if R if not running, it starts automatically and opens an inferior frame
- if the region is active, evaluates the region
- otherwise, it runs the current line
#+begin_src emacs-lisps
  (setq ess-ask-for-ess-directory nil)
  (setq ess-local-process-name "R")
  (setq ansi-color-for-comint-mode 'filter)
  (setq comint-prompt-read-only t)
  (setq comint-scroll-to-bottom-on-input t)
  (setq comint-scroll-to-bottom-on-output t)
  (setq comint-move-point-for-output t)
  (defun my-ess-start-R ()
    (interactive)
    (if (not (member "*R*" (mapcar (function buffer-name) (buffer-list))))
      (progn
	(delete-other-windows)
	(setq w1 (selected-window))
	(setq w1name (buffer-name))
	(setq w2 (split-window w1))
	(R)
	(set-window-buffer w2 "*R*")
	(set-window-buffer w1 w1name))))
  (defun my-ess-eval ()
    (interactive)
    (my-ess-start-R)
    (if (and transient-mark-mode mark-active)
	(call-interactively 'ess-eval-region)
      (call-interactively 'ess-eval-line-and-step)))
  (add-hook 'ess-mode-hook
	    '(lambda()
	       (local-set-key [(shift return)] 'my-ess-eval)))
  (add-hook 'inferior-ess-mode-hook
	    '(lambda()
	       (local-set-key [C-up] 'comint-previous-input)
	       (local-set-key [C-down] 'comint-next-input)))
  (require 'ess-site)
#+end_src
** hideshow
  hideshow-org (http://github.com/secelis/hideshow-org/tree/master)
#+begin_src emacs-lisp
  (require 'hideshow)
  (require 'hideshow-org)
  (add-to-list 'hs-special-modes-alist
               '(ess-mode "{" "}" "/[*/]" nil
                          hs-c-like-adjust-block-beginning))
  (global-set-key "\C-ch" 'hs-org/minor-mode) ;; toggles hideshow-org
  ;; (add-hook 'ess-mode-hook 'hs-org/minor-mode) ;; starts for ESS files
  (add-hook 'ess-mode-hook '(lambda () (hs-org/minor-mode 1)))
#+end_src
** Additional syntax highlighting
#+begin_src emacs-lisp
  (add-hook 'ess-mode-hook
            '(lambda()
               (font-lock-add-keywords nil
                                       '(("\\<\\(if\\|for\\|function\\|return\\)\\>[\n[:blank:]]*(" 1
                                          font-lock-keyword-face) ; must go first to override highlighting below
                                         ("\\<\\([.A-Za-z][._A-Za-z0-9]*\\)[\n[:blank:]]*(" 1
                                          font-lock-function-name-face) ; highlight function names
                                         ("\\([(,]\\|[\n[:blank:]]*\\)\\([.A-Za-z][._A-Za-z0-9]*\\)[\n[:blank:]]*=[^=]" 2
                                          font-lock-reference-face) ;highlight argument names
                                         ))
               ))
#+end_src
** hideshow for ESS
#+begin_src emacs-lisp
  (autoload 'hideshowvis-enable "hideshowvis" "Highlight foldable regions")
  (dolist (hook (list 'emacs-lisp-mode-hook
  'ess-mode-hook))
  (add-hook hook 'hideshowvis-enable))
  (setq hs-special-modes-alist
  (cons '(ess-mode "{" "}" "#" nil nil) hs-special-modes-alist))

  (define-fringe-bitmap 'hs-marker [0 24 24 126 126 24 24 0])

  (defcustom hs-fringe-face 'hs-fringe-face
  "*Specify face used to highlight the fringe on hidden regions."
  :type 'face
  :group 'hideshow)

  (defface hs-fringe-face
  '((t (:foreground "#888" :box (:line-width 2 :color "grey75" :style released-button))))
  "Face used to highlight the fringe on folded regions"
  :group 'hideshow)

  (defcustom hs-face 'hs-face
  "*Specify the face to to use for the hidden region indicator"
  :type 'face
  :group 'hideshow)

  (defface hs-face
  '((t (:background "#ff8" :box t)))
  "Face to hightlight the ... area of hidden regions"
  :group 'hideshow)

  (defun display-code-line-counts (ov)
  (when (eq 'code (overlay-get ov 'hs))
  (let* ((marker-string "*fringe-dummy*")
  (marker-length (length marker-string))
  (display-string (format "(%d)..." (count-lines (overlay-start ov) (overlay-end ov))))
  )
  (overlay-put ov 'help-echo "Hiddent text. C-c,= to show")
  (put-text-property 0 marker-length 'display (list 'left-fringe 'hs-marker 'hs-fringe-face) marker-string)
  (overlay-put ov 'before-string marker-string)
  (put-text-property 0 (length display-string) 'face 'hs-face display-string)
  (overlay-put ov 'display display-string)
  )))

  (setq hs-set-up-overlay 'display-code-line-counts)
#+end_src

** eldoc
https://stat.ethz.ch/pipermail/ess-help/2010-June/006176.html for details
#+begin_src emacs-lisp
  (require 'ess-eldoc)
#+end_src
** COMMENT TODO Syntax highlighting for functions in R NOT WORKING
  based on https://mail.google.com/mail/#label/Lists%2FESS/125131ed24688970
  The following code needs to be run in R:
  
  obj <- do.call("c", sapply(c("package:base", "package:stats",
  "package:utils"), objects, all.names=TRUE))
  re <- "(^[^.[:alpha:][:digit:]]|<-|__)"  # to remove "weird" functions
  obj <- obj[-grep(re, obj)]
  fpath <- file.path(Sys.getenv("HOME"), ".emacs.d", "R-function-names.txt")
  write.table(obj, fpath, quote=FALSE, row.names=FALSE, col.names=FALSE)
  
  Read a whole file into list of lines
  Author: Xah Lee
  see http://xahlee.org/emacs/elisp_process_lines.html
#+begin_src emacs-lisp :tangle no
  (defun read-lines (file)
  "Return a list of lines in FILE."
  (with-temp-buffer
  (insert-file-contents file)
  (split-string
  (buffer-string) "\n" t)
  )
  )

  (add-hook 'ess-mode-hook
  '(lambda()
  (setq ess-my-extra-R-function-keywords
  (read-lines "~/.emacs.d/R-function-names.txt"))
  (setq ess-R-mode-font-lock-keywords
  (append ess-R-mode-font-lock-keywords
  (list (cons (concat "\\<" (regexp-opt
  ess-my-extra-R-function-keywords 'enc-paren) "\\>")
  'font-lock-function-name-face))))))
#+end_src
* ess-tracebugs
** load ess-tracebug and activate
#+begin_src emacs-lisp
  (require 'ess-tracebug)
  (add-hook 'ess-post-run-hook 'ess-tracebug t)
#+end_src

** Error Tracing
#+begin_src emacs-lisp
  (define-key ess-mode-map "\M-]" 'next-error)
  (define-key ess-mode-map "\M-[" 'previous-error)
  (define-key inferior-ess-mode-map "\M-]" 'next-error-no-select)
  (define-key inferior-ess-mode-map "\M-[" 'previous-error-no-select)
#+end_src

** Tracebug Buffer  
#+begin_src emacs-lisp
  (define-key compilation-minor-mode-map [(?n)] 'next-error-no-select)
  (define-key compilation-minor-mode-map [(?p)] 'previous-error-no-select)
#+end_src

** Visual Debugger
*** COMMENT Own Breakpoints
#+begin_src emacs-lisp :tangle no
  (conc ess-bp-type-spec-alist
        '((my-browser "browser(expr = exists(\"a\") && a>.5)"
                      "My-Br>\n"
                      question-mark
                      font-lock-doc-face)))
#+end_src
* R-autoyas
R-autoyas is a small ESS complement. It provides automatically created yasnippets for R function argument lists.
Watch the demo screencast: http://www.youtube.com/watch?v=jLJPorf2LBE
Details can be found [[http://www.svenhartenstein.de/Software/R-autoyas/]].
** COMMENT Loading and Key bindings
#+begin_src emacs-lisp :tangle no
  (add-hook 'ess-mode-hook
            '(lambda ()
               (load "~/.emacs.d/plugins/r-autoyas.el")))
  (define-key ess-mode-map (kbd "C-M-<tab>")
    '(lambda ()(interactive)
       (r-autoyas-expand nil nil)))
#+end_src

* COMMENT Graphviz
Load graphviz-dot-mode
#+begin_src emacs-lisp :tangle no
  (load-file "~/emacs/graphviz-dot-mode.el") 
  (setq graphviz-dot-view-command "display %s")
#+end_src
* SSH Major mode
#+begin_src emacs-lisp
  (load-file "/home/rkrug/.emacs.d/site-lisp/ssh.el") 
#+end_src
* COMMENT Bookmark (bm)
#+begin_src emacs-lisp :tangle no
  (setq bm-restore-repository-on-load t)
  (require 'bm)
  (global-set-key (kbd "<f2>") 'bm-toggle)
  (global-set-key (kbd "<C-f2>")   'bm-next)
  (global-set-key (kbd "<s-f2>") 'bm-previous)
  
  ;; make bookmarks persistent as default
  (setq-default bm-buffer-persistence t)
  
  ;; Loading the repository from file when on start up.
  (add-hook' after-init-hook 'bm-repository-load)
  
  ;; Restoring bookmarks when on file find.
  (add-hook 'find-file-hooks 'bm-buffer-restore)
  
  ;; Saving bookmark data on killing a buffer
  (add-hook 'kill-buffer-hook 'bm-buffer-save)
  
  ;; Saving the repository to file when on exit.
  ;; kill-buffer-hook is not called when emacs is killed, so we
  ;; must save all bookmarks first.
  (add-hook 'kill-emacs-hook '(lambda nil
                                (bm-buffer-save-all)
                                (bm-repository-save)))
#+end_src
* COMMENT anything
#+begin_src emacs-lisp :tangle no
  (require 'anything)
  (require 'anything-config)
  (require 'recentf)
  
  (global-set-key [f11] 'anything)
  (remove-hook 'kill-emacs-hook 'anything-c-adaptive-save-history)
#+end_src
** R objects
#+begin_src emacs-lisps
  (setq anything-c-source-R-help
  '((name . "R objects / help")
  (init . (lambda ()
  ; this grabs the process name associated with the buffer
  (setq anything-c-ess-local-process-name ess-local-process-name)))
  (candidates . (lambda ()
  (condition-case nil
  (ess-get-object-list anything-c-ess-local-process-name)
  (error nil))))
  (action
  ("help" . ess-display-help-on-object)
  ("head (10)" . (lambda(obj-name)
  (ess-execute (concat "head(" obj-name ", n = 10)\n") nil (concat "R head: " obj-name))))
  ("head (100)" . (lambda(obj-name)
  (ess-execute (concat "head(" obj-name ", n = 100)\n") nil (concat "R head: " obj-name))))
  ("tail" . (lambda(obj-name)
  (ess-execute (concat "tail(" obj-name ", n = 10)\n") nil (concat "R tail: " obj-name))))
  ("str" . (lambda(obj-name)
  (ess-execute (concat "str(" obj-name ")\n") nil (concat "R str: " obj-name))))
  ("summary" . (lambda(obj-name)
  (ess-execute (concat "summary(" obj-name ")\n") nil (concat "R summary: " obj-name))))
  ("view source" . (lambda(obj-name)
  (ess-execute (concat "print(" obj-name ")\n") nil (concat "R object: " obj-name))))
  ("dput" . (lambda(obj-name)
  (ess-execute (concat "dput(" obj-name ")\n") nil (concat "R dput: " obj-name)))))
  (volatile)))
#+end_src
** R local objects
#+begin_src emacs-lisps
  (setq anything-c-source-R-local
  '((name . "R local objects")
  (init . (lambda ()
  ; this grabs the process name associated with the buffer
  (setq anything-c-ess-local-process-name ess-local-process-name)
  ; this grabs the buffer for later use
  (setq anything-c-ess-buffer (current-buffer))))
  (candidates . (lambda ()
  (let (buf)
  (condition-case nil
  (with-temp-buffer
  (progn
  (setq buf (current-buffer))
  (with-current-buffer anything-c-ess-buffer
  (ess-command "print(ls.str(), max.level=0)\n" buf))
  (split-string (buffer-string) "\n" t)))
  (error nil)))))
  (display-to-real . (lambda (obj-name) (car (split-string obj-name " : " t))))
  (action
  ("str" . (lambda(obj-name)
  (ess-execute (concat "str(" obj-name ")\n") nil (concat "R str: " obj-name))))
  ("summary" . (lambda(obj-name)
  (ess-execute (concat "summary(" obj-name ")\n") nil (concat "R summary: " obj-name))))
  ("head (10)" . (lambda(obj-name)
  (ess-execute (concat "head(" obj-name ", n = 10)\n") nil (concat "R head: " obj-name))))
  ("head (100)" . (lambda(obj-name)
  (ess-execute (concat "head(" obj-name ", n = 100)\n") nil (concat "R head: " obj-name))))
  ("tail" . (lambda(obj-name)
  (ess-execute (concat "tail(" obj-name ", n = 10)\n") nil (concat "R tail: " obj-name))))
  ("print" . (lambda(obj-name)
  (ess-execute (concat "print(" obj-name ")\n") nil (concat "R object: " obj-name))))
  ("dput" . (lambda(obj-name)
  (ess-execute (concat "dput(" obj-name ")\n") nil (concat "R dput: " obj-name)))))
  (volatile)))
#+end_src
** Occur
#+begin_src emacs-lisps
  (setq anything-c-source-occur
  '((name . "Occur")
  (init . (lambda ()
  (setq anything-occur-current-buffer
  (current-buffer))))
  (candidates . (lambda ()
  (let ((anything-occur-buffer (get-buffer-create "*Anything Occur*")))
  (with-current-buffer anything-occur-buffer
  (occur-mode)
  (erase-buffer)
  (let ((count (occur-engine anything-pattern
  (list anything-occur-current-buffer) anything-occur-buffer
  list-matching-lines-default-context-lines case-fold-search
  list-matching-lines-buffer-name-face
  nil list-matching-lines-face
  (not (eq occur-excluded-properties t)))))
  (when (> count 0)
  (setq next-error-last-buffer anything-occur-buffer)
  (cdr (split-string (buffer-string) "\n" t))))))))
  (action . (("Goto line" . (lambda (candidate)
  (with-current-buffer "*Anything Occur*"
  (search-forward candidate))
  (goto-line (string-to-number candidate) anything-occur-current-buffer)))))
  (requires-pattern . 3)
  (volatile)
  (delayed)))
#+end_src
** imenu --- probably ---
#+begin_src emacs-lisps
  (defvar anything-c-imenu-delimiter "/")
  (defvar anything-c-cached-imenu-alist nil)
  (defvar anything-c-cached-imenu-candidates nil)
  (defvar anything-c-cached-imenu-tick nil)
  (make-variable-buffer-local 'anything-c-cached-imenu-alist)
  (make-variable-buffer-local 'anything-c-cached-imenu-candidates)
  (make-variable-buffer-local 'anything-c-cached-imenu-tick)
  (setq anything-c-source-imenu
  '((name . "Imenu")
  (init . (lambda ()
  (setq anything-c-imenu-current-buffer
  (current-buffer))))
  (candidates
  . (lambda ()
  (with-current-buffer anything-c-imenu-current-buffer
  (let ((tick (buffer-modified-tick)))
  (if (eq anything-c-cached-imenu-tick tick)
  anything-c-cached-imenu-candidates
  (setq anything-c-cached-imenu-tick tick
  anything-c-cached-imenu-candidates
  (condition-case nil
  (mapcan
  (lambda (entry)
  (if (listp (cdr entry))
  (mapcar (lambda (sub)
  (concat (car entry) anything-c-imenu-delimiter (car sub)))
  (cdr entry))
  (list (car entry))))
  (setq anything-c-cached-imenu-alist (imenu--make-index-alist)))
  (error nil))))))))
  (volatile)
  (action
  . (lambda (entry)
  (let* ((pair (split-string entry anything-c-imenu-delimiter))
  (first (car pair))
  (second (cadr pair)))
  (imenu
  (if second
  (assoc second (cdr (assoc first anything-c-cached-imenu-alist)))
  (assoc entry anything-c-cached-imenu-alist))))))))
#+end_src
** Visible bookmarks
#+begin_src emacs-lisps
  ;; (defvar anything-c-source-bm
  ;;   '((name . "Visible Bookmarks")
  ;;     (init . (lambda ()
  ;;               (let ((bookmarks (bm-lists)))
  ;;                 (setq anything-bm-marks
  ;;                       (delq nil
  ;;                             (mapcar (lambda (bm)
  ;;                                       (let ((start (overlay-start bm))
  ;;                                             (end (overlay-end bm)))
  ;;                                         (if (< (- end start) 2)
  ;;                                             nil
  ;;                                           (format "%7d: %s"
  ;;                                                   (line-number-at-pos start)
  ;;                                                   (buffer-substring start (1- end))))))
  ;;                                     (append (car bookmarks) (cdr bookmarks))))))))
  ;;     (candidates . (lambda ()
  ;;                     anything-bm-marks))
  ;;     (action . (("Goto line" . (lambda (candidate)
  ;;                                 (goto-line (string-to-number candidate))))))))
#+end_src
** I don't know
#+begin_src emacs-lisps
  ;;
  (setq anything-sources
  (list 
  anything-c-source-buffers ; buffers
  ;;        anything-c-source-bm
  anything-c-source-imenu   ; e.g. Imenu-S menu
  ;;        anything-c-source-recentf ; recent files: needs (require 'recentf)
  anything-c-source-R-local
  anything-c-source-R-help
  anything-c-source-files-in-current-dir
  anything-c-source-occur
  anything-c-source-locate  ; needs the utility locate
  ))
#+end_src
* COMMENT icicles
#+begin_src emacs-lisp :tangle no
  (load "~/.emacs.d/site-lisp/icicles-install")
  (add-to-list 'load-path "~/.emacs.d/icicles")
  ;; (require 'icicles)
#+end_src
* highlight-parentheses
  http://nschum.de/src/emacs/highlight-parentheses/highlight-parentheses.el
  highlight parenthesis with different colours
#+begin_src emacs-lisp
  (require 'highlight-parentheses)
  (setq hl-paren-colors '("gold" "IndianRed" "cyan" "green" "orange"
  "magenta"))
  (defun hpm-on ()
  (highlight-parentheses-mode t))
  (add-hook 'ess-mode-hook 'hpm-on)
  (add-hook 'inferior-ess-mode-hook 'hpm-on)
#+end_src

* automatically closing brackets
** following from Marc Schwartz from ESS list, works globally to insert closing bracets automatically
#+begin_src emacs-lisp
  (setq skeleton-pair t)
  ;(setq skeleton-pair-on-word t)
   (global-set-key (kbd "(") 'skeleton-pair-insert-maybe)
   (global-set-key (kbd "[") 'skeleton-pair-insert-maybe)
   (global-set-key (kbd "{") 'skeleton-pair-insert-maybe)
   (global-set-key (kbd "\"") 'skeleton-pair-insert-maybe)
   (global-set-key (kbd "\'") 'skeleton-pair-insert-maybe)
   (global-set-key (kbd "\`") 'skeleton-pair-insert-maybe)
   ;; (global-set-key (kbd "<") 'skeleton-pair-insert-maybe)
  ;; Delete empty pairs like '()' taken from
  ;; [[http://www.emacswiki.org/cgi-bin/wiki/SkeletonMode#toc14]] ##Deletion section
  (defvar skeletons-alist
  '((?\( . ?\))
  (?\' . ?\')
  (?\" . ?\")
  (?[  . ?])
  (?{  . ?})
  ;; (?<  . ?>)
  (?$  . ?$)))
  (defadvice delete-backward-char (before delete-empty-pair activate)
  (if (eq (cdr (assq (char-before) skeletons-alist)) (char-after))
  (and (char-after) (delete-char 1))))
#+end_src
** COMMENT Calling R-autoyas whenever "(" is typed in 
#+begin_src emacs-lisp :tangle no
  (define-key ess-mode-map (kbd "(") '(lambda () (interactive)
                                        (skeleton-pair-insert-maybe nil)
                                        (r-autoyas-expand nil t)))
#+end_src

* org-mode
** Basic org mode
*** Initialise org-mode
  http://orgmode.org/manual/Installation.html#Installation
  http://orgmode.org/manual/Activation.html#Activation 
#+begin_src emacs-lisp
  ;; The following lines are always needed.  Choose your own keys.
  (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
  (global-set-key "\C-cl" 'org-store-link)
  (global-set-key "\C-ca" 'org-agenda)
  (global-set-key "\C-cb" 'org-iswitchb)
  ;; activate font-lock-mode
  (global-font-lock-mode 1)                     ; for all buffers
  ;; (add-hook 'org-mode-hook 'turn-on-font-lock)  ; Org buffers only
  (transient-mark-mode 1)
#+end_src

*** Startup settings
**** Hide leading stars
#+begin_src emacs-lisp
  (setq org-hide-leading-stars t)
#+end_src
**** Indent by default
#+begin_src emacs-lisp
(setq org-startup-indented t)
#+end_src
**** Start with hidden source blocks
#+begin_src emacs-lisp
(setq org-hide-block-startup nil)
#+end_src

*** Use the info files from the actual org-mode used
#+begin_src emacs-lisp
  (add-to-list 'Info-default-directory-list "~/.emacs.d/org-mode/doc/")
#+end_src

*** Enable fontification of inline code blocks
#+begin_src emacs-lisp
  (setq org-src-fontify-natively t)
#+end_src

*** Disable tab in source block
To enable, set to non-nil value
#+begin_src emacs-lisp
  (setq org-src-tab-acts-natively nil)
#+end_src

*** COMMENT Use text search instead of :ID: properties for links
#+begin_src emacs-lisp :tangle no
  (set org-link-to-org-use-id nil)
#+end_src

*** Enable fontified code export to LaTeX / pdf
#+begin_src emacs-lisp
  (require 'org-latex)
  (setq org-export-latex-listings t)
  (add-to-list 'org-export-latex-packages-alist '("" "listings"))
  (add-to-list 'org-export-latex-packages-alist '("" "color"))
#+end_src

*** Display source code edit buffer in the current window, keeping all other windows
#+begin_src emacs-lisp
  (setq org-src-window-setup 'current-window)
#+end_src

*** Scale LaTeX math symbols et al
#+BEGIN_SRC emacs-lisp
  (setq org-format-latex-options 
        (plist-put org-format-latex-options :scale 1.3))
#+END_SRC

*** Kill export buffer when created
#+begin_src emacs-lisp
  (setq org-export-kill-product-buffer-when-displayed t)
#+end_src

*** Change "folding ellipses"
#+begin_src emacs-lisp
  ;; (setq org-ellipsis " ... ... >")     
  (setq org-ellipsis "〖 ✎ 〗")
#+end_src

#+results:
:  ... ... >

*** Ask when deleting subtree
#+begin_src emacs-lisp
  (setq org-ctrl-k-protect-subtree "ask")
#+end_src

#+results:
: ask

** org-mime
[[http://orgmode.org/worg/org-contrib/org-mime.php]]
#+begin_src emacs-lisp
  (require 'org-mime)
  (add-hook 'message-mode-hook
            (lambda ()
              (local-set-key "\C-c\M-o" 'org-mime-htmlize)))
  
  (add-hook 'org-mode-hook
            (lambda ()
              (local-set-key "\C-c\M-o" 'org-mime-org-buffer-htmlize)))
#+end_src
** org-protocol
[[http://orgmode.org/worg/org-contrib/org-protocol.php]] 
#+begin_src emacs-lisp
  (server-start)
  (add-to-list 'load-path "~/.emacs.d/org-mode/lisp/")
  (require 'org-protocol)
#+end_src

** org-capture
  Set the keyboard shortcut and define the templates
#+begin_src emacs-lisp
  (define-key global-map "\C-cc" 'org-capture) 
  (setq org-capture-templates
        `(
          ;; ("t" "Todo" entry (file+headline "~/Documents/orgfiles//notes.org" "Tasks") "* TODO %U %?%i %a") 
          ;; ("j" "Journal" entry (file+headline "~/Documents/orgfiles//notes.org" "") "* %U %? %i %a")
          ;; ("i" "Idea" entry (file+headline "~/Documents/orgfiles//notes.org" "New Ideas") "* %^{Title} %i %a") 
          ;; ("r" "Reference Material" entry (file+headline "reference.org" "") "*%? %&%^g")
          ;; ("x" "Message" entry (file+datetree (buffer-file-name (buffer-base-buffer))) "* MSG @ %U %?\n %a")
  ;; ;;;;;;;;;;;;;;;;;;
  ;;        ("gt" 
  ;;         "Global Todo" 
  ;;         entry 
  ;;         (file+headline "~/Documents/orgfiles/notes.org" "Tasks") 
  ;;         "* TODO %U
  ;; %?
  ;; %i
  ;; %a"
  ;;         )
  ;; ;;;;;;;;;;;;;;;;;;
  ;;         ("J"
  ;;          "Global Journal" 
  ;;          entry 
  ;;          (file+headline "~/Documents/orgfiles/notes.org" "") 
  ;;          "* %U %?
  
  ;;   %i
  ;;   %a"
  ;;          ) 
  ;; ;;;;;;;;;;;;;;;;;;
  ;;         ("I"
  ;;          "Global Idea" 
  ;;          entry 
  ;;          (file+headline "~/Documents/orgfiles/notes.org" "New Ideas") 
  ;;          "* %^{Title}
  ;;   %i
  ;;   %a"
  ;;          ) 
  ;; ;;;;;;;;;;;;;;;;;;
  ;;         ("R" 
  ;;          "Global Reference Material" 
  ;;          entry 
  ;;          (file+headline "~/Documents/orgfiles/notes.org" "Reference")
  ;;          "*%? %&%^g"
  ;;          ) 
  ;; ;;;;;;;;;;;;;;;;;;
          ("p" 
           "Problem to be logged in buffer" 
           entry 
          (file+headline (buffer-file-name) "QUESTIONS")
           "* %?
  - file     :: %(buffer-file-name (org-capture-get :original-buffer))
  - revision :: %(symbol-name (vc-working-revision (buffer-file-name (org-capture-get :original-buffer))))
  - state    :: %(symbol-name (vc-state (buffer-file-name (org-capture-get :original-buffer))))
  - link     :: %a 
  - author   :: Rainer M Krug, email: Rainer@krugs.de"
           ) 
  ;;;;;;;;;;;;;;;;;;
          ("c" 
           "Changes to be logged in buffer" 
           entry
          (file+headline (buffer-file-name) "CHANGES")
           "* %T %? 
  - file     :: %(buffer-file-name (org-capture-get :original-buffer))
  - revision :: %(symbol-name (vc-working-revision (buffer-file-name (org-capture-get :original-buffer))))
  - state    :: %(symbol-name (vc-state (buffer-file-name (org-capture-get :original-buffer))))
  - link     :: %a 
  - author   :: Rainer M Krug, email: Rainer@krugs.de %n"
           )
  ;;;;;;;;;;;;;;;;;;
  ;;         ("t" 
  ;;          "TODO to be logged in buffer" 
  ;;          entry
  ;;         (file+headline (buffer-file-name) "TODO")
  ;;          "* %T %? 
  ;; - file     :: %(buffer-file-name (org-capture-get :original-buffer))
  ;; - revision :: %(symbol-name (vc-working-revision (buffer-file-name (org-capture-get :original-buffer))))
  ;; - state    :: %(symbol-name (vc-state (buffer-file-name (org-capture-get :original-buffer))))
  ;; - link     :: %a 
  ;; - author   :: Rainer M Krug, email: Rainer@krugs.de %n"
  ;;          )
  ;;;;;;;;;;;;;;;;;;
          )
        )
  
#+end_src

** org-babel
*** Disable prompting for code execution
#+begin_src emacs-lisp
(setq org-confirm-babel-evaluate nil)
#+end_src

*** Set prompting for shell link execution
#+begin_src emacs-lisp
  (setq org-confirm-shell-link-function 'y-or-n-p)
#+end_src

*** Load library-of-babel.el
Load the source-code blocks defined in an Org-mode file into the global "org-babel-library-of-babel" variable
#+begin_src emacs-lisp
(org-babel-lob-ingest "~/.emacs.d/org-mode/contrib/babel/library-of-babel.org")
#+end_src

*** Tangle with comments
#+begin_src emacs-lisp
  (setq org-babel-tangle-w-comments t)
  ;; (add-to-list 'org-babel-default-header-args:R '(:comments . "yes"))
#+end_src

*** Set :noweb per default to no
This is needed for plantuml
See manual "14.10 Noweb reference syntax" for details.
#+begin_src emacs-lisp
  (setq org-babel-default-header-args
        (cons '(:noweb . "no")
              (assq-delete-all :noweb org-babel-default-header-args)))
#+end_src

*** sh
**** set shebang for sh script to "#!/bin/bash"
#+begin_src emacs-lisp
;; ensure this variable is defined
(unless (boundp 'org-babel-default-header-args:sh)
(setq org-babel-default-header-args:sh '()))

;; add a default shebang header argument
(add-to-list 'org-babel-default-header-args:sh
'(:shebang . "#!/bin/bash"))
#+end_src
**** Enable language execution
#+begin_src emacs-lisp
(require 'ob-sh)         ;; requires R and ess-mode
#+end_src
*** R
Enable language execution
#+begin_src emacs-lisp
  (require 'ob-R)         ;; requires R and ess-mode
#+end_src

*** plantuml 
Further info can be find at http://eschulte.github.com/babel-dev/DONE-integrate-plantuml-support.html http://plantuml.sourceforge.net/
Enable language execution
#+begin_src emacs-lisp : tangle no
  (require 'ob-plantuml)         ;; requires R and ess-mode
#+end_src
Set location where plantuml.jar is located
#+begin_src emacs-lisp
  (setq org-plantuml-jar-path
        (expand-file-name "~/.emacs.d/org-mode/contrib/scripts/plantuml.jar"))
#+end_src

*** LaTeX
Settings copied from http://orgmode.org/worg/org-contrib/babel/languages/org-babel-doc-LaTeX.php
**** Activate LaTeX Evaluation
#+begin_src emacs-lisp
(require 'ob-latex)
#+end_src
**** AucTeX
Strongly recommended for editing .tex files. Add the following line to .emacs: 
#+begin_src emacs-lisp
(add-to-list 'load-path "~/.emacs.d/auctex")
(load "auctex.el" nil t t)
#+end_src
*** Raise Noweb-type Errors
Add LaTeX to a list of languages that raise noweb-type errors
Edit the following example to include the languages you use in Org-babel
#+begin_src emacs-lisp
(setq org-babel-noweb-error-langs '("R" "latex"))
#+end_src

*** Set post-tangle-hook for R
This is an example on how to set the hook for loading R files via ess-load-file after tangling. This code should be copied into the .org file, to enable per-file setting of the hook.
#+begin_src emacs-lisp :results silent :tangle no
  (add-hook 'org-babel-post-tangle-hook
            (lambda () (ess-load-file (buffer-file-name))))
#+end_src

*** Enable fontified LaTeX listing exports. 
Set org-export-latex-listings to a non-nil value and make sure that the packages listings and color are loaded into LaTeX
#+begin_src emacs-lisp
  (setq org-export-latex-listings t)
  (require 'org-latex)
  (add-to-list 'org-export-latex-packages-alist '("" "listings"))
  (add-to-list 'org-export-latex-packages-alist '("" "color"))
#+end_src

*** org-babel-tangle-jump-to-org
#+begin_src emacs-lisp
  (defun org-babel-tangle-jump-to-org ()
  "Jump from a tangled code file to the related Org-mode file."
  (interactive)
  (let ((mid (point))
  target-buffer target-char
  start end link path block-name)
    (save-window-excursion
  (save-excursion
  (unless (and (re-search-backward org-bracket-link-analytic-regexp nil t)
  (setq start (point))
  (setq link (match-string 0))
  (setq path (match-string 3))
  (setq block-name (match-string 5))
  (re-search-forward (concat " " (regexp-quote block-name)
  " ends here[\n\r]") nil t)
  (setq end (point))
  (< start mid) (< mid end))
  (error "not in tangled code")))
  (when (string-match "::" path)
  (setq path (substring path 0 (match-beginning 0))))
  (find-file path) (setq target-buffer (current-buffer))
  (goto-char start) (org-open-link-from-string link)
  (if (string-match "[^ \t\n\r]:\\([[:digit:]]+\\)" block-name)
  (org-babel-next-src-block
  (string-to-int (match-string 1 block-name)))
  (org-babel-goto-named-src-block block-name))
  (setq target-char (point)))
  (pop-to-buffer target-buffer)
  (goto-char target-char)))
#+end_src

*** inhibits the insertion of blank lines on tangling
#+begin_src emacs-lisp
  (setq org-babel-tangle-pad-newline nil)
#+end_src

*** COMMENT add plantuml language mode
#+begin_src emacs-lisp :tangle no
  (add-to-list 'org-src-lang-modes '("plantuml" . fundamental))
#+end_src

** Org-mobile settings
#+begin_src emacs-lisp
  ; Set to the location of your Org files on your local system
  (setq org-directory "~/Documents/orgfiles")
  ;; Set to the name of the file where new notes will be stored
  (setq org-mobile-inbox-for-pull "~/Documents/orgfiles/flagged.org")
  ;; Set to <your Dropbox root directory>/MobileOrg.
  (setq org-mobile-directory "~/Dropbox/MobileOrg")
#+end_src

** org-html5-presentation
#+begin_src emacs-lisp
  (require 'org-html5presentation)
#+end_src
* Define screenshot function
#+BEGIN_SRC emacs-lisp
  (defun org-screenshot ()
    "Take a screenshot into a time stamped unique-named file in the same directory as the org-buffer and insert a link to this file."
    (interactive)
    (setq filename
          (concat
           (make-temp-name
            (concat (buffer-file-name)
                    "_"
                    (format-time-string "%Y%m%d_%H%M%S_")) ) ".png"))
    (call-process "import" nil nil nil filename)
    (insert (concat "[[" filename "]]"))
    (org-display-inline-images))
  
  
#+END_SRC

* COMMENT plantuml
** Load plantuml-mode
http://zhangweize.wordpress.com/2010/09/20/update-plantuml-mode/
#+begin_src emacs-lisp :tangle no
  (load-file "~/.emacs.d/site-lisp/plantuml-mode.el")
#+end_src

* COMMENT YASnippet
See [[http://yasnippet.googlecode.com/svn/trunk/doc/index.html]] for details
** Load and activate
#+begin_src emacs-lisp :tangle no
  (add-to-list 'load-path
                "~/.emacs.d/yasnippet")
  (require 'yasnippet) ;; not yasnippet-bundle
  (yas/initialize)
  (yas/load-directory "~/.emacs.d/yasnippet/snippets")
#+end_src
** Org-Mode Hook
Aome modifications (see [[http://eschulte.github.com/emacs-starter-kit/starter-kit-org.html]] for details.
#+begin_src emacs-lisp :tangle no
  (defun yas/org-very-safe-expand ()
   (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))   
#+end_src

#+begin_src emacs-lisp :tangle no
(add-hook 'org-mode-hook
          (lambda ()
            (local-set-key "\M-\C-n" 'outline-next-visible-heading)
            (local-set-key "\M-\C-p" 'outline-previous-visible-heading)
            (local-set-key "\M-\C-u" 'outline-up-heading)
            ;; table
            (local-set-key "\M-\C-w" 'org-table-copy-region)
            (local-set-key "\M-\C-y" 'org-table-paste-rectangle)
            (local-set-key "\M-\C-l" 'org-table-sort-lines)
            ;; yasnippet (using the new org-cycle hooks)
            (make-variable-buffer-local 'yas/trigger-key)
            (setq yas/trigger-key [tab])
            (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
            (define-key yas/keymap [tab] 'yas/next-field)
            ))
#+end_src 

* Color themes
** load color-theme package
load color-theme package
#+begin_src emacs-lisp
  (add-to-list 'load-path "~/.emacs.d/color-theme")
  (require 'color-theme)
  (eval-after-load "color-theme"
    '(progn
       (color-theme-initialize)
       (color-theme-hober)))
#+end_src
and initialize and load hober color theme
#+begin_src emacs-lisp :tangle no
  (eval-after-load "color-theme"
    '(progn
       (color-theme-initialize)
       (color-theme-hober)))
#+end_src
** COMMENT Cycle through loaded color themes
based on [[http://orgmode.org/worg/org-color-themes.php]]            
#+BEGIN_SRC emacs-lisp :tangle no
  (add-to-list 'load-path "~/.emacs.d/color-themes")
  (setq color-theme-is-global t)
  (color-theme-initialize)
  
  ;;(load "color-theme-colorful-obsolescence")
  (load "color-theme-zenburn")
  (load "color-theme-tangotango")
  ;;(load "color-theme-railscast")
  (load "color-theme-sva")
  ;;(load "color-theme-folio")
  (load "color-theme-zenash")
  ;;(load "color-theme-manoj")
  ;;(load "color-theme-dark-emacs")
  ;;(load "color-theme-hober")
  
  (setq my-color-themes (list
    'color-theme-hober
    'color-theme-tangotango
    ;;'color-theme-colorful-obsolescence 
    'color-theme-zenburn
    'color-theme-sva 
    'color-theme-zenash
    ;;'color-theme-folio 
    ;;'color-theme-dark-emacs 
    ;;'color-theme-manoj 'color-theme-zenash
    ;;'color-theme-railscast
    ;;'color-theme-hober
  ))
  
  (defun my-theme-set-default () ; Set the first row
        (interactive)
        (setq theme-current my-color-themes)
        (funcall (car theme-current)))
  
      (defun my-describe-theme () ; Show the current theme
        (interactive)
        (message "%s" (car theme-current)))
  
     ; Set the next theme (fixed by Chris Webber - tanks)
      (defun my-theme-cycle ()            
        (interactive)
        (setq theme-current (cdr theme-current))
        (if (null theme-current)
        (setq theme-current my-color-themes))
        (funcall (car theme-current))
        (message "%S" (car theme-current)))
  
      (setq theme-current my-color-themes)
  (setq color-theme-is-global nil) ; Initialization
      (my-theme-set-default)
  (global-set-key [f4] 'my-theme-cycle)
#+END_SRC
* Mail
** Set user name and mail address
#+begin_src emacs-lisp
  (setq user-mail-address "Rainer@krugs.de")
  (setq user-full-name "Rainer M. Krug")
#+end_src
** Setup smtp for sending mail
Based on an email from Oscar Carlson: [[shell:xdg-open%20imap-message://R.M.Krug%40gmail.com@imap.googlemail.com/Lists/orgmode#13247][mail: {Orgmode} Re: Sending org buffer as mail?]]
#+begin_src emacs-lisp
  (setq message-send-mail-function 'smtpmail-send-it
        smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
        smtpmail-auth-credentials "~/.authinfo"
        smtpmail-default-smtp-server "smtp.gmail.com"
        smtpmail-smtp-server "smtp.gmail.com"
        smtpmail-smtp-service 587)
#+end_src
* Add message hook to include selected text as body
Thanks to Deniz Dogan ([[shell:xdg-open%20imap-message://R.M.Krug%40gmail.com@imap.googlemail.com/email/R.M.Krug@gmail.com#4468][mail: Create email with selected text as body?]])
#+begin_src emacs-lisp
  (add-hook 'message-mode-hook
            (lambda ()
              (let (text)
                (with-current-buffer (other-buffer)
                  (when (region-active-p)
                    (setq text
                          (buffer-substring (region-beginning)
                                            (region-end)))))
                (when text
                  (end-of-buffer)
                  (insert text)))))
#+end_src

* tabbar
http://www.emacswiki.org/emacs/TabBarMode and http://www.emacswiki.org/emacs/tabbar.el
** load tabbar
#+begin_src emacs-lisp
  (require 'tabbar)
  (tabbar-mode)
#+end_src
(setq tabbar-buffer-groups-function
          (lambda ()
            (list "All"))) ;; code by Peter Barabas
** All tabs in one group
#+begin_src emacs-lisp
  ;; (setq tabbar-buffer-groups-function
  ;;       (lambda ()
  ;;         (list "All"))) ;; code by Peter Barabas
#+end_src
* notmuch mail thingy
#+begin_src emacs-lisp
  (add-to-list 'load-path "~/share/emacs/site-lisp")
  (require 'notmuch)
#+end_srcpd



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

* Re: BUG: Newest org-mode interferes with desktop save
  2011-06-15 17:35   ` Nick Dokos
@ 2011-06-15 18:23     ` Rainer M Krug
  0 siblings, 0 replies; 217+ messages in thread
From: Rainer M Krug @ 2011-06-15 18:23 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2571 bytes --]

On Wed, Jun 15, 2011 at 7:35 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> Eric Schulte <schulte.eric@gmail.com> wrote:
>
>
> > I was able to reproduce this query-on-close behavior with the following
> > minimal config.
> >
> > #+begin_src sh
> >   emacs -Q -l ~/.emacs.d/src/org/lisp/org.el --eval "(desktop-save-mode
> 1)"
> > #+end_src
> >
> > however, I think this prompting behavior is expected, and when I
> > switched to the following alternative
> >
> > #+begin_src sh
> >   emacs -Q -l ~/.emacs.d/src/org/lisp/org.el --eval '(desktop-read
> "~/Desktop/")'
> > #+end_src
> >
> > I received no prompt on exit.  As far as I can tell there is not an
> > Org-mode bug here, however I could very well have missed something.
> >
>
> > Rainer M Krug <r.m.krug@gmail.com> writes:
> >
> > > when using the newest version of org-mode (Org-mode version 7.5
> > > (release_7.5.391.gfacc)), I get the following warning when closing
> emacs,
> > >
> > > "Current desktop was not loaded from a file. Overwrite this desktop
> file?"
> > >
> > > although it has loaded the desktop file. When I use 7.5 (and te one
> from I
> > > guess yesterday), the message did not occur.
> > >
> > > I have (desktop-save-mode 1) on my emacs.org.
> > >
>
>
> Maybe this will help?
>
> ,----
> | desktop-save is a variable defined in `desktop.el'.
> | Its value is ask-if-new
> |
> | Documentation:
> | Specifies whether the desktop should be saved when it is killed.
> | A desktop is killed when the user changes desktop or quits Emacs.
> | Possible values are:
> |    t             -- always save.
> |    ask           -- always ask.
> |    ask-if-new    -- ask if no desktop file exists, otherwise just save.
> |    ask-if-exists -- ask if desktop file exists, otherwise don't save.
> |    if-exists     -- save if desktop file exists, otherwise don't save.
> |    nil           -- never save.
> | The desktop is never saved when `desktop-save-mode' is nil.
> | The variables `desktop-dirname' and `desktop-base-file-name'
> | determine where the desktop is saved.
> `----
>

Might be, but my point is, that the behaviour has changed in org-mode - and
that should not be.

Cheers,

Rainer


>
> Nick
>



-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax (F):       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug

[-- Attachment #2: Type: text/html, Size: 3715 bytes --]

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

* Re: BUG: Newest org-mode interferes with desktop save
  2011-06-15 18:21   ` Rainer M Krug
@ 2011-06-15 18:31     ` Eric Schulte
  2011-06-15 18:59       ` Rainer M Krug
  0 siblings, 1 reply; 217+ messages in thread
From: Eric Schulte @ 2011-06-15 18:31 UTC (permalink / raw)
  To: Rainer M Krug; +Cc: emacs-orgmode

>
> I can not reproduce your example, as I am getting an "can not open
> org-entities", but have you tried it with org-mode 7.5 as well as the newest
> git? My point is, that up to a recent git version (probably yesterday), this
> question was *not* there, but it is there at with the newest git version.
>

I have only tried to reproduce this with the newest version of org-mode,
and with that minimal setup I posted in my previous email.  With that
setup there was *no* prompt when exiting Emacs if the desktop
configuration had been loaded from a file -- i.e., the correct behavior.

I'd suggest trying to run from a similar minimal configuration, and then
see if the problem persists?  If so, then it is due to something else on
your systems aside form the Org-mode version (e.g., OS or Emacs), and if
not then it is due to interaction with something else in your config.

Sorry, I can't be of more help without the ability to reproduce the
problem.

Cheers -- Eric

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

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

* Re: BUG: Newest org-mode interferes with desktop save
  2011-06-15 18:31     ` Eric Schulte
@ 2011-06-15 18:59       ` Rainer M Krug
  2011-06-15 22:40         ` Nick Dokos
  0 siblings, 1 reply; 217+ messages in thread
From: Rainer M Krug @ 2011-06-15 18:59 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2039 bytes --]

On Wed, Jun 15, 2011 at 8:31 PM, Eric Schulte <schulte.eric@gmail.com>wrote:

> >
> > I can not reproduce your example, as I am getting an "can not open
> > org-entities", but have you tried it with org-mode 7.5 as well as the
> newest
> > git? My point is, that up to a recent git version (probably yesterday),
> this
> > question was *not* there, but it is there at with the newest git version.
> >
>
> I have only tried to reproduce this with the newest version of org-mode,
> and with that minimal setup I posted in my previous email.  With that
> setup there was *no* prompt when exiting Emacs if the desktop
> configuration had been loaded from a file -- i.e., the correct behavior.
>
> I'd suggest trying to run from a similar minimal configuration, and then
> see if the problem persists?  If so, then it is due to something else on
> your systems aside form the Org-mode version (e.g., OS or Emacs), and if
> not then it is due to interaction with something else in your config.
>
> Sorry, I can't be of more help without the ability to reproduce the
>

I completely understand.

I created the attached init.el file. In my setup, ~/.emacs.d/org-mode is a
symbolic link. If I set it to org-7.7, everything works as expected desktop
is loaded and saved without question), but when linking it to the git
version, the desktop is loaded, but when closing it giveas me the above
mentioned question:

"Current desktop was not loaded from a file. Overwrite this desktop file?"

As I said, the desktop *is* loaded.

Hope you can reproduce it with this setup,

Rainer

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



-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax (F):       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug

[-- Attachment #1.2: Type: text/html, Size: 2957 bytes --]

[-- Attachment #2: init.el --]
[-- Type: text/x-emacs-lisp, Size: 651 bytes --]

;;; init.el --- Where all the magic begins
;;
;; This file loads both
;; - Org-mode : http://orgmode.org/ and
;; - Org-babel: http://orgmode.org/worg/org-contrib/babel/org-babel.php#library-of-babel
;;
;; It then loads the rest of our Emacs initialization from Emacs lisp
;; embedded in literate Org-mode files.

;; Load up Org Mode and Org Babel for elisp embedded in Org Mode files
(add-to-list 'load-path "~/.emacs.d/org-mode/lisp")
(add-to-list 'load-path "~/.emacs.d/org-mode/contrib/lisp")

;; load up Org-mode and Org-babel
(require 'org-install)

(desktop-save-mode 1)
;; load up the main file
;; (org-babel-load-file "~/.emacs.d/emacs.org")


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

* Re: BUG: Newest org-mode interferes with desktop save
  2011-06-15 18:59       ` Rainer M Krug
@ 2011-06-15 22:40         ` Nick Dokos
  2011-06-16  7:15           ` Rainer M Krug
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2011-06-15 22:40 UTC (permalink / raw)
  To: Rainer M Krug; +Cc: nicholas.dokos, emacs-orgmode

Rainer M Krug <r.m.krug@gmail.com> wrote:


> I created the attached init.el file. In my setup, ~/.emacs.d/org-mode
> is a symbolic link. If I set it to org-7.7, everything works as
> expected desktop is loaded and saved without question), but when
> linking it to the git version, the desktop is loaded, but when closing
> it giveas me the above mentioned question:
> 
> "Current desktop was not loaded from a file. Overwrite this desktop file?"
> 
> As I said, the desktop *is* loaded.
> 
> Hope you can reproduce it with this setup,
> 

Here's a caution: when desktop.el is loaded, it adds to after-init-hook a
function that reads the desktop file. However, after-init-hook gets called
"at the end of initialization": if you try to reproduce using something like

    emacs -q -l init.el

it's not going to work - after-init-hook gets runs "between the -q and -l"
so to speak, whereas desktop.el does not get loaded until init.el is loaded:
that initializes the hook too late to do any good.

Probably the best way to do it is to create a dummy user "foo", copy init.el
to /home/foo/.emacs and then invoke emacs as

   emacs -u foo

Using this method, I cannot reproduce the problem with or without org in
the init file: here's the one that I used which also sets a couple of
desktop hooks that make some noise which is recorded in the *Messages*
buffer - that helps to verify that things work according to
expectations:

--8<---------------cut here---------------start------------->8---
;;; -*- mode: emacs-lisp -*-
(setq debug-on-error t)
(require 'desktop)
(desktop-save-mode 1)
(add-to-list 'desktop-after-read-hook (function (lambda () (message "got a desktop file"))))
(add-to-list 'desktop-no-desktop-file-hook (function (lambda () (message "no desktop file read"))))

;;; I tried with and without the following five lines
;;; I also tried with them placed *before* the desktop stuff
(add-to-list 'load-path (expand-file-name "~nick/src/emacs/org/org-mode/lisp"))
(add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
(require 'org-install)
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
--8<---------------cut here---------------end--------------->8---

Nick

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

* Re: BUG: Newest org-mode interferes with desktop save
  2011-06-15 22:40         ` Nick Dokos
@ 2011-06-16  7:15           ` Rainer M Krug
  2011-06-16  7:29             ` Jambunathan K
  0 siblings, 1 reply; 217+ messages in thread
From: Rainer M Krug @ 2011-06-16  7:15 UTC (permalink / raw)
  To: nicholas.dokos, Eric Schulte; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 3227 bytes --]

On Thu, Jun 16, 2011 at 12:40 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> Rainer M Krug <r.m.krug@gmail.com> wrote:
>
>
> > I created the attached init.el file. In my setup, ~/.emacs.d/org-mode
> > is a symbolic link. If I set it to org-7.7, everything works as
> > expected desktop is loaded and saved without question), but when
> > linking it to the git version, the desktop is loaded, but when closing
> > it giveas me the above mentioned question:
> >
> > "Current desktop was not loaded from a file. Overwrite this desktop
> file?"
> >
> > As I said, the desktop *is* loaded.
> >
> > Hope you can reproduce it with this setup,
> >
>
> Here's a caution: when desktop.el is loaded, it adds to after-init-hook a
> function that reads the desktop file. However, after-init-hook gets called
> "at the end of initialization": if you try to reproduce using something
> like
>
>    emacs -q -l init.el
>
> it's not going to work - after-init-hook gets runs "between the -q and -l"
> so to speak, whereas desktop.el does not get loaded until init.el is
> loaded:
> that initializes the hook too late to do any good.
>
> Probably the best way to do it is to create a dummy user "foo", copy
> init.el
> to /home/foo/.emacs and then invoke emacs as
>
>   emacs -u foo
>
> Using this method, I cannot reproduce the problem with or without org in
> the init file: here's the one that I used which also sets a couple of
> desktop hooks that make some noise which is recorded in the *Messages*
> buffer - that helps to verify that things work according to
> expectations:
>
> --8<---------------cut here---------------start------------->8---
> ;;; -*- mode: emacs-lisp -*-
> (setq debug-on-error t)
> (require 'desktop)
> (desktop-save-mode 1)
> (add-to-list 'desktop-after-read-hook (function (lambda () (message "got a
> desktop file"))))
> (add-to-list 'desktop-no-desktop-file-hook (function (lambda () (message
> "no desktop file read"))))
>
> ;;; I tried with and without the following five lines
> ;;; I also tried with them placed *before* the desktop stuff
> (add-to-list 'load-path (expand-file-name
> "~nick/src/emacs/org/org-mode/lisp"))
> (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" .
> org-mode))
> (require 'org-install)
> (global-set-key "\C-cl" 'org-store-link)
> (global-set-key "\C-ca" 'org-agenda)
> --8<---------------cut here---------------end--------------->8---
>
> Nick
>
>
>
There seems to be a problem with my .emacs.desktop files in combination with
the new org - if I close all buffer, quit, answer the question with yes,
re-open emacs, open the same file again, close emacs (no questions asked),
open emacs again, desktop file is read, close, no questions asked.

So I know how to fix it. I attach one .emacs.desktop which shows this
behavior.

Cheers and thanks for your patience,

Rainer



-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax (F):       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug

[-- Attachment #1.2: Type: text/html, Size: 4146 bytes --]

[-- Attachment #2: .emacs.desktop --]
[-- Type: application/octet-stream, Size: 7270 bytes --]

;; -*- mode: emacs-lisp; coding: emacs-mule; -*-
;; --------------------------------------------------------------------------
;; Desktop File for Emacs
;; --------------------------------------------------------------------------
;; Created Thu Jun 16 09:14:00 2011
;; Desktop file format version 206
;; Emacs version 23.3.1

;; Global section:
(setq desktop-missing-file-warning nil)
(setq tags-file-name nil)
(setq tags-table-list nil)
(setq search-ring '("row(" "parasiteP" "parP" "parasiteP" "simulate" "simulation" "tangle" ":P	" ":P" "Use" "63" "6" "y" "'" "lh" "Teachink"))
(setq regexp-search-ring nil)
(setq register-alist (list (list 49 '(frame-configuration ("Unprintable entity" ((parent-id . 27886798) (explicit-name) (display . ":0.0") (visibility . t) (icon-name) (outer-window-id . "48236292") (window-id . "48236295") (top . 0) (left . 0) (buried-buffer-list) (buffer-list "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity") (unsplittable) (minibuffer . "Unprintable entity") (modeline . t) (width . 176) (height . 50) (name . "*R*") (sticky) (background-mode . dark) (display-type . color) (alpha) (scroll-bar-width . 16) (cursor-type . box) (auto-lower) (auto-raise) (icon-type . t) (fullscreen . maximized) (wait-for-wm . t) (title) (buffer-predicate) (tool-bar-lines . 1) (menu-bar-lines . 1) (scroll-bar-background . "grey75") (scroll-bar-foreground) (right-fringe . 8) (left-fringe . 8) (line-spacing) (screen-gamma) (border-color . "black") (cursor-color . "medium turquoise") (mouse-color . "black") (background-color . "black") (foreground-color . "#c0c0c0") (vertical-scroll-bars . left) (internal-border-width . 0) (border-width . 2) (font . "-b&h-lucidatypewriter-medium-r-normal-sans-14-100-100-100-m-80-iso8859-1") (font-parameter . "lucidasanstypewriter-10") (font-backend xft x)) "Unprintable entity") ("Unprintable entity" ((parent-id . 27886530) (explicit-name) (display . ":0.0") (visibility . t) (icon-name) (outer-window-id . "48234660") (window-id . "48234681") (top . 923) (left . 0) (buried-buffer-list "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity") (buffer-list "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity") (unsplittable) (minibuffer . "Unprintable entity") (modeline . t) (width . 206) (height . 58) (name . "nsa.org") (sticky) (environment) (background-mode . dark) (display-type . color) (horizontal-scroll-bars . t) (window-system . x) (alpha) (scroll-bar-width . 16) (cursor-type . box) (auto-lower) (auto-raise) (icon-type . t) (fullscreen . maximized) (wait-for-wm . t) (title) (buffer-predicate) (tool-bar-lines . 1) (menu-bar-lines . 1) (scroll-bar-background . "grey75") (scroll-bar-foreground) (right-fringe . 8) (left-fringe . 8) (line-spacing) (screen-gamma) (border-color . "black") (cursor-color . "medium turquoise") (mouse-color . "black") (background-color . "black") (foreground-color . "#c0c0c0") (vertical-scroll-bars . left) (internal-border-width . 0) (border-width . 2) (font . "-b&h-lucidatypewriter-medium-r-normal-sans-14-100-100-100-m-80-iso8859-1") (font-parameter . "lucidasanstypewriter-10") (font-backend xft x)) "Unprintable entity")) (let ((mk (make-marker))) (add-hook 'desktop-delay-hook (list 'lambda '() (list 'set-marker mk nil (get-buffer " *temp*")))) mk)) (list 82 "Unprintable entity" (let ((mk (make-marker))) (add-hook 'desktop-delay-hook (list 'lambda '() (list 'set-marker mk nil (get-buffer " *temp*")))) mk))))
(setq file-name-history '("/home/rkrug/Documents/Projects/Herbivore_Parasite_dynamics/trunc/DESCRIPTION" "/home/rkrug/Documents/Projects/HakeaLandscape/trunc/R/disp/disp.org" "/home/rkrug/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/nsa.org" "/home/rkrug/Documents/Projects/HakeaLandscape/trunc/R/analysisFire.org" "/home/rkrug/Documents/Projects/HakeaLandscape/trunc/R/analysisFire.pdf" "/home/rkrug/.emacs.d/emacs.org" "/home/rkrug/Documents/Projects/Herbivore_Parasite_dynamics/trunc/R/hpd.R" "/home/rkrug/Documents/Projects/Herbivore_Parasite_dynamics/trunc/hpd.org" "/home/rkrug/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/nsa.org" "/home/rkrug/Documents/Projects/Herbivore_Parasite_dynamics/trunc/R/hpd.org" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Biocontrol_pooled.lyx" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Combined_pooled.lyx" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/AS_BC_manuscrip.lyx" "/home/rkrug/Documents/Projects/Herbivore_Parasite_dynamics/Documents/LifeCycle.plantuml" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Combined_pooled.sum.lyx" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Combined_all.tmp.lyx" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Combined_all.lyx" "/home/rkrug/tmp/tmp.org" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Biocontrol_pooled.lyx" "/home/rkrug/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/tmp.org" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Combined_pooled.lyx" "/home/rkrug/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/*.lyx" "/home/rkrug/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/Analysis_sensitivity.org" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Lowry_pooled.lyx" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/MainEffects_pooled.lyx" "~/tmp/nsa.sh" "/home/rkrug/tmp/test.org" "~/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/../nsa.sh" "/home/rkrug/tmp/notmuch.org" "/home/rkrug/.emacs.d/org-mode-git/org-mode/contrib/lisp/org-notmuch.el" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Overview_pooled.lyx" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Overview.lyx" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/MainEffects_pooled.lyx" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/AppendixMainEffects.lyx" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/AppendixOverview.lyx" "/home/rkrug/.emacs.d/emacs.org" "/home/rkrug/tmp/table.tex" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Analysis_sensitivity_sens2.tex" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Analysis_sensitivity_sens.tex" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Analysis_sensitivity_sens.lyx" "/home/rkrug/tmp/pm.org" "/home/rkrug/.emacs.d/emacs.org" "~/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/Analysis_sensitivity.tex" "~/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/doTSAnalysis.sub"))

;; Buffer section -- buffers listed in same order as in buffer list:
(desktop-create-buffer 206
  "/home/rkrug/Documents/Projects/Herbivore_Parasite_dynamics/trunc/hpd.org"
  "hpd.org"
  'org-mode
  '(org-indent-mode)
  1
  '(nil nil)
  nil
  nil
  '((indent-tabs-mode) (buffer-file-coding-system . utf-8-unix) (truncate-lines . t)))


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

* Re: BUG: Newest org-mode interferes with desktop save
  2011-06-16  7:15           ` Rainer M Krug
@ 2011-06-16  7:29             ` Jambunathan K
  2011-06-16  8:22               ` Rainer M Krug
  0 siblings, 1 reply; 217+ messages in thread
From: Jambunathan K @ 2011-06-16  7:29 UTC (permalink / raw)
  To: Rainer M Krug; +Cc: nicholas.dokos, emacs-orgmode


> There seems to be a problem with my .emacs.desktop files in
> combination with the new org 

It might help to try to narrow down the problem to one of the buffers -
starting with the org buffers to begin with.

Start nuking the buffers till you hit the problem or the problem
disappears.

It may not be buffers it could also be one of the other "states"
(whatever that means) that the desktop persists across sessions.

Jambunathan K.

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

* Re: BUG: Newest org-mode interferes with desktop save
  2011-06-16  7:29             ` Jambunathan K
@ 2011-06-16  8:22               ` Rainer M Krug
  0 siblings, 0 replies; 217+ messages in thread
From: Rainer M Krug @ 2011-06-16  8:22 UTC (permalink / raw)
  To: Jambunathan K, nicholas.dokos, Eric Schulte; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1622 bytes --]

On Thu, Jun 16, 2011 at 9:29 AM, Jambunathan K <kjambunathan@gmail.com>wrote:

>
> > There seems to be a problem with my .emacs.desktop files in
> > combination with the new org
>
> It might help to try to narrow down the problem to one of the buffers -
> starting with the org buffers to begin with.
>
> Start nuking the buffers till you hit the problem or the problem
> disappears.
>
>
OK - I hope I did what you suggested. My setup now:

a) created user foo
b) changed ownership of /home/foo recursively to me (rkrug:rkrug)
c) copied the attached .emacs file into foo's home directory
d) created directory ~foo/tmp
e) copied test.org, .emacs.desktop.error .emacs.desktop.noerror
f)
cd ~/foo/tmp
cp -f .emacs.desktop.error .emacs.desktop
emacs -u foo
quit emacs -- question there
g)
cp -f .emacs.desktop.noerror .emacs.desktop
emacs -u foo
quit emacs -- question not there

In the .emacs file, the load paths are set to the git version of org-mode.
If I set them to 7.5, no question at all.

Hope you can reproduce it now and it helps to pinpoint the problem,

Cheers,

Rainer


It may not be buffers it could also be one of the other "states"
> (whatever that means) that the desktop persists across sessions.
>
> Jambunathan K.
>



-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax (F):       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug

[-- Attachment #1.2: Type: text/html, Size: 3111 bytes --]

[-- Attachment #2: .emacs --]
[-- Type: application/octet-stream, Size: 1147 bytes --]

;;; init.el --- Where all the magic begins
;;
;; This file loads both
;; - Org-mode : http://orgmode.org/ and
;; - Org-babel: http://orgmode.org/worg/org-contrib/babel/org-babel.php#library-of-babel
;;
;; It then loads the rest of our Emacs initialization from Emacs lisp
;; embedded in literate Org-mode files.

;; Load up Org Mode and Org Babel for elisp embedded in Org Mode files
(add-to-list 'load-path "~/.emacs.d/org-mode/lisp")
(add-to-list 'load-path "~/.emacs.d/org-mode/contrib/lisp")

;; load up Org-mode and Org-babel
(require 'org-install)

(desktop-save-mode 1)
;; load up the main file
;; (org-babel-load-file "~/.emacs.d/emacs.org")

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )

[-- Attachment #3: test.org --]
[-- Type: application/octet-stream, Size: 7 bytes --]

* test

[-- Attachment #4: .emacs.desktop.error --]
[-- Type: application/octet-stream, Size: 7447 bytes --]

;; -*- mode: emacs-lisp; coding: emacs-mule; -*-
;; --------------------------------------------------------------------------
;; Desktop File for Emacs
;; --------------------------------------------------------------------------
;; Created Thu Jun 16 09:42:55 2011
;; Desktop file format version 206
;; Emacs version 23.3.1

;; Global section:
(setq desktop-missing-file-warning nil)
(setq tags-file-name nil)
(setq tags-table-list nil)
(setq search-ring '("row(" "parasiteP" "parP" "parasiteP" "simulate" "simulation" "tangle" ":P	" ":P" "Use" "63" "6" "y" "'" "lh" "Teachink"))
(setq regexp-search-ring nil)
(setq register-alist (list (list 49 '(frame-configuration ("Unprintable entity" ((parent-id . 27886798) (explicit-name) (display . ":0.0") (visibility . t) (icon-name) (outer-window-id . "48236292") (window-id . "48236295") (top . 0) (left . 0) (buried-buffer-list) (buffer-list "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity") (unsplittable) (minibuffer . "Unprintable entity") (modeline . t) (width . 176) (height . 50) (name . "*R*") (sticky) (background-mode . dark) (display-type . color) (alpha) (scroll-bar-width . 16) (cursor-type . box) (auto-lower) (auto-raise) (icon-type . t) (fullscreen . maximized) (wait-for-wm . t) (title) (buffer-predicate) (tool-bar-lines . 1) (menu-bar-lines . 1) (scroll-bar-background . "grey75") (scroll-bar-foreground) (right-fringe . 8) (left-fringe . 8) (line-spacing) (screen-gamma) (border-color . "black") (cursor-color . "medium turquoise") (mouse-color . "black") (background-color . "black") (foreground-color . "#c0c0c0") (vertical-scroll-bars . left) (internal-border-width . 0) (border-width . 2) (font . "-b&h-lucidatypewriter-medium-r-normal-sans-14-100-100-100-m-80-iso8859-1") (font-parameter . "lucidasanstypewriter-10") (font-backend xft x)) "Unprintable entity") ("Unprintable entity" ((parent-id . 27886530) (explicit-name) (display . ":0.0") (visibility . t) (icon-name) (outer-window-id . "48234660") (window-id . "48234681") (top . 923) (left . 0) (buried-buffer-list "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity") (buffer-list "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity") (unsplittable) (minibuffer . "Unprintable entity") (modeline . t) (width . 206) (height . 58) (name . "nsa.org") (sticky) (environment) (background-mode . dark) (display-type . color) (horizontal-scroll-bars . t) (window-system . x) (alpha) (scroll-bar-width . 16) (cursor-type . box) (auto-lower) (auto-raise) (icon-type . t) (fullscreen . maximized) (wait-for-wm . t) (title) (buffer-predicate) (tool-bar-lines . 1) (menu-bar-lines . 1) (scroll-bar-background . "grey75") (scroll-bar-foreground) (right-fringe . 8) (left-fringe . 8) (line-spacing) (screen-gamma) (border-color . "black") (cursor-color . "medium turquoise") (mouse-color . "black") (background-color . "black") (foreground-color . "#c0c0c0") (vertical-scroll-bars . left) (internal-border-width . 0) (border-width . 2) (font . "-b&h-lucidatypewriter-medium-r-normal-sans-14-100-100-100-m-80-iso8859-1") (font-parameter . "lucidasanstypewriter-10") (font-backend xft x)) "Unprintable entity")) (let ((mk (make-marker))) (add-hook 'desktop-delay-hook (list 'lambda '() (list 'set-marker mk nil (get-buffer " *temp*")))) mk)) (list 82 "Unprintable entity" (let ((mk (make-marker))) (add-hook 'desktop-delay-hook (list 'lambda '() (list 'set-marker mk nil (get-buffer " *temp*")))) mk))))
(setq file-name-history '("/home/rkrug/tmp/.emacs.desktop" "/home/rkrug/Documents/Projects/Herbivore_Parasite_dynamics/trunc/DESCRIPTION" "/home/rkrug/Documents/Projects/HakeaLandscape/trunc/R/disp/disp.org" "/home/rkrug/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/nsa.org" "/home/rkrug/Documents/Projects/HakeaLandscape/trunc/R/analysisFire.org" "/home/rkrug/Documents/Projects/HakeaLandscape/trunc/R/analysisFire.pdf" "/home/rkrug/.emacs.d/emacs.org" "/home/rkrug/Documents/Projects/Herbivore_Parasite_dynamics/trunc/R/hpd.R" "/home/rkrug/Documents/Projects/Herbivore_Parasite_dynamics/trunc/hpd.org" "/home/rkrug/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/nsa.org" "/home/rkrug/Documents/Projects/Herbivore_Parasite_dynamics/trunc/R/hpd.org" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Biocontrol_pooled.lyx" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Combined_pooled.lyx" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/AS_BC_manuscrip.lyx" "/home/rkrug/Documents/Projects/Herbivore_Parasite_dynamics/Documents/LifeCycle.plantuml" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Combined_pooled.sum.lyx" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Combined_all.tmp.lyx" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Combined_all.lyx" "/home/rkrug/tmp/tmp.org" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Biocontrol_pooled.lyx" "/home/rkrug/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/tmp.org" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Combined_pooled.lyx" "/home/rkrug/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/*.lyx" "/home/rkrug/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/Analysis_sensitivity.org" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Lowry_pooled.lyx" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/MainEffects_pooled.lyx" "~/tmp/nsa.sh" "/home/rkrug/tmp/test.org" "~/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/../nsa.sh" "/home/rkrug/tmp/notmuch.org" "/home/rkrug/.emacs.d/org-mode-git/org-mode/contrib/lisp/org-notmuch.el" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Overview_pooled.lyx" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Overview.lyx" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/MainEffects_pooled.lyx" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/AppendixMainEffects.lyx" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/AppendixOverview.lyx" "/home/rkrug/.emacs.d/emacs.org" "/home/rkrug/tmp/table.tex" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Analysis_sensitivity_sens2.tex" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Analysis_sensitivity_sens.tex" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Analysis_sensitivity_sens.lyx" "/home/rkrug/tmp/pm.org" "/home/rkrug/.emacs.d/emacs.org" "~/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/Analysis_sensitivity.tex" "~/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/doTSAnalysis.sub"))

;; Buffer section -- buffers listed in same order as in buffer list:
(desktop-create-buffer 206
  "/home/rkrug/tmp/.emacs.desktop"
  ".emacs.desktop"
  'emacs-lisp-mode
  nil
  7163
  '(nil nil)
  nil
  nil
  '((buffer-file-coding-system . emacs-mule-unix)))

(desktop-create-buffer 206
  "/home/rkrug/tmp/test.org"
  "test.org"
  'org-mode
  '(org-indent-mode)
  1
  '(nil nil)
  nil
  nil
  '((indent-tabs-mode) (buffer-file-coding-system . utf-8-unix) (truncate-lines . t)))


[-- Attachment #5: .emacs.desktop.noerror --]
[-- Type: application/octet-stream, Size: 7037 bytes --]

;; -*- mode: emacs-lisp; coding: emacs-mule; -*-
;; --------------------------------------------------------------------------
;; Desktop File for Emacs
;; --------------------------------------------------------------------------
;; Created Thu Jun 16 09:44:20 2011
;; Desktop file format version 206
;; Emacs version 23.3.1

;; Global section:
(setq desktop-missing-file-warning nil)
(setq tags-file-name nil)
(setq tags-table-list nil)
(setq search-ring '("row(" "parasiteP" "parP" "parasiteP" "simulate" "simulation" "tangle" ":P	" ":P" "Use" "63" "6" "y" "'" "lh" "Teachink"))
(setq regexp-search-ring nil)
(setq register-alist (list (list 49 '(frame-configuration ("Unprintable entity" ((parent-id . 27886798) (explicit-name) (display . ":0.0") (visibility . t) (icon-name) (outer-window-id . "48236292") (window-id . "48236295") (top . 0) (left . 0) (buried-buffer-list) (buffer-list "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity") (unsplittable) (minibuffer . "Unprintable entity") (modeline . t) (width . 176) (height . 50) (name . "*R*") (sticky) (background-mode . dark) (display-type . color) (alpha) (scroll-bar-width . 16) (cursor-type . box) (auto-lower) (auto-raise) (icon-type . t) (fullscreen . maximized) (wait-for-wm . t) (title) (buffer-predicate) (tool-bar-lines . 1) (menu-bar-lines . 1) (scroll-bar-background . "grey75") (scroll-bar-foreground) (right-fringe . 8) (left-fringe . 8) (line-spacing) (screen-gamma) (border-color . "black") (cursor-color . "medium turquoise") (mouse-color . "black") (background-color . "black") (foreground-color . "#c0c0c0") (vertical-scroll-bars . left) (internal-border-width . 0) (border-width . 2) (font . "-b&h-lucidatypewriter-medium-r-normal-sans-14-100-100-100-m-80-iso8859-1") (font-parameter . "lucidasanstypewriter-10") (font-backend xft x)) "Unprintable entity") ("Unprintable entity" ((parent-id . 27886530) (explicit-name) (display . ":0.0") (visibility . t) (icon-name) (outer-window-id . "48234660") (window-id . "48234681") (top . 923) (left . 0) (buried-buffer-list "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity") (buffer-list "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity" "Unprintable entity") (unsplittable) (minibuffer . "Unprintable entity") (modeline . t) (width . 206) (height . 58) (name . "nsa.org") (sticky) (environment) (background-mode . dark) (display-type . color) (horizontal-scroll-bars . t) (window-system . x) (alpha) (scroll-bar-width . 16) (cursor-type . box) (auto-lower) (auto-raise) (icon-type . t) (fullscreen . maximized) (wait-for-wm . t) (title) (buffer-predicate) (tool-bar-lines . 1) (menu-bar-lines . 1) (scroll-bar-background . "grey75") (scroll-bar-foreground) (right-fringe . 8) (left-fringe . 8) (line-spacing) (screen-gamma) (border-color . "black") (cursor-color . "medium turquoise") (mouse-color . "black") (background-color . "black") (foreground-color . "#c0c0c0") (vertical-scroll-bars . left) (internal-border-width . 0) (border-width . 2) (font . "-b&h-lucidatypewriter-medium-r-normal-sans-14-100-100-100-m-80-iso8859-1") (font-parameter . "lucidasanstypewriter-10") (font-backend xft x)) "Unprintable entity")) (let ((mk (make-marker))) (add-hook 'desktop-delay-hook (list 'lambda '() (list 'set-marker mk nil (get-buffer " *temp*")))) mk)) (list 82 "Unprintable entity" (let ((mk (make-marker))) (add-hook 'desktop-delay-hook (list 'lambda '() (list 'set-marker mk nil (get-buffer " *temp*")))) mk))))
(setq file-name-history '("/home/rkrug/tmp/.emacs.desktop" "/home/rkrug/Documents/Projects/Herbivore_Parasite_dynamics/trunc/DESCRIPTION" "/home/rkrug/Documents/Projects/HakeaLandscape/trunc/R/disp/disp.org" "/home/rkrug/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/nsa.org" "/home/rkrug/Documents/Projects/HakeaLandscape/trunc/R/analysisFire.org" "/home/rkrug/Documents/Projects/HakeaLandscape/trunc/R/analysisFire.pdf" "/home/rkrug/.emacs.d/emacs.org" "/home/rkrug/Documents/Projects/Herbivore_Parasite_dynamics/trunc/R/hpd.R" "/home/rkrug/Documents/Projects/Herbivore_Parasite_dynamics/trunc/hpd.org" "/home/rkrug/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/nsa.org" "/home/rkrug/Documents/Projects/Herbivore_Parasite_dynamics/trunc/R/hpd.org" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Biocontrol_pooled.lyx" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Combined_pooled.lyx" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/AS_BC_manuscrip.lyx" "/home/rkrug/Documents/Projects/Herbivore_Parasite_dynamics/Documents/LifeCycle.plantuml" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Combined_pooled.sum.lyx" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Combined_all.tmp.lyx" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Combined_all.lyx" "/home/rkrug/tmp/tmp.org" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Biocontrol_pooled.lyx" "/home/rkrug/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/tmp.org" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Combined_pooled.lyx" "/home/rkrug/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/*.lyx" "/home/rkrug/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/Analysis_sensitivity.org" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Lowry_pooled.lyx" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/MainEffects_pooled.lyx" "~/tmp/nsa.sh" "/home/rkrug/tmp/test.org" "~/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/../nsa.sh" "/home/rkrug/tmp/notmuch.org" "/home/rkrug/.emacs.d/org-mode-git/org-mode/contrib/lisp/org-notmuch.el" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Overview_pooled.lyx" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Overview.lyx" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/MainEffects_pooled.lyx" "~/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/AppendixMainEffects.lyx" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/AppendixOverview.lyx" "/home/rkrug/.emacs.d/emacs.org" "/home/rkrug/tmp/table.tex" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Analysis_sensitivity_sens2.tex" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Analysis_sensitivity_sens.tex" "/home/rkrug/Documents/Publications/2010/Paper/AcaciaSericaBiocontrol/Analysis_sensitivity_sens.lyx" "/home/rkrug/tmp/pm.org" "/home/rkrug/.emacs.d/emacs.org" "~/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/Analysis_sensitivity.tex" "~/Documents/Projects/BiocontrolAndAlienDynamics/nonSpatialAcacia/trunc/R/doTSAnalysis.sub"))

;; Buffer section -- buffers listed in same order as in buffer list:

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

* Handling errors in command line exporting of agenda?
@ 2011-08-05 22:15 John Hendy
  2011-08-05 23:34 ` suvayu ali
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2011-08-05 22:15 UTC (permalink / raw)
  To: emacs-orgmode

I have a custom view that I'm exporting to a text file and then
displaying on my wallpaper with conky. I noticed that if I actually
have emacs open and a file is autosaved but not saved "for real," then
the exported text file is blank. I use this command in cron:

,---
| emacs -batch -l ~/.emacs -eval '(org-batch-agenda "w")' >
~/org/aux/agenda-export.txt
`---

I ran this from the command line after noticing the cron job was
coming up empty, and saw the error:

,---
| ...file.org locked by jwhendy... (pid 27250): (s, q, p, ?)?
`---

If I saved the offending file, it re-ran fine. As soon as enough time
elapsed to generate an auto-save (I'm assuming), it failed again. Any
suggestions on how to proceed? For example, I though of:

1) writing a script that could handle the failure and leave the
current agenda exported text file if it happened
2) a way to respond to the emacs query (not sure what s, p, q, ? do)

Anything else that would work? If it's frozen and "not safe" to run
this command while a file is open/being modified, then just aborting
and leaving the status quot in the text file is what I'd like to do.


Thanks!
John

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-05 22:15 Handling errors in command line exporting of agenda? John Hendy
@ 2011-08-05 23:34 ` suvayu ali
  2011-08-05 23:35   ` suvayu ali
  2011-08-08 18:12   ` John Hendy
  0 siblings, 2 replies; 217+ messages in thread
From: suvayu ali @ 2011-08-05 23:34 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

Hi John,

On Sat, Aug 6, 2011 at 12:15 AM, John Hendy <jw.hendy@gmail.com> wrote:
> 1) writing a script that could handle the failure and leave the
> current agenda exported text file if it happened
>

Do you run into the same problem if you one the file before hand in
read only mode? Something like this before the agenda command might
work.

(find-file-read-only "FILENAME")

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-05 23:34 ` suvayu ali
@ 2011-08-05 23:35   ` suvayu ali
  2011-08-08 18:12   ` John Hendy
  1 sibling, 0 replies; 217+ messages in thread
From: suvayu ali @ 2011-08-05 23:35 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

On Sat, Aug 6, 2011 at 1:34 AM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> if you one the file

if you open* the file

Sorry for the typo.

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-05 23:34 ` suvayu ali
  2011-08-05 23:35   ` suvayu ali
@ 2011-08-08 18:12   ` John Hendy
  2011-08-08 18:28     ` suvayu ali
  1 sibling, 1 reply; 217+ messages in thread
From: John Hendy @ 2011-08-08 18:12 UTC (permalink / raw)
  To: suvayu ali; +Cc: emacs-orgmode

On Fri, Aug 5, 2011 at 6:34 PM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> Hi John,
>
> On Sat, Aug 6, 2011 at 12:15 AM, John Hendy <jw.hendy@gmail.com> wrote:
>> 1) writing a script that could handle the failure and leave the
>> current agenda exported text file if it happened
>>
>
> Do you run into the same problem if you one the file before hand in
> read only mode? Something like this before the agenda command might
> work.
>
> (find-file-read-only "FILENAME")

How would I do this via the command line? Also, it's pulling from
about 10 project files, so I'm not sure if I'd have to do this for
every file or how that works since the org-batch-agenda command seems
to be pulling from all of them. Perhaps there's some way to trigger
emacs to think, "Everything is read-only from here out"?


Thanks,
John

>
> --
> Suvayu
>
> Open source is the future. It sets us free.
>

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-08 18:12   ` John Hendy
@ 2011-08-08 18:28     ` suvayu ali
  2011-08-08 18:53       ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: suvayu ali @ 2011-08-08 18:28 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

Hi John,

On Mon, Aug 8, 2011 at 8:12 PM, John Hendy <jw.hendy@gmail.com> wrote:
>> Do you run into the same problem if you one the file before hand in
>> read only mode? Something like this before the agenda command might
>> work.
>>
>> (find-file-read-only "FILENAME")
>
> How would I do this via the command line? Also, it's pulling from
> about 10 project files, so I'm not sure if I'd have to do this for
> every file or how that works since the org-batch-agenda command seems
> to be pulling from all of them. Perhaps there's some way to trigger
> emacs to think, "Everything is read-only from here out"?

If you can use wildcards to specify your files, it might be possible by
just one extra call to --eval. Something like this might work:

emacs --batch -l ~/.emacs --eval '(find-file-read-only "<wildcard>" t)' \
      --eval '(org-batch-agenda "w")' > ~/org/aux/agenda-export.txt



> find-file-read-only is an interactive compiled Lisp function in
> `files.el'.
>
> It is bound to C-x C-r.
>
> (find-file-read-only FILENAME &optional WILDCARDS)
>
> Edit file FILENAME but don't allow changes.
> Like C-x C-f, but marks buffer as read-only.
> Use C-x C-q to permit editing.

Hope this helps.

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-08 18:28     ` suvayu ali
@ 2011-08-08 18:53       ` John Hendy
  2011-08-08 18:59         ` suvayu ali
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2011-08-08 18:53 UTC (permalink / raw)
  To: suvayu ali; +Cc: emacs-orgmode

On Mon, Aug 8, 2011 at 1:28 PM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> Hi John,
>
> On Mon, Aug 8, 2011 at 8:12 PM, John Hendy <jw.hendy@gmail.com> wrote:
>>> Do you run into the same problem if you one the file before hand in
>>> read only mode? Something like this before the agenda command might
>>> work.
>>>
>>> (find-file-read-only "FILENAME")
>>
>> How would I do this via the command line? Also, it's pulling from
>> about 10 project files, so I'm not sure if I'd have to do this for
>> every file or how that works since the org-batch-agenda command seems
>> to be pulling from all of them. Perhaps there's some way to trigger
>> emacs to think, "Everything is read-only from here out"?
>
> If you can use wildcards to specify your files, it might be possible by
> just one extra call to --eval. Something like this might work:
>
> emacs --batch -l ~/.emacs --eval '(find-file-read-only "<wildcard>" t)' \
>      --eval '(org-batch-agenda "w")' > ~/org/aux/agenda-export.txt
>

Hmm. That might work. Everything I pull from is in ~/org... could the
wildcard simply be "~/*.org"? Forgive my emacs wildcard ignorance. I
did some filename regexp magic *once* and it took me like two hours to
learn the syntax just to turn camera directory names from 10#_MMDD to
YYYY-MM-DD...

Thanks again,
John

>
>
>> find-file-read-only is an interactive compiled Lisp function in
>> `files.el'.
>>
>> It is bound to C-x C-r.
>>
>> (find-file-read-only FILENAME &optional WILDCARDS)
>>
>> Edit file FILENAME but don't allow changes.
>> Like C-x C-f, but marks buffer as read-only.
>> Use C-x C-q to permit editing.
>
> Hope this helps.
>
> --
> Suvayu
>
> Open source is the future. It sets us free.
>

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-08 18:53       ` John Hendy
@ 2011-08-08 18:59         ` suvayu ali
  2011-08-08 19:48           ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: suvayu ali @ 2011-08-08 18:59 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

Hi John,

On Mon, Aug 8, 2011 at 8:53 PM, John Hendy <jw.hendy@gmail.com> wrote:
>> If you can use wildcards to specify your files, it might be possible by
>> just one extra call to --eval. Something like this might work:
>>
>> emacs --batch -l ~/.emacs --eval '(find-file-read-only "<wildcard>" t)' \
>>      --eval '(org-batch-agenda "w")' > ~/org/aux/agenda-export.txt
>>
>
> Hmm. That might work. Everything I pull from is in ~/org... could the
> wildcard simply be "~/*.org"? Forgive my emacs wildcard ignorance.

As far as I know, emacs accepts any wildcard that is valid in the shell.
Since all your files are in ~/org, I would say try "~/org/*.org". The
'~/org/' limits it to files within your org directory and the '*.org'[1]
limits it to all files with a .org extension.

I hope this helps. :)

Footnotes:

[1] The asterisk (*) stands for zero or more characters. You can find
    more details in `man bash` under the heading "Pattern Matching".

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-08 18:59         ` suvayu ali
@ 2011-08-08 19:48           ` John Hendy
  2011-08-08 20:22             ` suvayu ali
                               ` (2 more replies)
  0 siblings, 3 replies; 217+ messages in thread
From: John Hendy @ 2011-08-08 19:48 UTC (permalink / raw)
  To: suvayu ali; +Cc: emacs-orgmode

On Mon, Aug 8, 2011 at 1:59 PM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> Hi John,
>
> On Mon, Aug 8, 2011 at 8:53 PM, John Hendy <jw.hendy@gmail.com> wrote:
>>> If you can use wildcards to specify your files, it might be possible by
>>> just one extra call to --eval. Something like this might work:
>>>
>>> emacs --batch -l ~/.emacs --eval '(find-file-read-only "<wildcard>" t)' \
>>>      --eval '(org-batch-agenda "w")' > ~/org/aux/agenda-export.txt
>>>
>>
>> Hmm. That might work. Everything I pull from is in ~/org... could the
>> wildcard simply be "~/*.org"? Forgive my emacs wildcard ignorance.
>
> As far as I know, emacs accepts any wildcard that is valid in the shell.
> Since all your files are in ~/org, I would say try "~/org/*.org". The
> '~/org/' limits it to files within your org directory and the '*.org'[1]
> limits it to all files with a .org extension.
>

Bummer, this is not working:

,---
| emacs -batch -l ~/.emacs -eval '(find-file-read-only "~/org/*.org" t)' \
| -eval '(org-batch-agenda "e")' > ~/org/aux/agenda-export.txt
`---

Do you see anything wrong with that? I guess I wonder what that first
part will do as perhaps the org-batch-agenda command is not
necessarily going to follow suit with the read-only command. As in,
does the first eval command affect anything that the org-batch-agenda
command is going to do? Is it trying to do the equivalent of opening
up all *.org files in read-only buffers and then run the agenda
export?


Thanks,
John
> I hope this helps. :)
>
> Footnotes:
>
> [1] The asterisk (*) stands for zero or more characters. You can find
>    more details in `man bash` under the heading "Pattern Matching".
>
> --
> Suvayu
>
> Open source is the future. It sets us free.
>

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-08 19:48           ` John Hendy
@ 2011-08-08 20:22             ` suvayu ali
  2011-08-08 20:31               ` John Hendy
  2011-08-08 20:33               ` Nick Dokos
  2011-08-08 20:37             ` Nick Dokos
  2011-08-08 21:46             ` suvayu ali
  2 siblings, 2 replies; 217+ messages in thread
From: suvayu ali @ 2011-08-08 20:22 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

Hi John,

On Mon, Aug 8, 2011 at 9:48 PM, John Hendy <jw.hendy@gmail.com> wrote:
> -batch -l ~/.emacs -eval

Your problem is the long options are wrong. According to the manpages,
there should be 2 hyphens.

--eval and --batch.

GL

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-08 20:22             ` suvayu ali
@ 2011-08-08 20:31               ` John Hendy
  2011-08-08 20:33               ` Nick Dokos
  1 sibling, 0 replies; 217+ messages in thread
From: John Hendy @ 2011-08-08 20:31 UTC (permalink / raw)
  To: suvayu ali; +Cc: emacs-orgmode

On Mon, Aug 8, 2011 at 3:22 PM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> Hi John,
>
> On Mon, Aug 8, 2011 at 9:48 PM, John Hendy <jw.hendy@gmail.com> wrote:
>> -batch -l ~/.emacs -eval
>
> Your problem is the long options are wrong. According to the manpages,
> there should be 2 hyphens.
>
> --eval and --batch.

Well, that might be *a* problem, but it's not *the* problem.

This produces the same results:
,---
| emacs --batch -l ~/.emacs --eval '(find-file-read-only "~/org/*.org" t)' \
| --eval '(org-batch-agenda "e")' > ~/org/aux/agenda-export.txt
`---

I get this from the command line:
,---
| ...~/org/rigor.org locked by jwhendy... (pid 10935): (s, q, p, ?)?
`---

Which means that when executed from cron, it won't proceed.

Also, good to know re. the man pages... however Worg is wrong, then.
Directly from Worg [1]:

,----------
| Let's say you generate an export from the command line, such as the following:
| ,---
| | emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
| `---
|
| or
|
| ,---
| |emacs -batch -l ~/.emacs -eval '(org-publish-all)'
| `---
`----------

The manual contains the same syntax. [2]

[1] http://orgmode.org/worg/org-faq.html (see How can I preserve faces
when I export an agenda from the command line?).
[2] http://orgmode.org/manual/Extracting-agenda-information.html#Extracting-agenda-information


Best regards,
John


>
> GL
>
> --
> Suvayu
>
> Open source is the future. It sets us free.
>

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-08 20:22             ` suvayu ali
  2011-08-08 20:31               ` John Hendy
@ 2011-08-08 20:33               ` Nick Dokos
  1 sibling, 0 replies; 217+ messages in thread
From: Nick Dokos @ 2011-08-08 20:33 UTC (permalink / raw)
  To: suvayu ali; +Cc: nicholas.dokos, emacs-orgmode

suvayu ali <fatkasuvayu+linux@gmail.com> wrote:

> Hi John,
> 
> On Mon, Aug 8, 2011 at 9:48 PM, John Hendy <jw.hendy@gmail.com> wrote:
> > -batch -l ~/.emacs -eval
> 
> Your problem is the long options are wrong. According to the manpages,
> there should be 2 hyphens.
> 
> --eval and --batch.
> 

Nope - emacs recognizes both (presumably the single hyphen ones are deprecated
but they still work:

    emacs -batch -eval '(message "foo")'

works fine.

Nick

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-08 19:48           ` John Hendy
  2011-08-08 20:22             ` suvayu ali
@ 2011-08-08 20:37             ` Nick Dokos
  2011-08-08 20:54               ` John Hendy
  2011-08-08 21:30               ` suvayu ali
  2011-08-08 21:46             ` suvayu ali
  2 siblings, 2 replies; 217+ messages in thread
From: Nick Dokos @ 2011-08-08 20:37 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode, nicholas.dokos

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

> On Mon, Aug 8, 2011 at 1:59 PM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> > Hi John,
> >
> > On Mon, Aug 8, 2011 at 8:53 PM, John Hendy <jw.hendy@gmail.com> wrote:
> >>> If you can use wildcards to specify your files, it might be possible by
> >>> just one extra call to --eval. Something like this might work:
> >>>
> >>> emacs --batch -l ~/.emacs --eval '(find-file-read-only "<wildcard>" t)' \
> >>>      --eval '(org-batch-agenda "w")' > ~/org/aux/agenda-export.txt
> >>>
> >>
> >> Hmm. That might work. Everything I pull from is in ~/org... could the
> >> wildcard simply be "~/*.org"? Forgive my emacs wildcard ignorance.
> >
> > As far as I know, emacs accepts any wildcard that is valid in the shell.
> > Since all your files are in ~/org, I would say try "~/org/*.org". The
> > '~/org/' limits it to files within your org directory and the '*.org'[1]
> > limits it to all files with a .org extension.

Not true - if you want wildcards expanded, you have to do it yourself.
E.g. C-h f file-expand-wildcards

,----
| file-expand-wildcards is a compiled Lisp function in `files.el'.
| 
| (file-expand-wildcards PATTERN &optional FULL)
| 
| Expand wildcard pattern PATTERN.
| This returns a list of file names which match the pattern.
| 
| If PATTERN is written as an absolute file name,
| the values are absolute also.
| 
| If PATTERN is written as a relative file name, it is interpreted
| relative to the current default directory, `default-directory'.
| The file names returned are normally also relative to the current
| default directory.  However, if FULL is non-nil, they are absolute.
`----

Nick

> >
> 
> Bummer, this is not working:
> 
> ,---
> | emacs -batch -l ~/.emacs -eval '(find-file-read-only "~/org/*.org" t)' \
> | -eval '(org-batch-agenda "e")' > ~/org/aux/agenda-export.txt
> `---
> 
> Do you see anything wrong with that? I guess I wonder what that first
> part will do as perhaps the org-batch-agenda command is not
> necessarily going to follow suit with the read-only command. As in,
> does the first eval command affect anything that the org-batch-agenda
> command is going to do? Is it trying to do the equivalent of opening
> up all *.org files in read-only buffers and then run the agenda
> export?
> 
> 
> Thanks,
> John
> > I hope this helps. :)
> >
> > Footnotes:
> >
> > [1] The asterisk (*) stands for zero or more characters. You can find
> >    more details in `man bash` under the heading "Pattern Matching".
> >
> > --
> > Suvayu
> >
> > Open source is the future. It sets us free.
> >
> 

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-08 20:37             ` Nick Dokos
@ 2011-08-08 20:54               ` John Hendy
  2011-08-08 21:09                 ` Nick Dokos
  2011-08-08 21:30               ` suvayu ali
  1 sibling, 1 reply; 217+ messages in thread
From: John Hendy @ 2011-08-08 20:54 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

On Mon, Aug 8, 2011 at 3:37 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> John Hendy <jw.hendy@gmail.com> wrote:
>
>> On Mon, Aug 8, 2011 at 1:59 PM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
>> > Hi John,
>> >
>> > On Mon, Aug 8, 2011 at 8:53 PM, John Hendy <jw.hendy@gmail.com> wrote:
>> >>> If you can use wildcards to specify your files, it might be possible by
>> >>> just one extra call to --eval. Something like this might work:
>> >>>
>> >>> emacs --batch -l ~/.emacs --eval '(find-file-read-only "<wildcard>" t)' \
>> >>>      --eval '(org-batch-agenda "w")' > ~/org/aux/agenda-export.txt
>> >>>
>> >>
>> >> Hmm. That might work. Everything I pull from is in ~/org... could the
>> >> wildcard simply be "~/*.org"? Forgive my emacs wildcard ignorance.
>> >
>> > As far as I know, emacs accepts any wildcard that is valid in the shell.
>> > Since all your files are in ~/org, I would say try "~/org/*.org". The
>> > '~/org/' limits it to files within your org directory and the '*.org'[1]
>> > limits it to all files with a .org extension.
>
> Not true - if you want wildcards expanded, you have to do it yourself.
> E.g. C-h f file-expand-wildcards
>
> ,----
> | file-expand-wildcards is a compiled Lisp function in `files.el'.
> |
> | (file-expand-wildcards PATTERN &optional FULL)
> |
> | Expand wildcard pattern PATTERN.
> | This returns a list of file names which match the pattern.
> |
> | If PATTERN is written as an absolute file name,
> | the values are absolute also.
> |
> | If PATTERN is written as a relative file name, it is interpreted
> | relative to the current default directory, `default-directory'.
> | The file names returned are normally also relative to the current
> | default directory.  However, if FULL is non-nil, they are absolute.
> `----
>

Thanks. I tried with this based on this new information:

,---
|  emacs --batch -l ~/.emacs --eval '(find-file-read-only \
| (file-expand-wildcards "~/org/*.org") t)' \
| --eval '(org-batch-agenda "e")' > ~/org/aux/agenda-export.txt
`---

But I get this error:
,---
| Wrong type argument: stringp, ("~/org/file1.org" "~/org/file2.org"... etc.)
`---

I'm assuming something about how I used this is returning the wrong data type?

As another option, if I run this and just respond with "p" when I'm
asked about the lock (proceed), it works. I'm assuming that running
agenda won't mess up an unsaved file, but that it just accesses it for
todos and other information. If this is the case and an automatic
"proceed" is safe... is there a way to pass some sort of "--force"
option to emacs from the command line to override the lock when it's
encountered?

I'm running through cron and thus am not able to manually respond to the prompt.


Thanks,
John

> Nick
>
>> >
>>
>> Bummer, this is not working:
>>
>> ,---
>> | emacs -batch -l ~/.emacs -eval '(find-file-read-only "~/org/*.org" t)' \
>> | -eval '(org-batch-agenda "e")' > ~/org/aux/agenda-export.txt
>> `---
>>
>> Do you see anything wrong with that? I guess I wonder what that first
>> part will do as perhaps the org-batch-agenda command is not
>> necessarily going to follow suit with the read-only command. As in,
>> does the first eval command affect anything that the org-batch-agenda
>> command is going to do? Is it trying to do the equivalent of opening
>> up all *.org files in read-only buffers and then run the agenda
>> export?
>>
>>
>> Thanks,
>> John
>> > I hope this helps. :)
>> >
>> > Footnotes:
>> >
>> > [1] The asterisk (*) stands for zero or more characters. You can find
>> >    more details in `man bash` under the heading "Pattern Matching".
>> >
>> > --
>> > Suvayu
>> >
>> > Open source is the future. It sets us free.
>> >
>>
>

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-08 20:54               ` John Hendy
@ 2011-08-08 21:09                 ` Nick Dokos
  2011-08-08 21:27                   ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2011-08-08 21:09 UTC (permalink / raw)
  To: John Hendy; +Cc: nicholas.dokos, emacs-orgmode

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

> On Mon, Aug 8, 2011 at 3:37 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> > John Hendy <jw.hendy@gmail.com> wrote:
> >
> >> On Mon, Aug 8, 2011 at 1:59 PM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> >> > Hi John,
> >> >
> >> > On Mon, Aug 8, 2011 at 8:53 PM, John Hendy <jw.hendy@gmail.com> wrote:
> >> >>> If you can use wildcards to specify your files, it might be possible by
> >> >>> just one extra call to --eval. Something like this might work:
> >> >>>
> >> >>> emacs --batch -l ~/.emacs --eval '(find-file-read-only "<wildcard>" t)' \
> >> >>>      --eval '(org-batch-agenda "w")' > ~/org/aux/agenda-export.txt
> >> >>>
> >> >>
> >> >> Hmm. That might work. Everything I pull from is in ~/org... could the
> >> >> wildcard simply be "~/*.org"? Forgive my emacs wildcard ignorance.
> >> >
> >> > As far as I know, emacs accepts any wildcard that is valid in the shell.
> >> > Since all your files are in ~/org, I would say try "~/org/*.org". The
> >> > '~/org/' limits it to files within your org directory and the '*.org'[1]
> >> > limits it to all files with a .org extension.
> >
> > Not true - if you want wildcards expanded, you have to do it yourself.
> > E.g. C-h f file-expand-wildcards
> >
> > ,----
> > | file-expand-wildcards is a compiled Lisp function in `files.el'.
> > |
> > | (file-expand-wildcards PATTERN &optional FULL)
> > |
> > | Expand wildcard pattern PATTERN.
> > | This returns a list of file names which match the pattern.
> > |
> > | If PATTERN is written as an absolute file name,
> > | the values are absolute also.
> > |
> > | If PATTERN is written as a relative file name, it is interpreted
> > | relative to the current default directory, `default-directory'.
> > | The file names returned are normally also relative to the current
> > | default directory.  However, if FULL is non-nil, they are absolute.
> > `----
> >
> 
> Thanks. I tried with this based on this new information:
> 
> ,---
> |  emacs --batch -l ~/.emacs --eval '(find-file-read-only \
> | (file-expand-wildcards "~/org/*.org") t)' \
> | --eval '(org-batch-agenda "e")' > ~/org/aux/agenda-export.txt
> `---
> 
> But I get this error:
> ,---
> | Wrong type argument: stringp, ("~/org/file1.org" "~/org/file2.org"... etc.)
> `---
> 
> I'm assuming something about how I used this is returning the wrong data type?

Yes:

| This returns a list of file names which match the pattern.

so you have to loop over the list.

Nick

PS. BTW, don't take this as an endorsement of the course you are
following.  I don't have the time to think much about it, and I don't
have a better solution, but personally, I would try to find another
method: my knee-jerk reaction was to use emacsclient if emacs is running
(if not, fall back to emacs --batch: since no other instance is running,
you wouldn't have to deal with locking in that case).  But that may or
may not work - I just don't know.

> 
> As another option, if I run this and just respond with "p" when I'm
> asked about the lock (proceed), it works. I'm assuming that running
> agenda won't mess up an unsaved file, but that it just accesses it for
> todos and other information. If this is the case and an automatic
> "proceed" is safe... is there a way to pass some sort of "--force"
> option to emacs from the command line to override the lock when it's
> encountered?
> 
> I'm running through cron and thus am not able to manually respond to the prompt.
> 
> 
> Thanks,
> John
> 
> > Nick
> >
> >> >
> >>
> >> Bummer, this is not working:
> >>
> >> ,---
> >> | emacs -batch -l ~/.emacs -eval '(find-file-read-only "~/org/*.org" t)' \
> >> | -eval '(org-batch-agenda "e")' > ~/org/aux/agenda-export.txt
> >> `---
> >>
> >> Do you see anything wrong with that? I guess I wonder what that first
> >> part will do as perhaps the org-batch-agenda command is not
> >> necessarily going to follow suit with the read-only command. As in,
> >> does the first eval command affect anything that the org-batch-agenda
> >> command is going to do? Is it trying to do the equivalent of opening
> >> up all *.org files in read-only buffers and then run the agenda
> >> export?
> >>
> >>
> >> Thanks,
> >> John
> >> > I hope this helps. :)
> >> >
> >> > Footnotes:
> >> >
> >> > [1] The asterisk (*) stands for zero or more characters. You can find
> >> >    more details in `man bash` under the heading "Pattern Matching".
> >> >
> >> > --
> >> > Suvayu
> >> >
> >> > Open source is the future. It sets us free.
> >> >
> >>
> >
> 

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-08 21:09                 ` Nick Dokos
@ 2011-08-08 21:27                   ` John Hendy
  0 siblings, 0 replies; 217+ messages in thread
From: John Hendy @ 2011-08-08 21:27 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

On Mon, Aug 8, 2011 at 4:09 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> John Hendy <jw.hendy@gmail.com> wrote:
>
>> On Mon, Aug 8, 2011 at 3:37 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>> > John Hendy <jw.hendy@gmail.com> wrote:
>> >
>> >> On Mon, Aug 8, 2011 at 1:59 PM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
>> >> > Hi John,
>> >> >
>> >> > On Mon, Aug 8, 2011 at 8:53 PM, John Hendy <jw.hendy@gmail.com> wrote:
>> >> >>> If you can use wildcards to specify your files, it might be possible by
>> >> >>> just one extra call to --eval. Something like this might work:
>> >> >>>
>> >> >>> emacs --batch -l ~/.emacs --eval '(find-file-read-only "<wildcard>" t)' \
>> >> >>>      --eval '(org-batch-agenda "w")' > ~/org/aux/agenda-export.txt
>> >> >>>
>> >> >>
>> >> >> Hmm. That might work. Everything I pull from is in ~/org... could the
>> >> >> wildcard simply be "~/*.org"? Forgive my emacs wildcard ignorance.
>> >> >
>> >> > As far as I know, emacs accepts any wildcard that is valid in the shell.
>> >> > Since all your files are in ~/org, I would say try "~/org/*.org". The
>> >> > '~/org/' limits it to files within your org directory and the '*.org'[1]
>> >> > limits it to all files with a .org extension.
>> >
>> > Not true - if you want wildcards expanded, you have to do it yourself.
>> > E.g. C-h f file-expand-wildcards
>> >
>> > ,----
>> > | file-expand-wildcards is a compiled Lisp function in `files.el'.
>> > |
>> > | (file-expand-wildcards PATTERN &optional FULL)
>> > |
>> > | Expand wildcard pattern PATTERN.
>> > | This returns a list of file names which match the pattern.
>> > |
>> > | If PATTERN is written as an absolute file name,
>> > | the values are absolute also.
>> > |
>> > | If PATTERN is written as a relative file name, it is interpreted
>> > | relative to the current default directory, `default-directory'.
>> > | The file names returned are normally also relative to the current
>> > | default directory.  However, if FULL is non-nil, they are absolute.
>> > `----
>> >
>>
>> Thanks. I tried with this based on this new information:
>>
>> ,---
>> |  emacs --batch -l ~/.emacs --eval '(find-file-read-only \
>> | (file-expand-wildcards "~/org/*.org") t)' \
>> | --eval '(org-batch-agenda "e")' > ~/org/aux/agenda-export.txt
>> `---
>>
>> But I get this error:
>> ,---
>> | Wrong type argument: stringp, ("~/org/file1.org" "~/org/file2.org"... etc.)
>> `---
>>
>> I'm assuming something about how I used this is returning the wrong data type?
>
> Yes:
>
> | This returns a list of file names which match the pattern.
>
> so you have to loop over the list.

Ah. Got it. I have no elisp-fu to figure that out.

>
> Nick
>
> PS. BTW, don't take this as an endorsement of the course you are
> following.  I don't have the time to think much about it, and I don't
> have a better solution, but personally, I would try to find another
> method: my knee-jerk reaction was to use emacsclient if emacs is running
> (if not, fall back to emacs --batch: since no other instance is running,
> you wouldn't have to deal with locking in that case).  But that may or
> may not work - I just don't know.
>

Understood. I though the batch method would be great until all of this
happened. All I want is some kind of agenda "snapshot generator" so I
can have a visible reminder of that's going on always present, whether
emacs is running or not. I'm running equipment and out of my office
all the time. I don't live in emacs and don't even have it open unless
I'm taking notes actively. Thus, having it on my wallpaper would be my
ideal solution as a reminder of what I need to do.


John

>>
>> As another option, if I run this and just respond with "p" when I'm
>> asked about the lock (proceed), it works. I'm assuming that running
>> agenda won't mess up an unsaved file, but that it just accesses it for
>> todos and other information. If this is the case and an automatic
>> "proceed" is safe... is there a way to pass some sort of "--force"
>> option to emacs from the command line to override the lock when it's
>> encountered?
>>
>> I'm running through cron and thus am not able to manually respond to the prompt.
>>
>>
>> Thanks,
>> John
>>
>> > Nick
>> >
>> >> >
>> >>
>> >> Bummer, this is not working:
>> >>
>> >> ,---
>> >> | emacs -batch -l ~/.emacs -eval '(find-file-read-only "~/org/*.org" t)' \
>> >> | -eval '(org-batch-agenda "e")' > ~/org/aux/agenda-export.txt
>> >> `---
>> >>
>> >> Do you see anything wrong with that? I guess I wonder what that first
>> >> part will do as perhaps the org-batch-agenda command is not
>> >> necessarily going to follow suit with the read-only command. As in,
>> >> does the first eval command affect anything that the org-batch-agenda
>> >> command is going to do? Is it trying to do the equivalent of opening
>> >> up all *.org files in read-only buffers and then run the agenda
>> >> export?
>> >>
>> >>
>> >> Thanks,
>> >> John
>> >> > I hope this helps. :)
>> >> >
>> >> > Footnotes:
>> >> >
>> >> > [1] The asterisk (*) stands for zero or more characters. You can find
>> >> >    more details in `man bash` under the heading "Pattern Matching".
>> >> >
>> >> > --
>> >> > Suvayu
>> >> >
>> >> > Open source is the future. It sets us free.
>> >> >
>> >>
>> >
>>
>

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-08 20:37             ` Nick Dokos
  2011-08-08 20:54               ` John Hendy
@ 2011-08-08 21:30               ` suvayu ali
  2011-08-08 22:17                 ` Nick Dokos
  1 sibling, 1 reply; 217+ messages in thread
From: suvayu ali @ 2011-08-08 21:30 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

Hi Nick,

On Mon, Aug 8, 2011 at 10:37 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>> > As far as I know, emacs accepts any wildcard that is valid in the shell.
>> > Since all your files are in ~/org, I would say try "~/org/*.org". The
>> > '~/org/' limits it to files within your org directory and the '*.org'[1]
>> > limits it to all files with a .org extension.
>
> Not true - if you want wildcards expanded, you have to do it yourself.
> E.g. C-h f file-expand-wildcards

I should have been more precise. I meant to say in the context of the
current function or other functions which _accept_ wildcards as valid
arguments. Of course internally they use file-expand-wildcards, easily
verified by looking at the source of find-file. :)

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-08 19:48           ` John Hendy
  2011-08-08 20:22             ` suvayu ali
  2011-08-08 20:37             ` Nick Dokos
@ 2011-08-08 21:46             ` suvayu ali
  2 siblings, 0 replies; 217+ messages in thread
From: suvayu ali @ 2011-08-08 21:46 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

Hi John,

On Mon, Aug 8, 2011 at 9:48 PM, John Hendy <jw.hendy@gmail.com> wrote:
>
>   emacs -batch -l ~/.emacs -eval '(find-file-read-only "~/org/*.org" t)' \
>   -eval '(org-batch-agenda "e")' > ~/org/aux/agenda-export.txt
>

As I understand, with the above command the wildcard works but the file
locking prevents you from running it as a cron job. I could not find a
solution from a cursory search in the emacs and elisp manual. However I
have an alternate solution.

If you already have an emacs instance running, you could run your agenda
export as a timer within emacs. I don't know about the exact
implementation details, but I think you can find enough hints in the
following Worg entry in org-hacks.

<http://orgmode.org/worg/org-hacks.html#sec-2-4>

GL

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Handling errors in command line exporting of agenda?
  2011-08-08 21:30               ` suvayu ali
@ 2011-08-08 22:17                 ` Nick Dokos
  0 siblings, 0 replies; 217+ messages in thread
From: Nick Dokos @ 2011-08-08 22:17 UTC (permalink / raw)
  To: suvayu ali; +Cc: nicholas.dokos, emacs-orgmode

suvayu ali <fatkasuvayu+linux@gmail.com> wrote:

> Hi Nick,
> 
> On Mon, Aug 8, 2011 at 10:37 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> >> > As far as I know, emacs accepts any wildcard that is valid in the shell.
> >> > Since all your files are in ~/org, I would say try "~/org/*.org". The
> >> > '~/org/' limits it to files within your org directory and the '*.org'[1]
> >> > limits it to all files with a .org extension.
> >
> > Not true - if you want wildcards expanded, you have to do it yourself.
> > E.g. C-h f file-expand-wildcards
> 
> I should have been more precise. I meant to say in the context of the
> current function or other functions which _accept_ wildcards as valid
> arguments. Of course internally they use file-expand-wildcards, easily
> verified by looking at the source of find-file. :)
> 

No, you were precise enough, but I was too careless to see it (and of
course *knew* that find-file does not expand wildcards, even though the
last time I looked at the code or its doc was probably 20 years ago: I
have an inherent bias to assume that things don't change after I learn
about them :-) ).

You are right about find-file and friends re wildcards. I don't know why
this does not work:

$ emacs --batch --eval '(progn (find-file-read-only "~/lib/org/*.org" t) (org-batch-agenda "t"))' 2>/dev/null
Global list of TODO items of type: ALL
Available with `N r': (0)ALL

and nothing after it, but when I evaluate (org-batch-agenda "t") in
the running emacs, I get everything.

Nick

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

* Prompt for time when clocking in?
@ 2011-10-19 14:54 Nathan Neff
  2011-10-19 15:12 ` John Hendy
  2011-10-19 16:37 ` Bernt Hansen
  0 siblings, 2 replies; 217+ messages in thread
From: Nathan Neff @ 2011-10-19 14:54 UTC (permalink / raw)
  To: emacs-orgmode

Is there a way to pull up a date/time prompt when clocking in to a task?

Sometimes, I started a task 15 minutes ago, and have to go through the following
steps:

1) clock in on the task,
2) Go to the CLOCK section for that header and press tab to open it
3) Fix the clock-in time

If it's not built in, does anyone have any slick functions that would accomplish
the same thing? :-)

Thanks,
--Nate

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

* Re: Prompt for time when clocking in?
  2011-10-19 14:54 Prompt for time when clocking in? Nathan Neff
@ 2011-10-19 15:12 ` John Hendy
  2011-10-19 15:35   ` Nick Dokos
  2011-10-19 16:37 ` Bernt Hansen
  1 sibling, 1 reply; 217+ messages in thread
From: John Hendy @ 2011-10-19 15:12 UTC (permalink / raw)
  To: Nathan Neff; +Cc: emacs-orgmode

On Wed, Oct 19, 2011 at 9:54 AM, Nathan Neff <nathan.neff@gmail.com> wrote:
> Is there a way to pull up a date/time prompt when clocking in to a task?
>
> Sometimes, I started a task 15 minutes ago, and have to go through the following
> steps:
>
> 1) clock in on the task,
> 2) Go to the CLOCK section for that header and press tab to open it
> 3) Fix the clock-in time
>
> If it's not built in, does anyone have any slick functions that would accomplish
> the same thing? :-)

Check out a thread I started a bit back on this exact topic:
--- http://www.mail-archive.com/emacs-orgmode@gnu.org/msg40498.html

It wasn't exactly what I expected, the suggestion by Bernt for `M-x
org-resolve-clocks` works reasonably well if you are trying to clock
back-to-back activities. Post back after you read that perhaps? Maybe
you'll find something helpful.

John


>
> Thanks,
> --Nate
>
>

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

* Re: Prompt for time when clocking in?
  2011-10-19 15:12 ` John Hendy
@ 2011-10-19 15:35   ` Nick Dokos
  2011-10-20 16:15     ` Nathan Neff
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2011-10-19 15:35 UTC (permalink / raw)
  To: John Hendy; +Cc: nicholas.dokos, emacs-orgmode

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

> On Wed, Oct 19, 2011 at 9:54 AM, Nathan Neff <nathan.neff@gmail.com> wrote:
> > Is there a way to pull up a date/time prompt when clocking in to a task?
> >
> > Sometimes, I started a task 15 minutes ago, and have to go through the following
> > steps:
> >
> > 1) clock in on the task,
> > 2) Go to the CLOCK section for that header and press tab to open it
> > 3) Fix the clock-in time
> >
> > If it's not built in, does anyone have any slick functions that would accomplish
> > the same thing? :-)
> 
> Check out a thread I started a bit back on this exact topic:
> --- http://www.mail-archive.com/emacs-orgmode@gnu.org/msg40498.html
> 
> It wasn't exactly what I expected, the suggestion by Bernt for `M-x
> org-resolve-clocks` works reasonably well if you are trying to clock
> back-to-back activities. Post back after you read that perhaps? Maybe
> you'll find something helpful.
> 

org-clock-in takes an optional start-time argument which is used instead
of the current time when non-nil. So I tried

(setq ct (current-time))
(setq start-time (cons (car ct) (list (- (cadr ct) 900) (caddr ct))))

and started a clock on a task with

ESC ESC : (org-clock-in nil start-time)

and it got clocked in 15 minutes before the current time.

Now I don't propose this as a good UI :-), but it would require just a
small wrapper for it to dtrt.

HTH,
Nick

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

* Re: Prompt for time when clocking in?
  2011-10-19 14:54 Prompt for time when clocking in? Nathan Neff
  2011-10-19 15:12 ` John Hendy
@ 2011-10-19 16:37 ` Bernt Hansen
  1 sibling, 0 replies; 217+ messages in thread
From: Bernt Hansen @ 2011-10-19 16:37 UTC (permalink / raw)
  To: Nathan Neff; +Cc: emacs-orgmode

Nathan Neff <nathan.neff@gmail.com> writes:

> Is there a way to pull up a date/time prompt when clocking in to a task?
>
> Sometimes, I started a task 15 minutes ago, and have to go through the following
> steps:
>
> 1) clock in on the task,
> 2) Go to the CLOCK section for that header and press tab to open it
> 3) Fix the clock-in time
>
> If it's not built in, does anyone have any slick functions that would accomplish
> the same thing? :-)
>
> Thanks,
> --Nate

For editing clock times I use the agenda

C-c a a v c

and then visit the lines I want to edit from the agenda with RET.

HTH,
Bernt

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

* Re: Prompt for time when clocking in?
  2011-10-19 15:35   ` Nick Dokos
@ 2011-10-20 16:15     ` Nathan Neff
  2011-10-20 17:09       ` Nick Dokos
  0 siblings, 1 reply; 217+ messages in thread
From: Nathan Neff @ 2011-10-20 16:15 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

Some progress --

I used Nick's suggestion combined with the org-read-date function.

This is my first attempt -- It will prompt you for a time, and clock
in to the headline that the cursor is on with that time.

(defun njn/clock-in-at-time()
       (interactive)
(setq start-time (org-read-date 't 't))
(org-clock-in nil start-time)
    )

It's a bit wonky if you clock in to a past time, and then you want to
resolve that clock, but my main use-case for now is this:

1) I start doing something
2) I forgot to clock in
3) I don't want to press 8 keys in order to clock in 15 minutes ago.

This solution should work for now.  Although, I could see it being a
handy way to
prompt for clock-in *and* clock-out times.

Thanks for the suggestions,

--Nate

On Wed, Oct 19, 2011 at 10:35 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> John Hendy <jw.hendy@gmail.com> wrote:
>
>> On Wed, Oct 19, 2011 at 9:54 AM, Nathan Neff <nathan.neff@gmail.com> wrote:
>> > Is there a way to pull up a date/time prompt when clocking in to a task?
>> >
>> > Sometimes, I started a task 15 minutes ago, and have to go through the following
>> > steps:
>> >
>> > 1) clock in on the task,
>> > 2) Go to the CLOCK section for that header and press tab to open it
>> > 3) Fix the clock-in time
>> >
>> > If it's not built in, does anyone have any slick functions that would accomplish
>> > the same thing? :-)
>>
>> Check out a thread I started a bit back on this exact topic:
>> --- http://www.mail-archive.com/emacs-orgmode@gnu.org/msg40498.html
>>
>> It wasn't exactly what I expected, the suggestion by Bernt for `M-x
>> org-resolve-clocks` works reasonably well if you are trying to clock
>> back-to-back activities. Post back after you read that perhaps? Maybe
>> you'll find something helpful.
>>
>
> org-clock-in takes an optional start-time argument which is used instead
> of the current time when non-nil. So I tried
>
> (setq ct (current-time))
> (setq start-time (cons (car ct) (list (- (cadr ct) 900) (caddr ct))))
>
> and started a clock on a task with
>
> ESC ESC : (org-clock-in nil start-time)
>
> and it got clocked in 15 minutes before the current time.
>
> Now I don't propose this as a good UI :-), but it would require just a
> small wrapper for it to dtrt.
>
> HTH,
> Nick
>
>
>

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

* Re: Prompt for time when clocking in?
  2011-10-20 16:15     ` Nathan Neff
@ 2011-10-20 17:09       ` Nick Dokos
  2011-10-20 17:44         ` Nathan Neff
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2011-10-20 17:09 UTC (permalink / raw)
  To: Nathan Neff; +Cc: nicholas.dokos, emacs-orgmode

Nathan Neff <nathan.neff@gmail.com> wrote:

> Some progress --
> 
> I used Nick's suggestion combined with the org-read-date function.
> 
> This is my first attempt -- It will prompt you for a time, and clock
> in to the headline that the cursor is on with that time.
> 
> (defun njn/clock-in-at-time()
>        (interactive)
> (setq start-time (org-read-date 't 't))
> (org-clock-in nil start-time)
>     )
> 

Two minor nits: t is a constant so you don't need to quote it; emacs-lisp
mode helps with indentation (putting it in a code block - see below -
in an org file and using C-c ' to edit it works wonderfully).

I'm not sure whether 'tis better to specify relative or absolute times
("let's see: I should have clocked in 15 mins ago" vs "Let's see: I
should have clocked in at 12:20"), but just in case you want to try the
alternatives, here are two dummy function functions for the two
alternatives - they just print the result time in the echo area.

The rel time can use a prefix arg (ESC -15 M-x
rel/dummy-clock-in-at-time) or the minibuffer if no prefix arg is
specified (and you might want to bias it towards the past, so 15 = 15
mins ago and -15 = 15 mins from now, but that might be a bit
perverse).

FWIW, I think I would tend to prefer your implementation, but since I
clock nothing, I'm no expert :-)

Nick

#+begin_src elisp

(defun rel/dummy-clock-in-at-time (nmin)
  (interactive "N+/-minutes: ")
  (setq start-time (time-add (current-time) (seconds-to-time (* nmin 60))))
  (message (format-time-string "%H:%M:%S" start-time)))

(defun abs/dummy-clock-in-at-time()
  (interactive)
  (setq start-time (org-read-date t t))
  (message (format-time-string "%H:%M:%S" start-time)))

#+end_src



> It's a bit wonky if you clock in to a past time, and then you want to
> resolve that clock, but my main use-case for now is this:
> 
> 1) I start doing something
> 2) I forgot to clock in
> 3) I don't want to press 8 keys in order to clock in 15 minutes ago.
> 
> This solution should work for now.  Although, I could see it being a
> handy way to
> prompt for clock-in *and* clock-out times.
> 
> Thanks for the suggestions,
> 
> --Nate
> 
> On Wed, Oct 19, 2011 at 10:35 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> > John Hendy <jw.hendy@gmail.com> wrote:
> >
> >> On Wed, Oct 19, 2011 at 9:54 AM, Nathan Neff <nathan.neff@gmail.com> wrote:
> >> > Is there a way to pull up a date/time prompt when clocking in to a task?
> >> >
> >> > Sometimes, I started a task 15 minutes ago, and have to go through the following
> >> > steps:
> >> >
> >> > 1) clock in on the task,
> >> > 2) Go to the CLOCK section for that header and press tab to open it
> >> > 3) Fix the clock-in time
> >> >
> >> > If it's not built in, does anyone have any slick functions that would accomplish
> >> > the same thing? :-)
> >>
> >> Check out a thread I started a bit back on this exact topic:
> >> --- http://www.mail-archive.com/emacs-orgmode@gnu.org/msg40498.html
> >>
> >> It wasn't exactly what I expected, the suggestion by Bernt for `M-x
> >> org-resolve-clocks` works reasonably well if you are trying to clock
> >> back-to-back activities. Post back after you read that perhaps? Maybe
> >> you'll find something helpful.
> >>
> >
> > org-clock-in takes an optional start-time argument which is used instead
> > of the current time when non-nil. So I tried
> >
> > (setq ct (current-time))
> > (setq start-time (cons (car ct) (list (- (cadr ct) 900) (caddr ct))))
> >
> > and started a clock on a task with
> >
> > ESC ESC : (org-clock-in nil start-time)
> >
> > and it got clocked in 15 minutes before the current time.
> >
> > Now I don't propose this as a good UI :-), but it would require just a
> > small wrapper for it to dtrt.
> >
> > HTH,
> > Nick
> >
> >
> >
> 

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

* Re: Prompt for time when clocking in?
  2011-10-20 17:09       ` Nick Dokos
@ 2011-10-20 17:44         ` Nathan Neff
  0 siblings, 0 replies; 217+ messages in thread
From: Nathan Neff @ 2011-10-20 17:44 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

> Two minor nits: t is a constant so you don't need to quote it; emacs-lisp
> mode helps with indentation (putting it in a code block - see below -
> in an org file and using C-c ' to edit it works wonderfully).

Thanks for your suggestions re: using Emacs to edit
lisp code and using the t in lieu of 't -- I appreciate these types
of style/coding comments immensely!

>
> I'm not sure whether 'tis better to specify relative or absolute times
> ("let's see: I should have clocked in 15 mins ago" vs "Let's see: I
> should have clocked in at 12:20"), but just in case you want to try the
> alternatives, here are two dummy function functions for the two
> alternatives - they just print the result time in the echo area.

Nick, I like the ability to just type "15", but I also like the
ability to use the
familiar org-calendar in case I want to get fancier (for example, I
forgot to clock
something that I worked on yesterday)

It would be a cool feature of org-read-date to be able to type "-15M"
and have org-read-date go back 15 minutes from the current date/time.
I played around with org-read date for something like -"15m" and
"-15M", but the "-15m" went back 15 *months*, not minutes.

Does anyone know if there's a way to specify a relative *time* using
org-read-date?  For example, something like -15M would be "15 minutes
earlier"?

Thanks,
--Nate
>
> The rel time can use a prefix arg (ESC -15 M-x
> rel/dummy-clock-in-at-time) or the minibuffer if no prefix arg is
> specified (and you might want to bias it towards the past, so 15 = 15
> mins ago and -15 = 15 mins from now, but that might be a bit
> perverse).
>
> FWIW, I think I would tend to prefer your implementation, but since I
> clock nothing, I'm no expert :-)
>
> Nick
>
> #+begin_src elisp
>
> (defun rel/dummy-clock-in-at-time (nmin)
>  (interactive "N+/-minutes: ")
>  (setq start-time (time-add (current-time) (seconds-to-time (* nmin 60))))
>  (message (format-time-string "%H:%M:%S" start-time)))
>
> (defun abs/dummy-clock-in-at-time()
>  (interactive)
>  (setq start-time (org-read-date t t))
>  (message (format-time-string "%H:%M:%S" start-time)))
>
> #+end_src
>
>
>
>> It's a bit wonky if you clock in to a past time, and then you want to
>> resolve that clock, but my main use-case for now is this:
>>
>> 1) I start doing something
>> 2) I forgot to clock in
>> 3) I don't want to press 8 keys in order to clock in 15 minutes ago.
>>
>> This solution should work for now.  Although, I could see it being a
>> handy way to
>> prompt for clock-in *and* clock-out times.
>>
>> Thanks for the suggestions,
>>
>> --Nate
>>
>> On Wed, Oct 19, 2011 at 10:35 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>> > John Hendy <jw.hendy@gmail.com> wrote:
>> >
>> >> On Wed, Oct 19, 2011 at 9:54 AM, Nathan Neff <nathan.neff@gmail.com> wrote:
>> >> > Is there a way to pull up a date/time prompt when clocking in to a task?
>> >> >
>> >> > Sometimes, I started a task 15 minutes ago, and have to go through the following
>> >> > steps:
>> >> >
>> >> > 1) clock in on the task,
>> >> > 2) Go to the CLOCK section for that header and press tab to open it
>> >> > 3) Fix the clock-in time
>> >> >
>> >> > If it's not built in, does anyone have any slick functions that would accomplish
>> >> > the same thing? :-)
>> >>
>> >> Check out a thread I started a bit back on this exact topic:
>> >> --- http://www.mail-archive.com/emacs-orgmode@gnu.org/msg40498.html
>> >>
>> >> It wasn't exactly what I expected, the suggestion by Bernt for `M-x
>> >> org-resolve-clocks` works reasonably well if you are trying to clock
>> >> back-to-back activities. Post back after you read that perhaps? Maybe
>> >> you'll find something helpful.
>> >>
>> >
>> > org-clock-in takes an optional start-time argument which is used instead
>> > of the current time when non-nil. So I tried
>> >
>> > (setq ct (current-time))
>> > (setq start-time (cons (car ct) (list (- (cadr ct) 900) (caddr ct))))
>> >
>> > and started a clock on a task with
>> >
>> > ESC ESC : (org-clock-in nil start-time)
>> >
>> > and it got clocked in 15 minutes before the current time.
>> >
>> > Now I don't propose this as a good UI :-), but it would require just a
>> > small wrapper for it to dtrt.
>> >
>> > HTH,
>> > Nick
>> >
>> >
>> >
>>
>

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

* Pass LaTeX exporter option prior to \documentclass
@ 2011-11-02  2:22 John Hendy
  2011-11-02  2:43 ` suvayu ali
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2011-11-02  2:22 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I'm creating a beamer presentation and screencasting a walkthrough of
it for work. I wanted to use impress!ve, but was getting errors about
there being no pages in the document. [1] In looking this error up, it
seems that impressive requires pdf version 1.4, which can be passed
with this:

\pdfminorversion=4

Unfortunately, exporting via Orgmode causes this error with that command:

,---
| ! pdfTeX error (setup): \pdfminorversion cannot be changed after data is
| written to the PDF file.
`---

In searching that error, I found the 1.4 documentation, which states:[2]

,---
| it probably means that some package loaded before pdf14 did write
data to the PDF file.
| In case the document class is (indirectly) doing it, you’ll need to
load pdf14 even before the
| \documentclass command, using \RequirePackage{pdf14} as the first
line of your source file.
`---

Using this suggestion solves my problem.

There doesn't seem to be a way to get this as the first line via
Orgmode; I have to export and then go to the .tex file directly to
change it. Any suggestions? I realize this is a pretty fringe case. If
it's one where it's just not worth it to implement something if
nothing already exists, that's completely acceptable to me. I just
thought I'd bring it up! It's primarily a nuisance because impressive
hasn't been updated in about a year. I wouldn't normally use it, but
the ability to zoom, use a "spotlight" for the mouse, and so on are
just really neat for something like this.

[1] http://impressive.sourceforge.net/
[2] ftp://152.19.134.44/CTAN/macros/latex/contrib/pdf14/pdf14.pdf


Thanks,
John

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

* Re: Pass LaTeX exporter option prior to \documentclass
  2011-11-02  2:22 Pass LaTeX exporter option prior to \documentclass John Hendy
@ 2011-11-02  2:43 ` suvayu ali
  2011-11-02 10:30   ` suvayu ali
  0 siblings, 1 reply; 217+ messages in thread
From: suvayu ali @ 2011-11-02  2:43 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

Hi John,

On Wed, Nov 2, 2011 at 03:22, John Hendy <jw.hendy@gmail.com> wrote:
>
> I'm creating a beamer presentation and screencasting a walkthrough of
> it for work. I wanted to use impress!ve, but was getting errors about
> there being no pages in the document. [1] In looking this error up, it
> seems that impressive requires pdf version 1.4, which can be passed
> with this:
>
> \pdfminorversion=4
>

Disclaimer: What follows is an extremely hacky untested solution using
some shell foo.

By default org-latex-to-pdf-process is bound to something like this:

pdflatex -interaction nonstopmode -output-directory %o %f

You could try replacing that with the following:

pdflatex -interaction nonstopmode -output-directory %o
\pdfminorversion=4 $(cat %f)

Hope this helps.

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Pass LaTeX exporter option prior to \documentclass
  2011-11-02  2:43 ` suvayu ali
@ 2011-11-02 10:30   ` suvayu ali
  2011-11-03 17:48     ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: suvayu ali @ 2011-11-02 10:30 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

On Wed, Nov 2, 2011 at 03:43, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> You could try replacing that with the following:
>
> pdflatex -interaction nonstopmode -output-directory %o
> \pdfminorversion=4 $(cat %f)

I did some testing. The following should work.

pdflatex -interaction nonstopmode -output-directory %o
\\pdfminorversion=4 \\input{%f}

Using tex commands is probably better than shell expansion.

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Pass LaTeX exporter option prior to \documentclass
  2011-11-02 10:30   ` suvayu ali
@ 2011-11-03 17:48     ` John Hendy
  2011-11-03 17:55       ` suvayu ali
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2011-11-03 17:48 UTC (permalink / raw)
  To: suvayu ali; +Cc: emacs-orgmode

On Wed, Nov 2, 2011 at 5:30 AM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> On Wed, Nov 2, 2011 at 03:43, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
>> You could try replacing that with the following:
>>
>> pdflatex -interaction nonstopmode -output-directory %o
>> \pdfminorversion=4 $(cat %f)
>
> I did some testing. The following should work.
>
> pdflatex -interaction nonstopmode -output-directory %o
> \\pdfminorversion=4 \\input{%f}

Thanks for the workaround! So, to be clear, I'd type in what you wrote
when I'm prompted for the command to use after =C-c C-e p=?

John

>
> Using tex commands is probably better than shell expansion.
>
> --
> Suvayu
>
> Open source is the future. It sets us free.
>

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

* Re: Pass LaTeX exporter option prior to \documentclass
  2011-11-03 17:48     ` John Hendy
@ 2011-11-03 17:55       ` suvayu ali
  2011-11-03 18:07         ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: suvayu ali @ 2011-11-03 17:55 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

On Thu, Nov 3, 2011 at 18:48, John Hendy <jw.hendy@gmail.com> wrote:
> On Wed, Nov 2, 2011 at 5:30 AM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
>> On Wed, Nov 2, 2011 at 03:43, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
>>> You could try replacing that with the following:
>>>
>>> pdflatex -interaction nonstopmode -output-directory %o
>>> \pdfminorversion=4 $(cat %f)
>>
>> I did some testing. The following should work.
>>
>> pdflatex -interaction nonstopmode -output-directory %o
>> \\pdfminorversion=4 \\input{%f}
>
> Thanks for the workaround! So, to be clear, I'd type in what you wrote
> when I'm prompted for the command to use after =C-c C-e p=?

No. I don't think org prompts for the command when exporting. You
should use customize to set the variable org-latex-to-pdf-process to
the above command.

GL

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Pass LaTeX exporter option prior to \documentclass
  2011-11-03 17:55       ` suvayu ali
@ 2011-11-03 18:07         ` John Hendy
  2011-11-04 17:29           ` Nick Dokos
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2011-11-03 18:07 UTC (permalink / raw)
  To: suvayu ali; +Cc: emacs-orgmode

On Thu, Nov 3, 2011 at 12:55 PM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> On Thu, Nov 3, 2011 at 18:48, John Hendy <jw.hendy@gmail.com> wrote:
>> On Wed, Nov 2, 2011 at 5:30 AM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
>>> On Wed, Nov 2, 2011 at 03:43, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
>>>> You could try replacing that with the following:
>>>>
>>>> pdflatex -interaction nonstopmode -output-directory %o
>>>> \pdfminorversion=4 $(cat %f)
>>>
>>> I did some testing. The following should work.
>>>
>>> pdflatex -interaction nonstopmode -output-directory %o
>>> \\pdfminorversion=4 \\input{%f}
>>
>> Thanks for the workaround! So, to be clear, I'd type in what you wrote
>> when I'm prompted for the command to use after =C-c C-e p=?
>
> No. I don't think org prompts for the command when exporting. You
> should use customize to set the variable org-latex-to-pdf-process to
> the above command.
>

Ah, sorry. You're right. I was thinking of =C-c C-c= from the .tex file buffer.

Thanks again! It was a fringe scenario for sure!


John

> GL
>
> --
> Suvayu
>
> Open source is the future. It sets us free.
>

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

* Re: Pass LaTeX exporter option prior to \documentclass
  2011-11-03 18:07         ` John Hendy
@ 2011-11-04 17:29           ` Nick Dokos
  2011-11-04 19:29             ` suvayu ali
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2011-11-04 17:29 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode, nicholas.dokos

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

> On Thu, Nov 3, 2011 at 12:55 PM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> > On Thu, Nov 3, 2011 at 18:48, John Hendy <jw.hendy@gmail.com> wrote:
> >> On Wed, Nov 2, 2011 at 5:30 AM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> >>> On Wed, Nov 2, 2011 at 03:43, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> >>>> You could try replacing that with the following:
> >>>>
> >>>> pdflatex -interaction nonstopmode -output-directory %o
> >>>> \pdfminorversion=4 $(cat %f)
> >>>
> >>> I did some testing. The following should work.
> >>>
> >>> pdflatex -interaction nonstopmode -output-directory %o
> >>> \\pdfminorversion=4 \\input{%f}
> >>
> >> Thanks for the workaround! So, to be clear, I'd type in what you wrote
> >> when I'm prompted for the command to use after =C-c C-e p=?
> >
> > No. I don't think org prompts for the command when exporting. You
> > should use customize to set the variable org-latex-to-pdf-process to
> > the above command.
> >
> 
> Ah, sorry. You're right. I was thinking of =C-c C-c= from the .tex file buffer.
> 
> Thanks again! It was a fringe scenario for sure!
> 
> 

Alternatively, you can define a new entry in org-export-latex-classes
that does what you want - I just cribbed the existing beamer entry and
modified it a bit (I had called it "beamerpdf14" at first, but apparently
numerics are not allowed):

,----
| (require 'org-latex)
| (setq beamerpdf  '("beamerpdf" "\\pdfminorversion=4\\documentclass{beamer}" org-beamer-sectioning))
| (add-to-list 'org-export-latex-classes beamerpdf t)
`----

and then set

#+LATEX_CLASS: beamerpdf

in your org file.

Nick

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

* Re: Pass LaTeX exporter option prior to \documentclass
  2011-11-04 17:29           ` Nick Dokos
@ 2011-11-04 19:29             ` suvayu ali
  0 siblings, 0 replies; 217+ messages in thread
From: suvayu ali @ 2011-11-04 19:29 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

Hi John,

On Fri, Nov 4, 2011 at 18:29, Nick Dokos <nicholas.dokos@hp.com> wrote:
> Alternatively, you can define a new entry in org-export-latex-classes
> that does what you want - I just cribbed the existing beamer entry and
> modified it a bit (I had called it "beamerpdf14" at first, but apparently
> numerics are not allowed):
>
> ,----
> | (require 'org-latex)
> | (setq beamerpdf  '("beamerpdf" "\\pdfminorversion=4\\documentclass{beamer}" org-beamer-sectioning))
> | (add-to-list 'org-export-latex-classes beamerpdf t)
> `----
>
> and then set
>
> #+LATEX_CLASS: beamerpdf
>
> in your org file.

For the record, I would say Nick's solution is a more flexible setup.

-- 
Suvayu

Open source is the future. It sets us free.

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

* Beamer specific setupfile?
@ 2012-03-12 21:13           ` John Hendy
  2012-03-12 21:48             ` Nick Dokos
                               ` (2 more replies)
  0 siblings, 3 replies; 217+ messages in thread
From: John Hendy @ 2012-03-12 21:13 UTC (permalink / raw)
  To: emacs-orgmode

I use beamer a lot for work and decided to create a beamer-specific
setupfile to clean up my org files a bit. My files typically contain a
header like so:

---
#+latex_class: beamer
#+startup: beamer
#+options: toc:nil latex:t tex:t
#+latex_class_options: [presentation,bigger]
#+beamer_frame_level: 1
#+beamer_header_extra:
\usetheme[alternativetitlepage=true,titleline=true,titlepagelogo=../pics/pic.jpg]{Torino}
#+beamer_header_extra: \usecolortheme{freewilly}

#+latex_header: \usepackage{tikz}
#+latex_header:
\usetikzlibrary{decorations,arrows,automata,positioning,backgrounds}

#+latex_header: \usepackage{setspace}
#+latex_header: \setstretch{1.3}

#+latex_header: \usepackage{lmodern}
#+latex_header: \usepackage{booktabs}
#+AUTHOR:    John Henderson
---

I tried inserting the above into a file called =beamer-setup.org= and
simply doing:
---
#+setupfile: ~/org/aux/beamer-setup.org
---

This doesn't seem to work, however. My theme doesn't get picked up,
for example. If I put the contents into the file directly, I'm all
set. Any suggestions on why this might be the case?

Thanks,
John

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

* Re: Beamer specific setupfile?
  2012-03-12 21:13           ` Beamer specific setupfile? John Hendy
@ 2012-03-12 21:48             ` Nick Dokos
  2012-03-12 22:09               ` John Hendy
  2012-03-12 21:51             ` Nick Dokos
  2012-03-12 22:05             ` Nick Dokos
  2 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2012-03-12 21:48 UTC (permalink / raw)
  To: John Hendy; +Cc: nicholas.dokos, emacs-orgmode

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

> I use beamer a lot for work and decided to create a beamer-specific
> setupfile to clean up my org files a bit. My files typically contain a
> header like so:
> 
> ---
> #+latex_class: beamer
> #+startup: beamer
> #+options: toc:nil latex:t tex:t
> #+latex_class_options: [presentation,bigger]
> #+beamer_frame_level: 1
> #+beamer_header_extra:
> \usetheme[alternativetitlepage=true,titleline=true,titlepagelogo=../pics/pic.jpg]{Torino}
> #+beamer_header_extra: \usecolortheme{freewilly}
> 
> #+latex_header: \usepackage{tikz}
> #+latex_header:
> \usetikzlibrary{decorations,arrows,automata,positioning,backgrounds}
> 
> #+latex_header: \usepackage{setspace}
> #+latex_header: \setstretch{1.3}
> 
> #+latex_header: \usepackage{lmodern}
> #+latex_header: \usepackage{booktabs}
> #+AUTHOR:    John Henderson
> ---
> 
> I tried inserting the above into a file called =beamer-setup.org= and
> simply doing:
> ---
> #+setupfile: ~/org/aux/beamer-setup.org
> ---
> 
> This doesn't seem to work, however. My theme doesn't get picked up,
> for example. If I put the contents into the file directly, I'm all
> set. Any suggestions on why this might be the case?
> 

C-c C-c on the setupfile line? The doc says

,----
| `#+SETUPFILE: file'
|      This line defines a file that holds more in-buffer setup.
|      Normally this is entirely ignored.  Only when the buffer is parsed
|      for option-setting lines (i.e. when starting Org mode for a file,
|      when pressing `C-c C-c' in a settings line, or when exporting),
|      then the contents of this file are parsed as if they had been
|      included in the buffer.  In particular, the file can be any other
|      Org mode file with internal setup.  You can visit the file the
|      cursor is in the line with `C-c ''.
`----

and when I try the export, it fails to find "freewilly.sty" (no surprise
there), which seems to show that the file *is* processed.

Nick

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

* Re: Beamer specific setupfile?
  2012-03-12 21:13           ` Beamer specific setupfile? John Hendy
  2012-03-12 21:48             ` Nick Dokos
@ 2012-03-12 21:51             ` Nick Dokos
  2012-03-12 22:05             ` Nick Dokos
  2 siblings, 0 replies; 217+ messages in thread
From: Nick Dokos @ 2012-03-12 21:51 UTC (permalink / raw)
  To: John Hendy; +Cc: nicholas.dokos, emacs-orgmode

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

> #+beamer_header_extra: \usecolortheme{freewilly}
> 

Correction: the error I get is

,----
| ! LaTeX Error: File `beamercolorthemefreewilly.sty' not found.
`----

Nick

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

* Re: Beamer specific setupfile?
  2012-03-12 21:13           ` Beamer specific setupfile? John Hendy
  2012-03-12 21:48             ` Nick Dokos
  2012-03-12 21:51             ` Nick Dokos
@ 2012-03-12 22:05             ` Nick Dokos
  2 siblings, 0 replies; 217+ messages in thread
From: Nick Dokos @ 2012-03-12 22:05 UTC (permalink / raw)
  To: John Hendy; +Cc: nicholas.dokos, emacs-orgmode

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

> I use beamer a lot for work and decided to create a beamer-specific
> setupfile to clean up my org files a bit. My files typically contain a
> header like so:
> 
> ---
> #+latex_class: beamer
> #+startup: beamer
> #+options: toc:nil latex:t tex:t
> #+latex_class_options: [presentation,bigger]
> #+beamer_frame_level: 1
> #+beamer_header_extra:
> \usetheme[alternativetitlepage=true,titleline=true,titlepagelogo=../pics/pic.jpg]{Torino}
> #+beamer_header_extra: \usecolortheme{freewilly}
> 

Actually all the #+BEAMER_* options are ignored (I fixed the line
breaks, so that's not it). Everything else makes it into the tex file.
Seems something is broke.

Nick

> #+latex_header: \usepackage{tikz}
> #+latex_header:
> \usetikzlibrary{decorations,arrows,automata,positioning,backgrounds}
> 
> #+latex_header: \usepackage{setspace}
> #+latex_header: \setstretch{1.3}
> 
> #+latex_header: \usepackage{lmodern}
> #+latex_header: \usepackage{booktabs}
> #+AUTHOR:    John Henderson
> ---
> 
> I tried inserting the above into a file called =beamer-setup.org= and
> simply doing:
> ---
> #+setupfile: ~/org/aux/beamer-setup.org
> ---
> 
> This doesn't seem to work, however. My theme doesn't get picked up,
> for example. If I put the contents into the file directly, I'm all
> set. Any suggestions on why this might be the case?
> 
> Thanks,
> John
> 

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

* Re: Beamer specific setupfile?
  2012-03-12 21:48             ` Nick Dokos
@ 2012-03-12 22:09               ` John Hendy
  2012-03-12 22:30                 ` Nick Dokos
  2012-03-12 23:01                 ` Nick Dokos
  0 siblings, 2 replies; 217+ messages in thread
From: John Hendy @ 2012-03-12 22:09 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

On Mon, Mar 12, 2012 at 4:48 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> John Hendy <jw.hendy@gmail.com> wrote:
>
>> I use beamer a lot for work and decided to create a beamer-specific
>> setupfile to clean up my org files a bit. My files typically contain a
>> header like so:
>>
>> ---
>> #+latex_class: beamer
>> #+startup: beamer
>> #+options: toc:nil latex:t tex:t
>> #+latex_class_options: [presentation,bigger]
>> #+beamer_frame_level: 1
>> #+beamer_header_extra:
>> \usetheme[alternativetitlepage=true,titleline=true,titlepagelogo=../pics/pic.jpg]{Torino}
>> #+beamer_header_extra: \usecolortheme{freewilly}
>>
>> #+latex_header: \usepackage{tikz}
>> #+latex_header:
>> \usetikzlibrary{decorations,arrows,automata,positioning,backgrounds}
>>
>> #+latex_header: \usepackage{setspace}
>> #+latex_header: \setstretch{1.3}
>>
>> #+latex_header: \usepackage{lmodern}
>> #+latex_header: \usepackage{booktabs}
>> #+AUTHOR:    John Henderson
>> ---
>>
>> I tried inserting the above into a file called =beamer-setup.org= and
>> simply doing:
>> ---
>> #+setupfile: ~/org/aux/beamer-setup.org
>> ---
>>
>> This doesn't seem to work, however. My theme doesn't get picked up,
>> for example. If I put the contents into the file directly, I'm all
>> set. Any suggestions on why this might be the case?
>>
>
> C-c C-c on the setupfile line? The doc says
>
> ,----
> | `#+SETUPFILE: file'
> |      This line defines a file that holds more in-buffer setup.
> |      Normally this is entirely ignored.  Only when the buffer is parsed
> |      for option-setting lines (i.e. when starting Org mode for a file,
> |      when pressing `C-c C-c' in a settings line, or when exporting),
> |      then the contents of this file are parsed as if they had been
> |      included in the buffer.  In particular, the file can be any other
> |      Org mode file with internal setup.  You can visit the file the
> |      cursor is in the line with `C-c ''.
> `----
>
> and when I try the export, it fails to find "freewilly.sty" (no surprise
> there), which seems to show that the file *is* processed.

Yeah, I should have just posted an example with an included theme
instead of the one I usually use. I think I tracked it down. First, I
added =t= to the list of class options:
---
#+latex_class_options: [t,presentation,bigger]
---

I saw an effect on my frame alignment, which told me things were,
indeed, being read. It seems the issue was with using
#+beamer_header_extra. I don't know what that's supposed to be for,
but it isn't picking up the theme option. Actually... in searching for
what it's supposed to be used for, I ran across a mailing list post of
the same problem:
-- http://lists.gnu.org/archive/html/emacs-orgmode/2010-09/msg01011.html

Indeed, ditching beamer_header_extra for the theme setting and just
using #+latex_header... works.

Thoughts on fixing this?


John

>
> Nick

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

* Re: Beamer specific setupfile?
  2012-03-12 22:09               ` John Hendy
@ 2012-03-12 22:30                 ` Nick Dokos
  2012-03-12 22:44                   ` Nick Dokos
  2012-03-12 23:01                 ` Nick Dokos
  1 sibling, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2012-03-12 22:30 UTC (permalink / raw)
  To: John Hendy; +Cc: nicholas.dokos, emacs-orgmode

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

> On Mon, Mar 12, 2012 at 4:48 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> > John Hendy <jw.hendy@gmail.com> wrote:
> >
> >> I use beamer a lot for work and decided to create a beamer-specific
> >> setupfile to clean up my org files a bit. My files typically contain a
> >> header like so:
> >>
> >> ---
> >> #+latex_class: beamer
> >> #+startup: beamer
> >> #+options: toc:nil latex:t tex:t
> >> #+latex_class_options: [presentation,bigger]
> >> #+beamer_frame_level: 1
> >> #+beamer_header_extra:
> >> \usetheme[alternativetitlepage=true,titleline=true,titlepagelogo=../pics/pic.jpg]{Torino}
> >> #+beamer_header_extra: \usecolortheme{freewilly}
> >>
> >> #+latex_header: \usepackage{tikz}
> >> #+latex_header:
> >> \usetikzlibrary{decorations,arrows,automata,positioning,backgrounds}
> >>
> >> #+latex_header: \usepackage{setspace}
> >> #+latex_header: \setstretch{1.3}
> >>
> >> #+latex_header: \usepackage{lmodern}
> >> #+latex_header: \usepackage{booktabs}
> >> #+AUTHOR:    John Henderson
> >> ---
> >>
> >> I tried inserting the above into a file called =beamer-setup.org= and
> >> simply doing:
> >> ---
> >> #+setupfile: ~/org/aux/beamer-setup.org
> >> ---
> >>
> >> This doesn't seem to work, however. My theme doesn't get picked up,
> >> for example. If I put the contents into the file directly, I'm all
> >> set. Any suggestions on why this might be the case?
> >>
> >
> > C-c C-c on the setupfile line? The doc says
> >
> > ,----
> > | `#+SETUPFILE: file'
> > |      This line defines a file that holds more in-buffer setup.
> > |      Normally this is entirely ignored.  Only when the buffer is parsed
> > |      for option-setting lines (i.e. when starting Org mode for a file,
> > |      when pressing `C-c C-c' in a settings line, or when exporting),
> > |      then the contents of this file are parsed as if they had been
> > |      included in the buffer.  In particular, the file can be any other
> > |      Org mode file with internal setup.  You can visit the file the
> > |      cursor is in the line with `C-c ''.
> > `----
> >
> > and when I try the export, it fails to find "freewilly.sty" (no surprise
> > there), which seems to show that the file *is* processed.
> 
> Yeah, I should have just posted an example with an included theme
> instead of the one I usually use. I think I tracked it down. First, I
> added =t= to the list of class options:
> ---
> #+latex_class_options: [t,presentation,bigger]
> ---
> 
> I saw an effect on my frame alignment, which told me things were,
> indeed, being read. It seems the issue was with using
> #+beamer_header_extra. I don't know what that's supposed to be for,
> but it isn't picking up the theme option. Actually... in searching for
> what it's supposed to be used for, I ran across a mailing list post of
> the same problem:
> -- http://lists.gnu.org/archive/html/emacs-orgmode/2010-09/msg01011.html
> 
> Indeed, ditching beamer_header_extra for the theme setting and just
> using #+latex_header... works.
> 
> Thoughts on fixing this?
> 
> 

The beamer exporter is searching the original file for #+BEAMER_* stuff, not
the setup file (and of course it does not find anything interesting there).

The latex exporter seems to find everything in the setup file however, so there
must be some mechanism for searching the setup file. If so, it should be
possible to crib it and copy it into the beamer exporter. But the devil, as the
saying goes, is in the details...

Nick

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

* Re: Beamer specific setupfile?
  2012-03-12 22:30                 ` Nick Dokos
@ 2012-03-12 22:44                   ` Nick Dokos
  2012-03-13  5:02                     ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2012-03-12 22:44 UTC (permalink / raw)
  Cc: nicholas.dokos, emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> wrote:

> > Yeah, I should have just posted an example with an included theme
> > instead of the one I usually use. I think I tracked it down. First, I
> > added =t= to the list of class options:
> > ---
> > #+latex_class_options: [t,presentation,bigger]
> > ---
> > 
> > I saw an effect on my frame alignment, which told me things were,
> > indeed, being read. It seems the issue was with using
> > #+beamer_header_extra. I don't know what that's supposed to be for,
> > but it isn't picking up the theme option. Actually... in searching for
> > what it's supposed to be used for, I ran across a mailing list post of
> > the same problem:
> > -- http://lists.gnu.org/archive/html/emacs-orgmode/2010-09/msg01011.html
> > 
> > Indeed, ditching beamer_header_extra for the theme setting and just
> > using #+latex_header... works.
> > 
> > Thoughts on fixing this?
> > 
> > 
> 
> The beamer exporter is searching the original file for #+BEAMER_* stuff, not
> the setup file (and of course it does not find anything interesting there).
> 
> The latex exporter seems to find everything in the setup file however, so there
> must be some mechanism for searching the setup file. If so, it should be
> possible to crib it and copy it into the beamer exporter. But the devil, as the
> saying goes, is in the details...
> 

I think the magic for latex headers happens in org-infile-export-plist:
but the function has not been told about #+BEAMER_* stuff, so it'll need
the addition of a few more cases to handle the beamer stuff.

Nick

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

* Re: Beamer specific setupfile?
  2012-03-12 22:09               ` John Hendy
  2012-03-12 22:30                 ` Nick Dokos
@ 2012-03-12 23:01                 ` Nick Dokos
  1 sibling, 0 replies; 217+ messages in thread
From: Nick Dokos @ 2012-03-12 23:01 UTC (permalink / raw)
  To: John Hendy; +Cc: nicholas.dokos, emacs-orgmode

[I think I broke the thread - so let me try again]
John Hendy <jw.hendy@gmail.com> wrote:

> 
> Yeah, I should have just posted an example with an included theme
> instead of the one I usually use. I think I tracked it down. First, I
> added =t= to the list of class options:
> ---
> #+latex_class_options: [t,presentation,bigger]
> ---
> 
> I saw an effect on my frame alignment, which told me things were,
> indeed, being read. It seems the issue was with using
> #+beamer_header_extra. I don't know what that's supposed to be for,
> but it isn't picking up the theme option. Actually... in searching for
> what it's supposed to be used for, I ran across a mailing list post of
> the same problem:
> -- http://lists.gnu.org/archive/html/emacs-orgmode/2010-09/msg01011.html
> 
> Indeed, ditching beamer_header_extra for the theme setting and just
> using #+latex_header... works.
> 
> Thoughts on fixing this?
> 
> 

Nick Dokos <nicholas.dokos@hp.com> wrote:

> The beamer exporter is searching the original file for #+BEAMER_* stuff, not
> the setup file (and of course it does not find anything interesting there).
> 
> The latex exporter seems to find everything in the setup file however, so there
> must be some mechanism for searching the setup file. If so, it should be
> possible to crib it and copy it into the beamer exporter. But the devil, as the
> saying goes, is in the details...

I think the magic for latex headers happens in org-infile-export-plist:
but the function has not been told about #+BEAMER_* stuff, so it'll need
the addition of a few more cases to handle the beamer stuff.

Nick

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

* Re: Beamer specific setupfile?
  2012-03-12 22:44                   ` Nick Dokos
@ 2012-03-13  5:02                     ` John Hendy
  2012-03-13  5:46                       ` Nick Dokos
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2012-03-13  5:02 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

On Mon, Mar 12, 2012 at 5:44 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> Nick Dokos <nicholas.dokos@hp.com> wrote:
>
>> > Yeah, I should have just posted an example with an included theme
>> > instead of the one I usually use. I think I tracked it down. First, I
>> > added =t= to the list of class options:
>> > ---
>> > #+latex_class_options: [t,presentation,bigger]
>> > ---
>> >
>> > I saw an effect on my frame alignment, which told me things were,
>> > indeed, being read. It seems the issue was with using
>> > #+beamer_header_extra. I don't know what that's supposed to be for,
>> > but it isn't picking up the theme option. Actually... in searching for
>> > what it's supposed to be used for, I ran across a mailing list post of
>> > the same problem:
>> > -- http://lists.gnu.org/archive/html/emacs-orgmode/2010-09/msg01011.html
>> >
>> > Indeed, ditching beamer_header_extra for the theme setting and just
>> > using #+latex_header... works.
>> >
>> > Thoughts on fixing this?
>> >
>> >
>>
>> The beamer exporter is searching the original file for #+BEAMER_* stuff, not
>> the setup file (and of course it does not find anything interesting there).
>>
>> The latex exporter seems to find everything in the setup file however, so there
>> must be some mechanism for searching the setup file. If so, it should be
>> possible to crib it and copy it into the beamer exporter. But the devil, as the
>> saying goes, is in the details...
>>
>
> I think the magic for latex headers happens in org-infile-export-plist:
> but the function has not been told about #+BEAMER_* stuff, so it'll need
> the addition of a few more cases to handle the beamer stuff.
>
> Nick

Great. Thanks for checking into this. I don't know how to fix it, so
I'll simply stick to #+latex_header, as this is working fine at the
moment. It's interesting that #+beamer_ options work from the file
itself, but not from the setupfile, considering it sounds like all the
setupfile line does it treat the contents as if it's in the file
itself. Something's getting lost in there.


Thanks again,
John

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

* Re: Beamer specific setupfile?
  2012-03-13  5:02                     ` John Hendy
@ 2012-03-13  5:46                       ` Nick Dokos
  2012-04-25  8:16                         ` Eric Fraga
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2012-03-13  5:46 UTC (permalink / raw)
  To: John Hendy; +Cc: nicholas.dokos, emacs-orgmode

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

> > I think the magic for latex headers happens in org-infile-export-plist:
> > but the function has not been told about #+BEAMER_* stuff, so it'll need
> > the addition of a few more cases to handle the beamer stuff.
> >
> Great. Thanks for checking into this. I don't know how to fix it, so
> I'll simply stick to #+latex_header, as this is working fine at the
> moment. It's interesting that #+beamer_ options work from the file
> itself, but not from the setupfile, considering it sounds like all the
> setupfile line does it treat the contents as if it's in the file
> itself. Something's getting lost in there.
> 
> 

org-infile-export-plist parses the current buffer and takes care of
#+SETUPFILE: options (even recursive ones). It constructs an options
property list and returns it. The latex exporter stashes it into
org-export-latex-options-plist which is then consulted by the exporter
(in all cases, including the beamer case). The trouble is that
org-infile-export-plist does not know about #+BEAMER_HEADER_EXTRA
or #+BEAMER_FRAME_LEVEL, so it does not put them in the plist it
returns.  It is a trivial thing to add them however: they are exactly
analogous to LATEX_HEADER and LATEX_CLASS options, both of which
org-infile-export-plist handles fine.

Nick

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

* Re: Beamer specific setupfile?
  2012-03-13  5:46                       ` Nick Dokos
@ 2012-04-25  8:16                         ` Eric Fraga
  2012-04-25  8:59                           ` Eric Fraga
  0 siblings, 1 reply; 217+ messages in thread
From: Eric Fraga @ 2012-04-25  8:16 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> writes:

[...]

> org-infile-export-plist parses the current buffer and takes care of
> #+SETUPFILE: options (even recursive ones). It constructs an options

This thread has been interesting for the effects it has had on my mail
reading experience.  I use gnus and I have gnus configured to parse
*some* org syntax for fontifying messages.

Interestingly, for these messages, org has tried to load in setup files!
With the original email message, I got the following error message:

: Cannot read file "/home/xxx/org/aux/beamer-setup.org"

and with the last line I quoted above from Nick's email, I got:

: Cannot read file "/home/xxx/options (even recursive ones). It constructs an options"

Fun!

The question is: I believe that I have only configured gnus to do
fontification on source code blocks and a few other constructs.  None of
the patterns I have specified includes general #+ lines.  I cannot see
how these #+SETUPFILE lines are being interpreted.  Any ideas of where
to look?  It must (?) be an org issue, not gnus per se, I believe.

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] 217+ messages in thread

* Re: Beamer specific setupfile?
  2012-04-25  8:16                         ` Eric Fraga
@ 2012-04-25  8:59                           ` Eric Fraga
  0 siblings, 0 replies; 217+ messages in thread
From: Eric Fraga @ 2012-04-25  8:59 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

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

> Nick Dokos <nicholas.dokos@hp.com> writes:
>
> [...]
>
>> org-infile-export-plist parses the current buffer and takes care of
>> #+SETUPFILE: options (even recursive ones). It constructs an options
>
> This thread has been interesting for the effects it has had on my mail
> reading experience.  I use gnus and I have gnus configured to parse
> *some* org syntax for fontifying messages.
>
> Interestingly, for these messages, org has tried to load in setup files!
> With the original email message, I got the following error message:
>
> : Cannot read file "/home/xxx/org/aux/beamer-setup.org"
>
> and with the last line I quoted above from Nick's email, I got:
>
> : Cannot read file "/home/xxx/options (even recursive ones). It constructs an options"
>
> Fun!
>
> The question is: I believe that I have only configured gnus to do
> fontification on source code blocks and a few other constructs.  None of
> the patterns I have specified includes general #+ lines.  I cannot see
> how these #+SETUPFILE lines are being interpreted.  Any ideas of where
> to look?  It must (?) be an org issue, not gnus per se, I believe.
>
> Thanks,
> eric

Umm, it turns out that gnus does indeed catch lines that start with #+:

,----
|     (org-meta-line
|      "^[ \t]*#\\+[[:alpha:]]+: "
|      "$"
|      mm-uu-org-src-code-block-extract))
`----

I need to investigate mm-uu-org-src-code-block-extract why this leads to
setup file directives being followed.  I do worry a little about
security implications, although there probably aren't any.

Side note: that regex doesn't capture all org mode directives!

Apologies for the noise.

-- 
: 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] 217+ messages in thread

* Alternate format for datetree
@ 2012-08-26 20:11 c b
  2012-08-27  1:16 ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: c b @ 2012-08-26 20:11 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

Hi,

I have been using org-mode for about 18 months now and love it. I recently
came across the org-capture file+datetree format and it is just what I am
looking for, except that I need a slightly different format described as
below

Currently format is

* 2012
** 2012-08
*** 2012-08-26 Sunday
**** [2012-08-26 Sun 13:00] My note for this Sunday afternoon

Needed format is

* 08
** 26
*** 2012 Sunday
**** [2012-08-26 Sun 13:00] My note for this Sunday afternoon

Basically, I need to have the "root" of the date tree on the month,
followed by date and then Year, so that for a particular date, I can see
all yearly activity.

Is there currently a way to alter this?

If not, how would I go about adding a file+monthtree format for org-capture?

Any suggestions would be appreciated

Kindly copy me on the response as I am not subscribed to this mailing list.

Thanks,
c.b.

[-- Attachment #2: Type: text/html, Size: 1231 bytes --]

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

* Re: Alternate format for datetree
  2012-08-26 20:11 Alternate format for datetree c b
@ 2012-08-27  1:16 ` John Hendy
  2012-08-27  4:04   ` Nick Dokos
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2012-08-27  1:16 UTC (permalink / raw)
  To: c b; +Cc: emacs-orgmode

On Sun, Aug 26, 2012 at 3:11 PM, c b <24x7x366@gmail.com> wrote:
> Hi,
>
> I have been using org-mode for about 18 months now and love it. I recently
> came across the org-capture file+datetree format and it is just what I am
> looking for, except that I need a slightly different format described as
> below
>
> Currently format is
>
> * 2012
> ** 2012-08
> *** 2012-08-26 Sunday
> **** [2012-08-26 Sun 13:00] My note for this Sunday afternoon
>
> Needed format is
>
> * 08
> ** 26
> *** 2012 Sunday
> **** [2012-08-26 Sun 13:00] My note for this Sunday afternoon
>
> Basically, I need to have the "root" of the date tree on the month, followed
> by date and then Year, so that for a particular date, I can see all yearly
> activity.
>
> Is there currently a way to alter this?
>
> If not, how would I go about adding a file+monthtree format for org-capture?
>
> Any suggestions would be appreciated

I was looking for something similar and someone provided a custom
capture template that allowed for using inactive timestamps vs. the
default datetree format.

See the example provided here:
- http://osdir.com/ml/emacs-orgmode-gnu/2012-08/msg00396.html

I fiddled with this a bit, not really being familiar and learned a
good bit in the process to achieve your desired format. Give this a
try:

#+begin_src .emacs
(setq org-capture-templates
`(("t" "test" entry
(file+headline "~/file.org"
,(format "%s"
(format-time-string "%m")))
,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] "
(format-time-string "%d")
(format-time-string "%Y")
(format-time-string "%A")
(format-time-string "%Y")
(format-time-string "%m")
(format-time-string "%d")
(format-time-string "%a")
(format-time-string "%H")
(format-time-string "%M"))
)))
#+end_src

One thing I couldn't figure out was how to insert a %? after that
second long format option. If I just put in %?, loading .emacs caused
the error "Not enough arguments to format" or something like that. I'm
sure there's some secret elisp escape syntax I just don't know. I
tried various combinations of \ and '("") with no success.

That'd put the finishing touch on things so your cursor was where you wanted it.

Also, for those seeing this... is this how you would accomplish c.b's
goal? I just used the sample provided to me in the earlier mailing
list email to see if I was up for the challenge, but I have no basis
for knowing whether it's a good solution.


Hope that helps!
John

>
> Kindly copy me on the response as I am not subscribed to this mailing list.
>
> Thanks,
> c.b.

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

* Re: Alternate format for datetree
  2012-08-27  1:16 ` John Hendy
@ 2012-08-27  4:04   ` Nick Dokos
  2012-08-27  6:08     ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2012-08-27  4:04 UTC (permalink / raw)
  To: John Hendy; +Cc: c b, emacs-orgmode

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

> On Sun, Aug 26, 2012 at 3:11 PM, c b <24x7x366@gmail.com> wrote:
> > Hi,
> >
> > I have been using org-mode for about 18 months now and love it. I recently
> > came across the org-capture file+datetree format and it is just what I am
> > looking for, except that I need a slightly different format described as
> > below
> >
> > Currently format is
> >
> > * 2012
> > ** 2012-08
> > *** 2012-08-26 Sunday
> > **** [2012-08-26 Sun 13:00] My note for this Sunday afternoon
> >
> > Needed format is
> >
> > * 08
> > ** 26
> > *** 2012 Sunday
> > **** [2012-08-26 Sun 13:00] My note for this Sunday afternoon
> >
> > Basically, I need to have the "root" of the date tree on the month, followed
> > by date and then Year, so that for a particular date, I can see all yearly
> > activity.
> >
> > Is there currently a way to alter this?
> >
> > If not, how would I go about adding a file+monthtree format for org-capture?
> >
> > Any suggestions would be appreciated
> 
> I was looking for something similar and someone provided a custom
> capture template that allowed for using inactive timestamps vs. the
> default datetree format.
> 
> See the example provided here:
> - http://osdir.com/ml/emacs-orgmode-gnu/2012-08/msg00396.html
> 
> I fiddled with this a bit, not really being familiar and learned a
> good bit in the process to achieve your desired format. Give this a
> try:
> 
> #+begin_src .emacs
> (setq org-capture-templates
> `(("t" "test" entry
> (file+headline "~/file.org"
> ,(format "%s"
> (format-time-string "%m")))
> ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] "
> (format-time-string "%d")
> (format-time-string "%Y")
> (format-time-string "%A")
> (format-time-string "%Y")
> (format-time-string "%m")
> (format-time-string "%d")
> (format-time-string "%a")
> (format-time-string "%H")
> (format-time-string "%M"))
> )))
> #+end_src
> 
> One thing I couldn't figure out was how to insert a %? after that
> second long format option. If I just put in %?, loading .emacs caused
> the error "Not enough arguments to format" or something like that. I'm
> sure there's some secret elisp escape syntax I just don't know. I
> tried various combinations of \ and '("") with no success.
> 

Try

--8<---------------cut here---------------start------------->8---
,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] %%?"
--8<---------------cut here---------------end--------------->8---

You basically need to escape the % from being interpreted by format.
C-h f format RET says

,----
| ...
| Use %% to put a single % into the output.
| ...
`----

Nick

> That'd put the finishing touch on things so your cursor was where you wanted it.
> 
> Also, for those seeing this... is this how you would accomplish c.b's
> goal? I just used the sample provided to me in the earlier mailing
> list email to see if I was up for the challenge, but I have no basis
> for knowing whether it's a good solution.
> 
> 
> Hope that helps!
> John
> 
> >
> > Kindly copy me on the response as I am not subscribed to this mailing list.
> >
> > Thanks,
> > c.b.
> 

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

* Re: Alternate format for datetree
  2012-08-27  4:04   ` Nick Dokos
@ 2012-08-27  6:08     ` John Hendy
  2012-08-28  8:49       ` Ian Barton
  2012-09-06  5:42       ` c b
  0 siblings, 2 replies; 217+ messages in thread
From: John Hendy @ 2012-08-27  6:08 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: c b, emacs-orgmode

On Sun, Aug 26, 2012 at 11:04 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> John Hendy <jw.hendy@gmail.com> wrote:
>
>> On Sun, Aug 26, 2012 at 3:11 PM, c b <24x7x366@gmail.com> wrote:
>> > Hi,
>> >
>> > I have been using org-mode for about 18 months now and love it. I recently
>> > came across the org-capture file+datetree format and it is just what I am
>> > looking for, except that I need a slightly different format described as
>> > below
>> >
>> > Currently format is
>> >
>> > * 2012
>> > ** 2012-08
>> > *** 2012-08-26 Sunday
>> > **** [2012-08-26 Sun 13:00] My note for this Sunday afternoon
>> >
>> > Needed format is
>> >
>> > * 08
>> > ** 26
>> > *** 2012 Sunday
>> > **** [2012-08-26 Sun 13:00] My note for this Sunday afternoon
>> >
>> > Basically, I need to have the "root" of the date tree on the month, followed
>> > by date and then Year, so that for a particular date, I can see all yearly
>> > activity.
>> >
>> > Is there currently a way to alter this?
>> >
>> > If not, how would I go about adding a file+monthtree format for org-capture?
>> >
>> > Any suggestions would be appreciated
>>
>> I was looking for something similar and someone provided a custom
>> capture template that allowed for using inactive timestamps vs. the
>> default datetree format.
>>
>> See the example provided here:
>> - http://osdir.com/ml/emacs-orgmode-gnu/2012-08/msg00396.html
>>
>> I fiddled with this a bit, not really being familiar and learned a
>> good bit in the process to achieve your desired format. Give this a
>> try:
>>
>> #+begin_src .emacs
>> (setq org-capture-templates
>> `(("t" "test" entry
>> (file+headline "~/file.org"
>> ,(format "%s"
>> (format-time-string "%m")))
>> ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] "
>> (format-time-string "%d")
>> (format-time-string "%Y")
>> (format-time-string "%A")
>> (format-time-string "%Y")
>> (format-time-string "%m")
>> (format-time-string "%d")
>> (format-time-string "%a")
>> (format-time-string "%H")
>> (format-time-string "%M"))
>> )))
>> #+end_src
>>
>> One thing I couldn't figure out was how to insert a %? after that
>> second long format option. If I just put in %?, loading .emacs caused
>> the error "Not enough arguments to format" or something like that. I'm
>> sure there's some secret elisp escape syntax I just don't know. I
>> tried various combinations of \ and '("") with no success.
>>
>
> Try
>
> --8<---------------cut here---------------start------------->8---
> ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] %%?"
> --8<---------------cut here---------------end--------------->8---
>
> You basically need to escape the % from being interpreted by format.
> C-h f format RET says
>
> ,----
> | ...
> | Use %% to put a single % into the output.
> | ...
> `----

Perfect -- thanks!
John

>
> Nick
>
>> That'd put the finishing touch on things so your cursor was where you wanted it.
>>
>> Also, for those seeing this... is this how you would accomplish c.b's
>> goal? I just used the sample provided to me in the earlier mailing
>> list email to see if I was up for the challenge, but I have no basis
>> for knowing whether it's a good solution.
>>
>>
>> Hope that helps!
>> John
>>
>> >
>> > Kindly copy me on the response as I am not subscribed to this mailing list.
>> >
>> > Thanks,
>> > c.b.
>>

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

* Re: Alternate format for datetree
  2012-08-27  6:08     ` John Hendy
@ 2012-08-28  8:49       ` Ian Barton
  2012-08-28 12:49         ` Nick Dokos
  2012-08-28 12:50         ` Nick Dokos
  2012-09-06  5:42       ` c b
  1 sibling, 2 replies; 217+ messages in thread
From: Ian Barton @ 2012-08-28  8:49 UTC (permalink / raw)
  To: emacs-orgmode

On 27/08/12 07:08, John Hendy wrote:
> On Sun, Aug 26, 2012 at 11:04 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>> John Hendy <jw.hendy@gmail.com> wrote:
>>
>>> On Sun, Aug 26, 2012 at 3:11 PM, c b <24x7x366@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> I have been using org-mode for about 18 months now and love it. I recently
>>>> came across the org-capture file+datetree format and it is just what I am
>>>> looking for, except that I need a slightly different format described as
>>>> below
>>>>
>>>> Currently format is
>>>>
>>>> * 2012
>>>> ** 2012-08
>>>> *** 2012-08-26 Sunday
>>>> **** [2012-08-26 Sun 13:00] My note for this Sunday afternoon
>>>>
>>>> Needed format is
>>>>
>>>> * 08
>>>> ** 26
>>>> *** 2012 Sunday
>>>> **** [2012-08-26 Sun 13:00] My note for this Sunday afternoon
>>>>
>>>> Basically, I need to have the "root" of the date tree on the month, followed
>>>> by date and then Year, so that for a particular date, I can see all yearly
>>>> activity.
>>>>
>>>> Is there currently a way to alter this?
>>>>
>>>> If not, how would I go about adding a file+monthtree format for org-capture?
>>>>
>>>> Any suggestions would be appreciated
>>>
>>> I was looking for something similar and someone provided a custom
>>> capture template that allowed for using inactive timestamps vs. the
>>> default datetree format.
>>>
>>> See the example provided here:
>>> - http://osdir.com/ml/emacs-orgmode-gnu/2012-08/msg00396.html
>>>
>>> I fiddled with this a bit, not really being familiar and learned a
>>> good bit in the process to achieve your desired format. Give this a
>>> try:
>>>
>>> #+begin_src .emacs
>>> (setq org-capture-templates
>>> `(("t" "test" entry
>>> (file+headline "~/file.org"
>>> ,(format "%s"
>>> (format-time-string "%m")))
>>> ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] "
>>> (format-time-string "%d")
>>> (format-time-string "%Y")
>>> (format-time-string "%A")
>>> (format-time-string "%Y")
>>> (format-time-string "%m")
>>> (format-time-string "%d")
>>> (format-time-string "%a")
>>> (format-time-string "%H")
>>> (format-time-string "%M"))
>>> )))
>>> #+end_src
>>>
>>> One thing I couldn't figure out was how to insert a %? after that
>>> second long format option. If I just put in %?, loading .emacs caused
>>> the error "Not enough arguments to format" or something like that. I'm
>>> sure there's some secret elisp escape syntax I just don't know. I
>>> tried various combinations of \ and '("") with no success.
>>>
>>
>> Try
>>
>> --8<---------------cut here---------------start------------->8---
>> ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] %%?"
>> --8<---------------cut here---------------end--------------->8---
>>
>> You basically need to escape the % from being interpreted by format.
>> C-h f format RET says
>>
>> ,----
>> | ...
>> | Use %% to put a single % into the output.
>> | ...
>> `----
>
> Perfect -- thanks!
> John
>
>>
>> Nick
>>
>>> That'd put the finishing touch on things so your cursor was where you wanted it.
>>>

I would like to use something like this. However, using a recent git 
checkout of org mode and the following simple template from the original 
list message:

("u"
          "Test"
          entry
          (file+headline "~/test.org"
                         ,(format "%s %s"
                                  (format-time-string "%B")
                                  (format-time-string "%Y"))))
I get the following error:

Debugger entered--Lisp error: (wrong-type-argument stringp (\, (format 
"%s %s" (format-time-string "%B") (format-time-string "%Y"))))
   regexp-quote((\, (format "%s %s" (format-time-string "%B") 
(format-time-string "%Y"))))
   org-capture-set-target-location()
   org-capture(nil)
   call-interactively(org-capture nil nil)

I also get the same error from John Hendy's template. Is this a bug in 
recent versions of org, or is there an error in the template lisp? I 
have tried doing a git bisect, but can only go back a few commits, as my 
config now includes  several things that have only recently been added 
to org.

Ian.

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

* Re: Alternate format for datetree
  2012-08-28  8:49       ` Ian Barton
@ 2012-08-28 12:49         ` Nick Dokos
  2012-08-28 12:50         ` Nick Dokos
  1 sibling, 0 replies; 217+ messages in thread
From: Nick Dokos @ 2012-08-28 12:49 UTC (permalink / raw)
  To: Ian Barton; +Cc: emacs-orgmode



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

* Re: Alternate format for datetree
  2012-08-28  8:49       ` Ian Barton
  2012-08-28 12:49         ` Nick Dokos
@ 2012-08-28 12:50         ` Nick Dokos
  2012-08-29  7:49           ` Ian Barton
  1 sibling, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2012-08-28 12:50 UTC (permalink / raw)
  To: Ian Barton; +Cc: emacs-orgmode

Ian Barton <lists@wilkesley.net> wrote:

> I would like to use something like this. However, using a recent git
> checkout of org mode and the following simple template from the
> original list message:
> 
> ("u"
>          "Test"
>          entry
>          (file+headline "~/test.org"
>                         ,(format "%s %s"
>                                  (format-time-string "%B")
>                                  (format-time-string "%Y"))))
> I get the following error:
> 
> Debugger entered--Lisp error: (wrong-type-argument stringp (\, (format
> "%s %s" (format-time-string "%B") (format-time-string "%Y"))))
>   regexp-quote((\, (format "%s %s" (format-time-string "%B")
> (format-time-string "%Y"))))
>   org-capture-set-target-location()
>   org-capture(nil)
>   call-interactively(org-capture nil nil)
> 
> I also get the same error from John Hendy's template. Is this a bug in
> recent versions of org, or is there an error in the template lisp? I
> have tried doing a git bisect, but can only go back a few commits, as
> my config now includes  several things that have only recently been
> added to org.
> 

You are missing the backquote:

--8<---------------cut here---------------start------------->8---
 `("u"
          "Test"
          entry
          (file+headline "~/test.org"
                         ,(format "%s %s"
                                  (format-time-string "%B")
                                  (format-time-string "%Y"))))
--8<---------------cut here---------------end--------------->8---

Nick

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

* Re: Alternate format for datetree
  2012-08-28 12:50         ` Nick Dokos
@ 2012-08-29  7:49           ` Ian Barton
       [not found]             ` <lists@manor-farm.org>
  2012-08-29 14:25             ` John Hendy
  0 siblings, 2 replies; 217+ messages in thread
From: Ian Barton @ 2012-08-29  7:49 UTC (permalink / raw)
  To: emacs-orgmode

On 28/08/12 13:50, Nick Dokos wrote:
> Ian Barton <lists@wilkesley.net> wrote:
>
>> I would like to use something like this. However, using a recent git
>> checkout of org mode and the following simple template from the
>> original list message:
>>
>> ("u"
>>           "Test"
>>           entry
>>           (file+headline "~/test.org"
>>                          ,(format "%s %s"
>>                                   (format-time-string "%B")
>>                                   (format-time-string "%Y"))))
>> I get the following error:
>>
>> Debugger entered--Lisp error: (wrong-type-argument stringp (\, (format
>> "%s %s" (format-time-string "%B") (format-time-string "%Y"))))
>>    regexp-quote((\, (format "%s %s" (format-time-string "%B")
>> (format-time-string "%Y"))))
>>    org-capture-set-target-location()
>>    org-capture(nil)
>>    call-interactively(org-capture nil nil)
>>
>> I also get the same error from John Hendy's template. Is this a bug in
>> recent versions of org, or is there an error in the template lisp? I
>> have tried doing a git bisect, but can only go back a few commits, as
>> my config now includes  several things that have only recently been
>> added to org.
>>
>
> You are missing the backquote:
>
> --8<---------------cut here---------------start------------->8---
>   `("u"
>            "Test"
>            entry
>            (file+headline "~/test.org"
>                           ,(format "%s %s"
>                                    (format-time-string "%B")
>                                    (format-time-string "%Y"))))
> --8<---------------cut here---------------end--------------->8---
>
> Nick
>
Thanks Nick. Hwever with the following minimal template, from the OP, I 
still get the error:

;; org-capture settings.
(setq org-capture-templates
`(("t" "test" entry
(file+headline "~/file.org"
,(format "%s"
(format-time-string "%m")))
,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] "
(format-time-string "%d")
(format-time-string "%Y")
(format-time-string "%A")
(format-time-string "%Y")
(format-time-string "%m")
(format-time-string "%d")
(format-time-string "%a")
(format-time-string "%H")
(format-time-string "%M"))
)))

Ian.

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

* Re: Alternate format for datetree
       [not found]             ` <lists@manor-farm.org>
@ 2012-08-29 14:17               ` Nick Dokos
  0 siblings, 0 replies; 217+ messages in thread
From: Nick Dokos @ 2012-08-29 14:17 UTC (permalink / raw)
  To: ian; +Cc: emacs-orgmode

Ian Barton <lists@manor-farm.org> wrote:


> Thanks Nick. Hwever with the following minimal template, from the OP,
> I still get the error:
> 
> ;; org-capture settings.
> (setq org-capture-templates
> `(("t" "test" entry
> (file+headline "~/file.org"
> ,(format "%s"
> (format-time-string "%m")))
> ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] "
> (format-time-string "%d")
> (format-time-string "%Y")
> (format-time-string "%A")
> (format-time-string "%Y")
> (format-time-string "%m")
> (format-time-string "%d")
> (format-time-string "%a")
> (format-time-string "%H")
> (format-time-string "%M"))
> )))
> 

I put this in a minimal .emacs and I *do not* get an error. Please try
the appended minimal .emacs (change the pathnames appropriately) with

emacs -q -l /path/to/minimal/.emacs

M-x org-capture RET t
M-x org-capture RET u

and post the backtrace if any. Both of them work fine for me. You are
sure you used a backquote?

Nick

--8<---------------cut here---------------start------------->8---
;;; -*- mode: emacs-lisp -*-
;;; constant part
(add-to-list 'load-path (expand-file-name "~/src/emacs/org/org-mode/lisp"))
(add-to-list 'load-path (expand-file-name "~/src/emacs/org/org-mode/contrib/lisp"))

(add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))

(require 'org-install)

(setq debug-on-error t)
(setq debug-on-quit t)
(setq eval-expression-print-length nil)
(setq eval-expression-print-level nil)

(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)

;;; variable part
;; org-capture settings.
(setq org-capture-templates
      `(("t" "test" entry
	 (file+headline "~/test.org"
			,(format "%s"
				 (format-time-string "%m")))
	 ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] "
		  (format-time-string "%d")
		  (format-time-string "%Y")
		  (format-time-string "%A")
		  (format-time-string "%Y")
		  (format-time-string "%m")
		  (format-time-string "%d")
		  (format-time-string "%a")
		  (format-time-string "%H")
		  (format-time-string "%M"))
	 )
	("u" "Test" entry
	 (file+headline "~/test.org"
			,(format "%s %s"
				 (format-time-string "%B")
				 (format-time-string "%Y"))))))
--8<---------------cut here---------------end--------------->8---

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

* Re: Alternate format for datetree
  2012-08-29  7:49           ` Ian Barton
       [not found]             ` <lists@manor-farm.org>
@ 2012-08-29 14:25             ` John Hendy
  2012-08-29 20:01               ` Ian Barton
  1 sibling, 1 reply; 217+ messages in thread
From: John Hendy @ 2012-08-29 14:25 UTC (permalink / raw)
  To: ian; +Cc: emacs-orgmode

On Wed, Aug 29, 2012 at 2:49 AM, Ian Barton <lists@manor-farm.org> wrote:
> On 28/08/12 13:50, Nick Dokos wrote:
>>
>> Ian Barton <lists@wilkesley.net> wrote:
>>
>>> I would like to use something like this. However, using a recent git
>>> checkout of org mode and the following simple template from the
>>> original list message:
>>>
>>> ("u"
>>>           "Test"
>>>           entry
>>>           (file+headline "~/test.org"
>>>                          ,(format "%s %s"
>>>                                   (format-time-string "%B")
>>>                                   (format-time-string "%Y"))))
>>> I get the following error:
>>>
>>> Debugger entered--Lisp error: (wrong-type-argument stringp (\, (format
>>> "%s %s" (format-time-string "%B") (format-time-string "%Y"))))
>>>    regexp-quote((\, (format "%s %s" (format-time-string "%B")
>>> (format-time-string "%Y"))))
>>>    org-capture-set-target-location()
>>>    org-capture(nil)
>>>    call-interactively(org-capture nil nil)
>>>
>>> I also get the same error from John Hendy's template. Is this a bug in
>>> recent versions of org, or is there an error in the template lisp? I
>>> have tried doing a git bisect, but can only go back a few commits, as
>>> my config now includes  several things that have only recently been
>>> added to org.
>>>
>>
>> You are missing the backquote:
>>
>> --8<---------------cut here---------------start------------->8---
>>   `("u"
>>            "Test"
>>            entry
>>            (file+headline "~/test.org"
>>                           ,(format "%s %s"
>>                                    (format-time-string "%B")
>>                                    (format-time-string "%Y"))))
>> --8<---------------cut here---------------end--------------->8---
>>
>> Nick
>>
> Thanks Nick. Hwever with the following minimal template, from the OP, I
> still get the error:
>
> ;; org-capture settings.
> (setq org-capture-templates
> `(("t" "test" entry
> (file+headline "~/file.org"
> ,(format "%s"
> (format-time-string "%m")))
> ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] "
> (format-time-string "%d")
> (format-time-string "%Y")
> (format-time-string "%A")
> (format-time-string "%Y")
> (format-time-string "%m")
> (format-time-string "%d")
> (format-time-string "%a")
> (format-time-string "%H")
> (format-time-string "%M"))
> )))

Odd. I just copied and pasted this into my .emacs and commented out my
actual capture templates section entirely, leaving only this and it
works as expected.

(Just saw Nick's response as well and was going to both try and
suggest similar with a minimal .emacs).


John

>
> Ian.
>

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

* Re: Alternate format for datetree
  2012-08-29 14:25             ` John Hendy
@ 2012-08-29 20:01               ` Ian Barton
  2012-09-06  7:46                 ` Ian Barton
  0 siblings, 1 reply; 217+ messages in thread
From: Ian Barton @ 2012-08-29 20:01 UTC (permalink / raw)
  To: emacs-orgmode

On 29/08/12 15:25, John Hendy wrote:
> On Wed, Aug 29, 2012 at 2:49 AM, Ian Barton <lists@manor-farm.org> wrote:
>> On 28/08/12 13:50, Nick Dokos wrote:
>>>
>>> Ian Barton <lists@wilkesley.net> wrote:
>>>
>>>> I would like to use something like this. However, using a recent git
>>>> checkout of org mode and the following simple template from the
>>>> original list message:
>>>>
>>>> ("u"
>>>>            "Test"
>>>>            entry
>>>>            (file+headline "~/test.org"
>>>>                           ,(format "%s %s"
>>>>                                    (format-time-string "%B")
>>>>                                    (format-time-string "%Y"))))
>>>> I get the following error:
>>>>
>>>> Debugger entered--Lisp error: (wrong-type-argument stringp (\, (format
>>>> "%s %s" (format-time-string "%B") (format-time-string "%Y"))))
>>>>     regexp-quote((\, (format "%s %s" (format-time-string "%B")
>>>> (format-time-string "%Y"))))
>>>>     org-capture-set-target-location()
>>>>     org-capture(nil)
>>>>     call-interactively(org-capture nil nil)
>>>>
>>>> I also get the same error from John Hendy's template. Is this a bug in
>>>> recent versions of org, or is there an error in the template lisp? I
>>>> have tried doing a git bisect, but can only go back a few commits, as
>>>> my config now includes  several things that have only recently been
>>>> added to org.
>>>>
>>>
>>> You are missing the backquote:
>>>
>>> --8<---------------cut here---------------start------------->8---
>>>    `("u"
>>>             "Test"
>>>             entry
>>>             (file+headline "~/test.org"
>>>                            ,(format "%s %s"
>>>                                     (format-time-string "%B")
>>>                                     (format-time-string "%Y"))))
>>> --8<---------------cut here---------------end--------------->8---
>>>
>>> Nick
>>>
>> Thanks Nick. Hwever with the following minimal template, from the OP, I
>> still get the error:
>>
>> ;; org-capture settings.
>> (setq org-capture-templates
>> `(("t" "test" entry
>> (file+headline "~/file.org"
>> ,(format "%s"
>> (format-time-string "%m")))
>> ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] "
>> (format-time-string "%d")
>> (format-time-string "%Y")
>> (format-time-string "%A")
>> (format-time-string "%Y")
>> (format-time-string "%m")
>> (format-time-string "%d")
>> (format-time-string "%a")
>> (format-time-string "%H")
>> (format-time-string "%M"))
>> )))
>
> Odd. I just copied and pasted this into my .emacs and commented out my
> actual capture templates section entirely, leaving only this and it
> works as expected.
>
> (Just saw Nick's response as well and was going to both try and
> suggest similar with a minimal .emacs).
>
>

Thanks both. I'll try with a minimal emacs and post the results. 
However, it may be a day or two as I am currently in the far West of 
Ireland with very variable Internet connections
!

Ian.

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

* Re: Alternate format for datetree
  2012-08-27  6:08     ` John Hendy
  2012-08-28  8:49       ` Ian Barton
@ 2012-09-06  5:42       ` c b
  2012-09-06  6:26         ` Nick Dokos
                           ` (2 more replies)
  1 sibling, 3 replies; 217+ messages in thread
From: c b @ 2012-09-06  5:42 UTC (permalink / raw)
  To: John Hendy, nicholas.dokos, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 4698 bytes --]

Hi John and Nick,

Thank a lot for your suggestions. I finally got it working. It took a while
to figure out that the back-tick is different from the quote.
I am an elisp newbie. Is there an easy explanation of why we need a
back-tick vs. quote?

Also, I found that while the template works, it creates a new tree every
time I capture an entry as follows

* 09
** 05
*** 2012 - Wednesday
**** [2012-09-05 Wed 22:31] My first working month tree note

* 09
** 05
*** 2012 - Wednesday
**** [2012-09-05 Wed 22:31] My second month tree note

#1. Is there any way to consolidate this like the following?

* 09
** 05
*** 2012 - Wednesday
**** [2012-09-05 Wed 22:31] My first working month tree note
**** [2012-09-05 Wed 22:3*5*] My first working month tree note

#2 The time always is reported as 22:31 (I guess that's the time I launched
emacs). Is there a way for the time stamp to be corrected based on the
current time? I generally leave emacs running for days together, so the
time it's launched doesn't really work for me.

Once again, thanks a lot for your help!

-c. b.

On Sun, Aug 26, 2012 at 11:08 PM, John Hendy <jw.hendy@gmail.com> wrote:

> On Sun, Aug 26, 2012 at 11:04 PM, Nick Dokos <nicholas.dokos@hp.com>
> wrote:
> > John Hendy <jw.hendy@gmail.com> wrote:
> >
> >> On Sun, Aug 26, 2012 at 3:11 PM, c b <24x7x366@gmail.com> wrote:
> >> > Hi,
> >> >
> >> > I have been using org-mode for about 18 months now and love it. I
> recently
> >> > came across the org-capture file+datetree format and it is just what
> I am
> >> > looking for, except that I need a slightly different format described
> as
> >> > below
> >> >
> >> > Currently format is
> >> >
> >> > * 2012
> >> > ** 2012-08
> >> > *** 2012-08-26 Sunday
> >> > **** [2012-08-26 Sun 13:00] My note for this Sunday afternoon
> >> >
> >> > Needed format is
> >> >
> >> > * 08
> >> > ** 26
> >> > *** 2012 Sunday
> >> > **** [2012-08-26 Sun 13:00] My note for this Sunday afternoon
> >> >
> >> > Basically, I need to have the "root" of the date tree on the month,
> followed
> >> > by date and then Year, so that for a particular date, I can see all
> yearly
> >> > activity.
> >> >
> >> > Is there currently a way to alter this?
> >> >
> >> > If not, how would I go about adding a file+monthtree format for
> org-capture?
> >> >
> >> > Any suggestions would be appreciated
> >>
> >> I was looking for something similar and someone provided a custom
> >> capture template that allowed for using inactive timestamps vs. the
> >> default datetree format.
> >>
> >> See the example provided here:
> >> - http://osdir.com/ml/emacs-orgmode-gnu/2012-08/msg00396.html
> >>
> >> I fiddled with this a bit, not really being familiar and learned a
> >> good bit in the process to achieve your desired format. Give this a
> >> try:
> >>
> >> #+begin_src .emacs
> >> (setq org-capture-templates
> >> `(("t" "test" entry
> >> (file+headline "~/file.org"
> >> ,(format "%s"
> >> (format-time-string "%m")))
> >> ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] "
> >> (format-time-string "%d")
> >> (format-time-string "%Y")
> >> (format-time-string "%A")
> >> (format-time-string "%Y")
> >> (format-time-string "%m")
> >> (format-time-string "%d")
> >> (format-time-string "%a")
> >> (format-time-string "%H")
> >> (format-time-string "%M"))
> >> )))
> >> #+end_src
> >>
> >> One thing I couldn't figure out was how to insert a %? after that
> >> second long format option. If I just put in %?, loading .emacs caused
> >> the error "Not enough arguments to format" or something like that. I'm
> >> sure there's some secret elisp escape syntax I just don't know. I
> >> tried various combinations of \ and '("") with no success.
> >>
> >
> > Try
> >
> > --8<---------------cut here---------------start------------->8---
> > ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] %%?"
> > --8<---------------cut here---------------end--------------->8---
> >
> > You basically need to escape the % from being interpreted by format.
> > C-h f format RET says
> >
> > ,----
> > | ...
> > | Use %% to put a single % into the output.
> > | ...
> > `----
>
> Perfect -- thanks!
> John
>
> >
> > Nick
> >
> >> That'd put the finishing touch on things so your cursor was where you
> wanted it.
> >>
> >> Also, for those seeing this... is this how you would accomplish c.b's
> >> goal? I just used the sample provided to me in the earlier mailing
> >> list email to see if I was up for the challenge, but I have no basis
> >> for knowing whether it's a good solution.
> >>
> >>
> >> Hope that helps!
> >> John
> >>
> >> >
> >> > Kindly copy me on the response as I am not subscribed to this mailing
> list.
> >> >
> >> > Thanks,
> >> > c.b.
> >>
>

[-- Attachment #2: Type: text/html, Size: 6980 bytes --]

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

* Re: Alternate format for datetree
  2012-09-06  5:42       ` c b
@ 2012-09-06  6:26         ` Nick Dokos
  2012-09-06  7:00         ` Jambunathan K
  2012-09-06 15:33         ` John Hendy
  2 siblings, 0 replies; 217+ messages in thread
From: Nick Dokos @ 2012-09-06  6:26 UTC (permalink / raw)
  To: c b; +Cc: emacs-orgmode

c b <24x7x366@gmail.com> wrote:

> Thank a lot for your suggestions. I finally got it working. It took a while
> to figure out that the back-tick is different from the quote.
> I am an elisp newbie. Is there an easy explanation of why we need a
> back-tick vs. quote?
> 

quote says: take the next expression as is - do not evaluate anything in it.

backquote says: take the next expression as is - do not evaluate
	  anything in it, *except* do evaluate any subexpression
	  preceded by a comma and put the result back into the original
	  expression in place of the comma-ed subexpression.

E.g

'(a b c) -> (a b c)
`(a b c) -> (a b c)  ; because there is no comma

'(a (+ 2 3)) -> (a (+ 2 3))
`(a (+ 2 3)) -> (a (+ 2 3)) ; again no comma
`(a ,(+ 2 3)) -> (a 5)

Incidentally, if you switch to the *scratch* buffer (which is in Lisp
Interaction mode), you can type these expressions in and evaluate each
one by pressing C-j at the end of each expression.

So they both quote: the first one unconditionally, the second mostly but
allowing partial evaluation of subexpressions.

BTW, '(a b c) is shorthand for (quote (a b c)): internally, the lisp
reader translates the first to the second and then the evaluator
evaluates the quote form, returning its (unevaluated) argument: that's
why quote is a "special form" - by contrast, ordinary functions always
evaluate their arguments.

`(a b ,(+ 2 3)) is also shorthand for (backquote (a b ,(+ 2 3))) but the
implementation is necessarily more complicated: backquote is implemented
as a macro (because it is a special form, its argument is not evaluated,
so it cannot be implemented as a function; it has to be implemented as a
macro), but then backquote has to dig into the structure to look for ,
(and also for the somewhat different ,@ construct - see the docs) and do what's
necessary.

Another example is provided by the docstring of backquote itself: C-h f
backquote RET to see it.

For more info, see the elisp manual, chapter 9 on evaluation:

     (info "(elisp) Evaluation")

and two sections therein in particular, 9.3 Quoting, and 9.4 Backquote:

    (info "(elisp) Quoting")
    (info "(elisp) Backquote")

Nick

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

* Re: Alternate format for datetree
  2012-09-06  5:42       ` c b
  2012-09-06  6:26         ` Nick Dokos
@ 2012-09-06  7:00         ` Jambunathan K
  2012-09-06 15:33         ` John Hendy
  2 siblings, 0 replies; 217+ messages in thread
From: Jambunathan K @ 2012-09-06  7:00 UTC (permalink / raw)
  To: c b; +Cc: nicholas.dokos, emacs-orgmode

c b <24x7x366@gmail.com> writes:

> It took a while to figure out that the back-tick is different from the
> quote.

Two useful links in this respect.

    http://www.lisperati.com/syntax.html
    http://www.lisperati.com/looking.html

Just focus on the diagrams in the link - particularly the flip-flop
diagram in the second link.  Once you have the flip-flop image in mind,
you will realize that characters "`" and "," are also rotated 180
degrees and are actually flip-flops.

Now try mapping what flip to "don't evaluate" and flop to "evaluate".

Then you can move on to what Nick says or the doc says.
-- 

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

* Re: Alternate format for datetree
  2012-08-29 20:01               ` Ian Barton
@ 2012-09-06  7:46                 ` Ian Barton
  0 siblings, 0 replies; 217+ messages in thread
From: Ian Barton @ 2012-09-06  7:46 UTC (permalink / raw)
  To: emacs-orgmode

On 29/08/12 21:01, Ian Barton wrote:
> On 29/08/12 15:25, John Hendy wrote:
>> On Wed, Aug 29, 2012 at 2:49 AM, Ian Barton <lists@manor-farm.org> wrote:
>>> On 28/08/12 13:50, Nick Dokos wrote:
>>>>
>>>> Ian Barton <lists@wilkesley.net> wrote:
>>>>
>>>>> I would like to use something like this. However, using a recent git
>>>>> checkout of org mode and the following simple template from the
>>>>> original list message:
>>>>>
>>>>> ("u"
>>>>>            "Test"
>>>>>            entry
>>>>>            (file+headline "~/test.org"
>>>>>                           ,(format "%s %s"
>>>>>                                    (format-time-string "%B")
>>>>>                                    (format-time-string "%Y"))))
>>>>> I get the following error:
>>>>>
>>>>> Debugger entered--Lisp error: (wrong-type-argument stringp (\, (format
>>>>> "%s %s" (format-time-string "%B") (format-time-string "%Y"))))
>>>>>     regexp-quote((\, (format "%s %s" (format-time-string "%B")
>>>>> (format-time-string "%Y"))))
>>>>>     org-capture-set-target-location()
>>>>>     org-capture(nil)
>>>>>     call-interactively(org-capture nil nil)
>>>>>
>>>>> I also get the same error from John Hendy's template. Is this a bug in
>>>>> recent versions of org, or is there an error in the template lisp? I
>>>>> have tried doing a git bisect, but can only go back a few commits, as
>>>>> my config now includes  several things that have only recently been
>>>>> added to org.
>>>>>
>>>>
>>>> You are missing the backquote:
>>>>
>>>> --8<---------------cut here---------------start------------->8---
>>>>    `("u"
>>>>             "Test"
>>>>             entry
>>>>             (file+headline "~/test.org"
>>>>                            ,(format "%s %s"
>>>>                                     (format-time-string "%B")
>>>>                                     (format-time-string "%Y"))))
>>>> --8<---------------cut here---------------end--------------->8---
>>>>
>>>> Nick
>>>>
>>> Thanks Nick. Hwever with the following minimal template, from the OP, I
>>> still get the error:
>>>
>>> ;; org-capture settings.
>>> (setq org-capture-templates
>>> `(("t" "test" entry
>>> (file+headline "~/file.org"
>>> ,(format "%s"
>>> (format-time-string "%m")))
>>> ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] "
>>> (format-time-string "%d")
>>> (format-time-string "%Y")
>>> (format-time-string "%A")
>>> (format-time-string "%Y")
>>> (format-time-string "%m")
>>> (format-time-string "%d")
>>> (format-time-string "%a")
>>> (format-time-string "%H")
>>> (format-time-string "%M"))
>>> )))
>>
>> Odd. I just copied and pasted this into my .emacs and commented out my
>> actual capture templates section entirely, leaving only this and it
>> works as expected.
>>
>> (Just saw Nick's response as well and was going to both try and
>> suggest similar with a minimal .emacs).
>>
>>
>
> Thanks both. I'll try with a minimal emacs and post the results.
> However, it may be a day or two as I am currently in the far West of
> Ireland with very variable Internet connections
> !

Now back with a reliable Internet connection. Thanks for the minimal 
example, which worked correctly. In my full setup, I have quite a lot of 
template definitions. It turned out that I had put the backquote the 
wrong side of a bracket.

Ian.

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

* Re: Alternate format for datetree
  2012-09-06  5:42       ` c b
  2012-09-06  6:26         ` Nick Dokos
  2012-09-06  7:00         ` Jambunathan K
@ 2012-09-06 15:33         ` John Hendy
  2012-09-06 16:08           ` Jonathan Leech-Pepin
  2 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2012-09-06 15:33 UTC (permalink / raw)
  To: c b; +Cc: nicholas.dokos, emacs-orgmode

On Thu, Sep 6, 2012 at 12:42 AM, c b <24x7x366@gmail.com> wrote:
> Hi John and Nick,
>
> Thank a lot for your suggestions. I finally got it working. It took a while
> to figure out that the back-tick is different from the quote.
> I am an elisp newbie. Is there an easy explanation of why we need a
> back-tick vs. quote?
>
> Also, I found that while the template works, it creates a new tree every
> time I capture an entry as follows
>

<snip>

> #1. Is there any way to consolidate this like the following?

You might check out a question I asked that's quite similar.
Basically... no, not unless the headline already exists. Then you have
to use file+olp instead of file+headline. Check out my example:
-- http://lists.gnu.org/archive/html/emacs-orgmode/2012-08/msg01465.html

Orgmode can file to a headline passed in the capture template
immediately after the =(... file+headline
"headline-to-file-under-here")=, but the longer =`(format...= tells
Org to insert that text every time. Thus, our sub-headline evaluation
will always create that text anew. The workaround will be for you to
re-arrange the =`(format...= section and put it above. In other words,
this:

----------
(setq org-capture-templates
`(("t" "test" entry
(file+headline "~/file.org"
,(format "%s"
(format-time-string "%m")))
,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] "
(format-time-string "%d")
(format-time-string "%Y")
(format-time-string "%A")
(format-time-string "%Y")
(format-time-string "%m")
(format-time-string "%d")
(format-time-string "%a")
(format-time-string "%H")
(format-time-string "%M"))
)))
----------

Needs to become something like this:
----------
(setq org-capture-templates
`(("t" "test" entry
(file+olp "~/file.org"
,(format "%s" ;; first headline
(format-time-string "%m")
,(format "%s" ;; second headline
(format-time-string "%d")
,(format "%s - %s"
(format-time-string "%Y")
(format-time-string "%A")))
,(format "**** [%s-%s-%s %s %s:%s] "
(format-time-string "%Y")
(format-time-string "%m")
(format-time-string "%d")
(format-time-string "%a")
(format-time-string "%H")
(format-time-string "%M"))
)))
----------

Something like that (I wrote this in email and didn't check it). That
tells Org to look for a *pre-existing* headline structure in this
form:
----------
* Month (in ## format, like 09 for September)
** Day (in ## format, like 06 for the 6th)
*** Year - Day (in #### - Name format like 2012 - Thursday
----------

And under that, it will file:
----------
**** [timestamp] what you write
----------

But... this means you need to pre-create your daily headline structure.

I think a reasonable feature request would be to have something like a
=:use-existing-capture-headline t= option that would tell Org to
*either* create a new capture headline (as on the first time used that
day) or file into a pre-existing headline if one already exists in
that form. Something like a hybrid between file+headline and file+olp.

Hope that makes sense. I think my example in the link above should help as well.

>
> * 09
> ** 05
> *** 2012 - Wednesday
> **** [2012-09-05 Wed 22:31] My first working month tree note
> **** [2012-09-05 Wed 22:35] My first working month tree note
>
> #2 The time always is reported as 22:31 (I guess that's the time I launched
> emacs). Is there a way for the time stamp to be corrected based on the
> current time? I generally leave emacs running for days together, so the time
> it's launched doesn't really work for me.

Did you change the above to 21:35 or did it file like that? Not sure
why H:M wouldn't expand to the current date. One thing that just
occurred to me, however, is to replace that whole timestamp string
with "%%U% and Org will just expand it to a date+time stamp.

Good luck,
John

>
> Once again, thanks a lot for your help!
>
> -c. b.
>
> On Sun, Aug 26, 2012 at 11:08 PM, John Hendy <jw.hendy@gmail.com> wrote:
>>
>> On Sun, Aug 26, 2012 at 11:04 PM, Nick Dokos <nicholas.dokos@hp.com>
>> wrote:
>> > John Hendy <jw.hendy@gmail.com> wrote:
>> >
>> >> On Sun, Aug 26, 2012 at 3:11 PM, c b <24x7x366@gmail.com> wrote:
>> >> > Hi,
>> >> >
>> >> > I have been using org-mode for about 18 months now and love it. I
>> >> > recently
>> >> > came across the org-capture file+datetree format and it is just what
>> >> > I am
>> >> > looking for, except that I need a slightly different format described
>> >> > as
>> >> > below
>> >> >
>> >> > Currently format is
>> >> >
>> >> > * 2012
>> >> > ** 2012-08
>> >> > *** 2012-08-26 Sunday
>> >> > **** [2012-08-26 Sun 13:00] My note for this Sunday afternoon
>> >> >
>> >> > Needed format is
>> >> >
>> >> > * 08
>> >> > ** 26
>> >> > *** 2012 Sunday
>> >> > **** [2012-08-26 Sun 13:00] My note for this Sunday afternoon
>> >> >
>> >> > Basically, I need to have the "root" of the date tree on the month,
>> >> > followed
>> >> > by date and then Year, so that for a particular date, I can see all
>> >> > yearly
>> >> > activity.
>> >> >
>> >> > Is there currently a way to alter this?
>> >> >
>> >> > If not, how would I go about adding a file+monthtree format for
>> >> > org-capture?
>> >> >
>> >> > Any suggestions would be appreciated
>> >>
>> >> I was looking for something similar and someone provided a custom
>> >> capture template that allowed for using inactive timestamps vs. the
>> >> default datetree format.
>> >>
>> >> See the example provided here:
>> >> - http://osdir.com/ml/emacs-orgmode-gnu/2012-08/msg00396.html
>> >>
>> >> I fiddled with this a bit, not really being familiar and learned a
>> >> good bit in the process to achieve your desired format. Give this a
>> >> try:
>> >>
>> >> #+begin_src .emacs
>> >> (setq org-capture-templates
>> >> `(("t" "test" entry
>> >> (file+headline "~/file.org"
>> >> ,(format "%s"
>> >> (format-time-string "%m")))
>> >> ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] "
>> >> (format-time-string "%d")
>> >> (format-time-string "%Y")
>> >> (format-time-string "%A")
>> >> (format-time-string "%Y")
>> >> (format-time-string "%m")
>> >> (format-time-string "%d")
>> >> (format-time-string "%a")
>> >> (format-time-string "%H")
>> >> (format-time-string "%M"))
>> >> )))
>> >> #+end_src
>> >>
>> >> One thing I couldn't figure out was how to insert a %? after that
>> >> second long format option. If I just put in %?, loading .emacs caused
>> >> the error "Not enough arguments to format" or something like that. I'm
>> >> sure there's some secret elisp escape syntax I just don't know. I
>> >> tried various combinations of \ and '("") with no success.
>> >>
>> >
>> > Try
>> >
>> > --8<---------------cut here---------------start------------->8---
>> > ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] %%?"
>> > --8<---------------cut here---------------end--------------->8---
>> >
>> > You basically need to escape the % from being interpreted by format.
>> > C-h f format RET says
>> >
>> > ,----
>> > | ...
>> > | Use %% to put a single % into the output.
>> > | ...
>> > `----
>>
>> Perfect -- thanks!
>> John
>>
>> >
>> > Nick
>> >
>> >> That'd put the finishing touch on things so your cursor was where you
>> >> wanted it.
>> >>
>> >> Also, for those seeing this... is this how you would accomplish c.b's
>> >> goal? I just used the sample provided to me in the earlier mailing
>> >> list email to see if I was up for the challenge, but I have no basis
>> >> for knowing whether it's a good solution.
>> >>
>> >>
>> >> Hope that helps!
>> >> John
>> >>
>> >> >
>> >> > Kindly copy me on the response as I am not subscribed to this mailing
>> >> > list.
>> >> >
>> >> > Thanks,
>> >> > c.b.
>> >>
>
>

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

* Re: Alternate format for datetree
  2012-09-06 15:33         ` John Hendy
@ 2012-09-06 16:08           ` Jonathan Leech-Pepin
  0 siblings, 0 replies; 217+ messages in thread
From: Jonathan Leech-Pepin @ 2012-09-06 16:08 UTC (permalink / raw)
  To: John Hendy; +Cc: c b, emacs-orgmode, nicholas.dokos

Hello,

On Thu, Sep 6, 2012 at 11:33 AM, John Hendy <jw.hendy@gmail.com> wrote:
> On Thu, Sep 6, 2012 at 12:42 AM, c b <24x7x366@gmail.com> wrote:
>> Hi John and Nick,
>>

[snip]

>>
>> * 09
>> ** 05
>> *** 2012 - Wednesday
>> **** [2012-09-05 Wed 22:31] My first working month tree note
>> **** [2012-09-05 Wed 22:35] My first working month tree note
>>
>> #2 The time always is reported as 22:31 (I guess that's the time I launched
>> emacs). Is there a way for the time stamp to be corrected based on the
>> current time? I generally leave emacs running for days together, so the time
>> it's launched doesn't really work for me.
>
> Did you change the above to 21:35 or did it file like that? Not sure
> why H:M wouldn't expand to the current date. One thing that just
> occurred to me, however, is to replace that whole timestamp string
> with "%%U% and Org will just expand it to a date+time stamp.
>
> Good luck,
> John

This is actually an issue with all of the backtick elements in the
capture template but it shows up most obviously in the timestamp
portion.  I only realized this after providing the solution that John
had referenced earlier in this thread.  Backticks are expanded on
evaluation and resolve to the specific value of their called portions.
 So for the headlines you will need to re-evaluate the template every
day to update it (or restart emacs).

For the timestamp itself you should be able to use the %U escape in
the capture template and it will insert the date and time on it's own.

Regards,

--
Jon

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

* Bug? R: Org babel block execution *drastically* slower than in ESS session directly
@ 2012-10-31  6:12 John Hendy
  2012-10-31 16:41 ` cberry
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2012-10-31  6:12 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2971 bytes --]

I edited the subject to be more concise/clear.

I let orgmode chug away on reading in some ~10-30mb csv files for nearly
30min. I finally gave up with Ctrl + g. Out of curiosity, I copied my babel
block code (four simple lines in the form of `var <- read.csv("./file.csv",
header = T, sep = ",")` into the ESS session already started by my first
block execution, and it finished in less than 10 seconds.

Something seems seriously wrong with however org + babel is executing. I'm
suspicious of it printing the output to the minibuffer. I have about 200^2
- 400^2 lines in the csv files. Was shocked that I'd been waiting for org
this whole time and could have just run the code in the ESS R session
directly in a minuscule fraction of the time.

I could post a reproducible csv file if others would like to try this?

I tried the following to make sure it wasn't my setup:

1) from terminal: `emacs -Q --load=~/Desktop/basic-config`, where
basic-config contains:

;; set load paths
;; set load dirs and global config options
(add-to-list 'load-path "~/.elisp/site-lisp/")
(add-to-list 'load-path "~/.elisp/org.git/contrib/lisp/")
(add-to-list 'load-path "~/.elisp/org.git/lisp/")
(add-to-list 'load-path "~/.elisp/site-lisp/ess/lisp/")

;; setup org
(require 'org-install)

;; setup babel languages
(require 'ess-site)
(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)))

2) Created a simple org file:

----------
* headline

#+begin_src R :session r :results silent
data <-
read.csv("/media/vault/misc/benefit-plan-analysis/2012/contour_table.csv")
#+end_src
----------

3) Run =C-c C-c YES RET= on block

4) Change to R session and enter the same line manually.

The results are unbelievably different. I didn't let the org session finish
as once it took longer than 30sec I figured I'd get the same results as
with my actual file in this example. Changing to the R session and it was
done in less than 5sec with a ~70mb csv.

Any suggestions on troubleshooting this?


Best regards,
John

On Tue, Oct 30, 2012 at 2:46 AM, John Hendy <jw.hendy@gmail.com> wrote:

> I'm working with a large dataset. I try to minimize overhead by doing
> some bigger data rearranging and calculations in a single block that I
> execute once per session and then switch :eval to "no."
>
> This block is set with :results silent, but I know with this option
> the results are still printed to the minibuffer. Usually this isn't a
> problem, but I've had some hangs with emacs and started wondering if
> this could be due to Orgmode regurgitating the results. Could this be
> the case? If so, could Org be made to stop this behavior?
>
> If I accidentally type the name of a data frame in the R session
> buffer, even when I use C-c C-c  to stop the print out, it still takes
> quite a while to catch up and stop itself. It made me wonder if trying
> to print all of those results is increasing my compilation times
> unnecessarily.
>
>
> Thanks for any thoughts,
> John
>

[-- Attachment #2: Type: text/html, Size: 4020 bytes --]

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-10-31  6:12 Bug? R: Org babel block execution *drastically* slower than in ESS session directly John Hendy
@ 2012-10-31 16:41 ` cberry
  2012-10-31 17:18   ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: cberry @ 2012-10-31 16:41 UTC (permalink / raw)
  To: emacs-orgmode

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

> I edited the subject to be more concise/clear.I let orgmode chug away
> on reading in some ~10-30mb csv files for nearly 30min. 

[rest deleted]

You need an ECM. 

I cannot reproduce your issue.

This runs in the same amount of time, whether I execute the src block or
run the code from ESS:


#+begin_src R :session 
write.csv(diag(10)[rep(1:10,100000),],file="abc.csv")
#+end_src

#+begin_src R :session :results output
  system.time(read.csv("abc.csv"))
#+end_src


abc.csv is >25MB

If the behavior you describe only happens with some files, I suggest you
try to bisect them to find the issue.

HTH,

Chuck

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-10-31 16:41 ` cberry
@ 2012-10-31 17:18   ` John Hendy
  2012-10-31 20:12     ` cberry
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2012-10-31 17:18 UTC (permalink / raw)
  To: cberry; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1521 bytes --]

On Wed, Oct 31, 2012 at 11:41 AM, <cberry@tajo.ucsd.edu> wrote:

> John Hendy <jw.hendy@gmail.com> writes:
>
> > I edited the subject to be more concise/clear.I let orgmode chug away
> > on reading in some ~10-30mb csv files for nearly 30min.
>
> [rest deleted]
>
> You need an ECM.
>

I did my best to provide one, other than the file, which I offered to
provide if others requested that I upload it somewhere. Since you have done
so, so have I:
- https://docs.google.com/open?id=0BzQupOSnvw08WHdabHh5VVczRGM

Let me know if that doesn't work. I put it on Google docs and sometimes
have issues with the sharing settings...

You will find the rest needed for a complete ECM of my setup in the
original email:
- minimal config I used with `emacs -Q --load=file`
- org file with minimal babel R block

Let me know if you can reproduce with the linked file. I'm open to
suggestions on how to bisect a file, though it's a column of strings and
several columns of numbers, I'm not exactly sure what to look for.


Best regards,
John


>
> I cannot reproduce your issue.
>
> This runs in the same amount of time, whether I execute the src block or
> run the code from ESS:
>
>
> #+begin_src R :session
> write.csv(diag(10)[rep(1:10,100000),],file="abc.csv")
> #+end_src
>
> #+begin_src R :session :results output
>   system.time(read.csv("abc.csv"))
> #+end_src
>
>
> abc.csv is >25MB
>
> If the behavior you describe only happens with some files, I suggest you
> try to bisect them to find the issue.
>
> HTH,
>
> Chuck
>
>
>

[-- Attachment #2: Type: text/html, Size: 2384 bytes --]

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-10-31 17:18   ` John Hendy
@ 2012-10-31 20:12     ` cberry
  2012-10-31 20:23       ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: cberry @ 2012-10-31 20:12 UTC (permalink / raw)
  To: emacs-orgmode

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

> On Wed, Oct 31, 2012 at 11:41 AM,  <span dir="ltr"><mailto:cberry@tajo.ucsd.edu></span> wrote:
> John Hendy <mailto:jw.hendy@gmail.com> writes:
>
>> I edited the subject to be more concise/clear.I let orgmode chug away
>> on reading in some ~10-30mb csv files for nearly 30min.
>
> [rest deleted]
>
> You need an ECM.I did my best to provide one, other than the file, which I offered to provide if others requested that I upload it somewhere. Since you have done so, so have I:
> - https://docs.google.com/open?id=0BzQupOSnvw08WHdabHh5VVczRGM

> Let me know if that doesn&#39;t work. I put it on Google docs and sometimes have issues with the sharing settings...

Not an ECM in my book, but ...

On my 4 year old MacBook:

,----
| 
| #+PROPERTY: session *R*
| 
| #+name: bigcsv
| #+begin_src R 
| bigcsv <- Sys.glob("~/Downloads/*.csv")
| #+end_src
| 
| #+RESULTS: bigcsv
| : /Users/cberry/Downloads/test-file.csv
| 
| #+name: readbig
| #+begin_src R :results output
|   system.time(
|     tmp <- read.csv(bigcsv)
|     )
|   
| #+end_src
| 
| #+RESULTS: readbig
| :    user  system elapsed 
| :   5.679   0.306   6.002
| 
`----

About the same as running from ESS.

FYI,

> dim(tmp)
[1] 964805      9


Chuck

[ rest deleted ]

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-10-31 20:12     ` cberry
@ 2012-10-31 20:23       ` John Hendy
  2012-10-31 20:56         ` Thomas S. Dye
  2012-10-31 22:53         ` Nick Dokos
  0 siblings, 2 replies; 217+ messages in thread
From: John Hendy @ 2012-10-31 20:23 UTC (permalink / raw)
  To: cberry; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1945 bytes --]

On Wed, Oct 31, 2012 at 3:12 PM, <cberry@tajo.ucsd.edu> wrote:

> John Hendy <jw.hendy@gmail.com> writes:
>
> > On Wed, Oct 31, 2012 at 11:41 AM,  <span dir="ltr"><mailto:
> cberry@tajo.ucsd.edu></span> wrote:
> > John Hendy <mailto:jw.hendy@gmail.com> writes:
> >
> >> I edited the subject to be more concise/clear.I let orgmode chug away
> >> on reading in some ~10-30mb csv files for nearly 30min.
> >
> > [rest deleted]
> >
> > You need an ECM.I did my best to provide one, other than the file, which
> I offered to provide if others requested that I upload it somewhere. Since
> you have done so, so have I:
> > - https://docs.google.com/open?id=0BzQupOSnvw08WHdabHh5VVczRGM
>
> > Let me know if that doesn&#39;t work. I put it on Google docs and
> sometimes have issues with the sharing settings...
>
> Not an ECM in my book, but ...
>
>
What else would you like? I provided:
- the config
- the data
- how to [attempt to] reproduce
- the org-mode text



> On my 4 year old MacBook:
>
> ,----
> |
> | #+PROPERTY: session *R*
> |
> | #+name: bigcsv
> | #+begin_src R
> | bigcsv <- Sys.glob("~/Downloads/*.csv")
> | #+end_src
> |
> | #+RESULTS: bigcsv
> | : /Users/cberry/Downloads/test-file.csv
> |
> | #+name: readbig
> | #+begin_src R :results output
> |   system.time(
> |     tmp <- read.csv(bigcsv)
> |     )
> |
> | #+end_src
> |
> | #+RESULTS: readbig
> | :    user  system elapsed
> | :   5.679   0.306   6.002
> |
> `----
>
> About the same as running from ESS.
>
>
Not sure what to say. Looking for ways to troubleshoot or confirm. Since
you can't confirm, any suggestions on where I should look for my issue? I
can't explain it! All I know is that org chugs and chugs and the direct
execution in ESS session is lightning fast.



FYI,
>
> > dim(tmp)
> [1] 964805      9
>
>
>
Was that just to show the size, or is something wrong with my file?


> Chuck
>
>

Thanks for attempting to replicate!
John


> [ rest deleted ]
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 3423 bytes --]

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-10-31 20:23       ` John Hendy
@ 2012-10-31 20:56         ` Thomas S. Dye
  2012-10-31 23:00           ` Nick Dokos
  2012-10-31 22:53         ` Nick Dokos
  1 sibling, 1 reply; 217+ messages in thread
From: Thomas S. Dye @ 2012-10-31 20:56 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode, cberry

Hi John,

Have you tried wrapping your R read in system.time()?  If you are right
about :results silent eating up lots of time, then this should fix the
problem.  system.time yields just a bit of output, so shouldn't slow
things down if writing out the data is indeed the problem as you
suspect. 

hth,
Tom


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

> On Wed, Oct 31, 2012 at 3:12 PM, <cberry@tajo.ucsd.edu> wrote:
>
>> John Hendy <jw.hendy@gmail.com> writes:
>>
>> > On Wed, Oct 31, 2012 at 11:41 AM,  <span dir="ltr"><mailto:
>> cberry@tajo.ucsd.edu></span> wrote:
>> > John Hendy <mailto:jw.hendy@gmail.com> writes:
>> >
>> >> I edited the subject to be more concise/clear.I let orgmode chug away
>> >> on reading in some ~10-30mb csv files for nearly 30min.
>> >
>> > [rest deleted]
>> >
>> > You need an ECM.I did my best to provide one, other than the file, which
>> I offered to provide if others requested that I upload it somewhere. Since
>> you have done so, so have I:
>> > - https://docs.google.com/open?id=0BzQupOSnvw08WHdabHh5VVczRGM
>>
>> > Let me know if that doesn&#39;t work. I put it on Google docs and
>> sometimes have issues with the sharing settings...
>>
>> Not an ECM in my book, but ...
>>
>>
> What else would you like? I provided:
> - the config
> - the data
> - how to [attempt to] reproduce
> - the org-mode text
>
>
>
>> On my 4 year old MacBook:
>>
>> ,----
>> |
>> | #+PROPERTY: session *R*
>> |
>> | #+name: bigcsv
>> | #+begin_src R
>> | bigcsv <- Sys.glob("~/Downloads/*.csv")
>> | #+end_src
>> |
>> | #+RESULTS: bigcsv
>> | : /Users/cberry/Downloads/test-file.csv
>> |
>> | #+name: readbig
>> | #+begin_src R :results output
>> |   system.time(
>> |     tmp <- read.csv(bigcsv)
>> |     )
>> |
>> | #+end_src
>> |
>> | #+RESULTS: readbig
>> | :    user  system elapsed
>> | :   5.679   0.306   6.002
>> |
>> `----
>>
>> About the same as running from ESS.
>>
>>
> Not sure what to say. Looking for ways to troubleshoot or confirm. Since
> you can't confirm, any suggestions on where I should look for my issue? I
> can't explain it! All I know is that org chugs and chugs and the direct
> execution in ESS session is lightning fast.
>
>
>
> FYI,
>>
>> > dim(tmp)
>> [1] 964805      9
>>
>>
>>
> Was that just to show the size, or is something wrong with my file?
>
>
>> Chuck
>>
>>
>
> Thanks for attempting to replicate!
> John
>
>
>> [ rest deleted ]
>>
>>
>>
>>
> On Wed, Oct 31, 2012 at 3:12 PM, <cberry@tajo.ucsd.edu> wrote:
>
>     John Hendy <jw.hendy@gmail.com> writes:
>     
>     > On Wed, Oct 31, 2012 at 11:41 AM,  <span
>     dir="ltr"><mailto:cberry@tajo.ucsd.edu></span> wrote:
>     > John Hendy <mailto:jw.hendy@gmail.com> writes:
>     >
>     >> I edited the subject to be more concise/clear.I let orgmode
>     chug away
>     >> on reading in some ~10-30mb csv files for nearly 30min.
>     >
>     > [rest deleted]
>     >
>     > You need an ECM.I did my best to provide one, other than the
>     file, which I offered to provide if others requested that I upload
>     it somewhere. Since you have done so, so have I:
>     > - https://docs.google.com/open?id=0BzQupOSnvw08WHdabHh5VVczRGM
>     
>     > Let me know if that doesn&#39;t work. I put it on Google docs
>     and sometimes have issues with the sharing settings...
>     
>     Not an ECM in my book, but ...
>     
>     
>
> What else would you like? I provided:
> - the config
> - the data
> - how to [attempt to] reproduce
> - the org-mode text
>
>  
>
>     On my 4 year old MacBook:
>     
>     ,----
>     |
>     | #+PROPERTY: session *R*
>     |
>     | #+name: bigcsv
>     | #+begin_src R
>     | bigcsv <- Sys.glob("~/Downloads/*.csv")
>     | #+end_src
>     |
>     | #+RESULTS: bigcsv
>     | : /Users/cberry/Downloads/test-file.csv
>     |
>     | #+name: readbig
>     | #+begin_src R :results output
>     |   system.time(
>     |     tmp <- read.csv(bigcsv)
>     |     )
>     |
>     | #+end_src
>     |
>     | #+RESULTS: readbig
>     | :    user  system elapsed
>     | :   5.679   0.306   6.002
>     |
>     `----
>     
>     About the same as running from ESS.
>     
>     
>
> Not sure what to say. Looking for ways to troubleshoot or confirm.
> Since you can't confirm, any suggestions on where I should look for my
> issue? I can't explain it! All I know is that org chugs and chugs and
> the direct execution in ESS session is lightning fast.
>
>
>
>     FYI,
>     
>     > dim(tmp)
>     [1] 964805      9
>     
>     
>     
>
> Was that just to show the size, or is something wrong with my file?
>  
>
>     Chuck
>     
>     
>
>
> Thanks for attempting to replicate!
> John
>  
>
>     [ rest deleted ]
>     
>     
>     
>     
>

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

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-10-31 20:23       ` John Hendy
  2012-10-31 20:56         ` Thomas S. Dye
@ 2012-10-31 22:53         ` Nick Dokos
  2012-11-01 14:53           ` John Hendy
  1 sibling, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2012-10-31 22:53 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode, cberry

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

> On Wed, Oct 31, 2012 at 3:12 PM, <cberry@tajo.ucsd.edu> wrote:
> 
>     John Hendy <jw.hendy@gmail.com> writes:
>    
>     > On Wed, Oct 31, 2012 at 11:41 AM,  <span dir="ltr"><mailto:cberry@tajo.ucsd.edu></span> wrote:
>     > John Hendy <mailto:jw.hendy@gmail.com> writes:
>     >
>     >> I edited the subject to be more concise/clear.I let orgmode chug away
>     >> on reading in some ~10-30mb csv files for nearly 30min.
>     >
>     > [rest deleted]
>     >
>     > You need an ECM.I did my best to provide one, other than the file, which I offered to provide
>     if others requested that I upload it somewhere. Since you have done so, so have I:
>     > - https://docs.google.com/open?id=0BzQupOSnvw08WHdabHh5VVczRGM
>    
>     > Let me know if that doesn&#39;t work. I put it on Google docs and sometimes have issues with
>     the sharing settings...
>    
>     Not an ECM in my book, but ...
> 
> What else would you like? I provided:
> - the config
> - the data
> - how to [attempt to] reproduce
> - the org-mode text
> 

Smaller set of data I'd guess :-) But it does not seem to be the
size of the data that matters.

>  
> 
>     On my 4 year old MacBook:
>    
>     ,----
>     |
>     | #+PROPERTY: session *R*
>     |
>     | #+name: bigcsv
>     | #+begin_src R
>     | bigcsv <- Sys.glob("~/Downloads/*.csv")
>     | #+end_src
>     |
>     | #+RESULTS: bigcsv
>     | : /Users/cberry/Downloads/test-file.csv
>     |
>     | #+name: readbig
>     | #+begin_src R :results output
>     |   system.time(
>     |     tmp <- read.csv(bigcsv)
>     |     )
>     |
>     | #+end_src
>     |
>     | #+RESULTS: readbig
>     | :    user  system elapsed
>     | :   5.679   0.306   6.002
>     |
>     `----
>    
>     About the same as running from ESS.
> 
> Not sure what to say. Looking for ways to troubleshoot or confirm. Since you can't confirm, any
> suggestions on where I should look for my issue? I can't explain it! All I know is that org chugs
> and chugs and the direct execution in ESS session is lightning fast.
> 

A few things to try in no particular order:

o run top (or whatever equivalent is available on your OS) and see
  whether the CPU (or one of the CPUs) gets pegged at 100% utilization
  and stays there. If yes, that's an indication of an infinite loop
  somewhere.

o run vmstat (or equivalent) and see if any of the counters are out of whack.
  That requires some experience though.

o use elp-instrument-package to instrument org and run the test, getting
  a profile. I'm not sure whether the results will be useful, since you
  are going to interrupt the test when you run out of patience, but it
  cannot hurt and it might tell you something useful.

o run your ECM on a different computer/OS/emacs installation. Being able
  to compare things side by side is often very useful.

o Halve your file and run the test on each half (but that's probably not
  the problem given Chuck's results).

o Reinstall org from scratch - you might have some corruption in one of
  the compiled files that's causing it to go into an infinite loop.

o Turn on debug-on-quit, start your test, wait a bit and then interrupt
  it. Check the backtrace.  Do it again and check whether the backtrace
  looks the same. That's often an indication of an infinite loop
  (inferring an infinite loop from a two element sample is statistically
  suspect of course, but surprisingly effective nevertheless). The point
  here is that the infinite loop is in emacs and the backtrace tells you
  something about the parties involved.

These are obviously not independent and the results of one experiment will
have to guide you in what you try next.

Good luck,
Nick

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-10-31 20:56         ` Thomas S. Dye
@ 2012-10-31 23:00           ` Nick Dokos
  0 siblings, 0 replies; 217+ messages in thread
From: Nick Dokos @ 2012-10-31 23:00 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: cberry, emacs-orgmode

Thomas S. Dye <tsd@tsdye.com> wrote:

> Hi John,
> 
> Have you tried wrapping your R read in system.time()?  If you are right
> about :results silent eating up lots of time, then this should fix the
> problem.  system.time yields just a bit of output, so shouldn't slow
> things down if writing out the data is indeed the problem as you
> suspect. 
> 

I missed this in the thread so I thought I'd add one more thing to try:

o run iostat (or equivalent) to check how your disks are doing.
  on linux, iostat is part of a package usually called sysstat.

Nick

> 
> 
> John Hendy <jw.hendy@gmail.com> writes:
> 
> > On Wed, Oct 31, 2012 at 3:12 PM, <cberry@tajo.ucsd.edu> wrote:
> >
> >> John Hendy <jw.hendy@gmail.com> writes:
> >>
> >> > On Wed, Oct 31, 2012 at 11:41 AM,  <span dir="ltr"><mailto:
> >> cberry@tajo.ucsd.edu></span> wrote:
> >> > John Hendy <mailto:jw.hendy@gmail.com> writes:
> >> >
> >> >> I edited the subject to be more concise/clear.I let orgmode chug away
> >> >> on reading in some ~10-30mb csv files for nearly 30min.
> >> >
> >> > [rest deleted]
> >> >
> >> > You need an ECM.I did my best to provide one, other than the file, which
> >> I offered to provide if others requested that I upload it somewhere. Since
> >> you have done so, so have I:
> >> > - https://docs.google.com/open?id=0BzQupOSnvw08WHdabHh5VVczRGM
> >>
> >> > Let me know if that doesn&#39;t work. I put it on Google docs and
> >> sometimes have issues with the sharing settings...
> >>
> >> Not an ECM in my book, but ...
> >>
> >>
> > What else would you like? I provided:
> > - the config
> > - the data
> > - how to [attempt to] reproduce
> > - the org-mode text
> >
> >
> >
> >> On my 4 year old MacBook:
> >>
> >> ,----
> >> |
> >> | #+PROPERTY: session *R*
> >> |
> >> | #+name: bigcsv
> >> | #+begin_src R
> >> | bigcsv <- Sys.glob("~/Downloads/*.csv")
> >> | #+end_src
> >> |
> >> | #+RESULTS: bigcsv
> >> | : /Users/cberry/Downloads/test-file.csv
> >> |
> >> | #+name: readbig
> >> | #+begin_src R :results output
> >> |   system.time(
> >> |     tmp <- read.csv(bigcsv)
> >> |     )
> >> |
> >> | #+end_src
> >> |
> >> | #+RESULTS: readbig
> >> | :    user  system elapsed
> >> | :   5.679   0.306   6.002
> >> |
> >> `----
> >>
> >> About the same as running from ESS.
> >>
> >>
> > Not sure what to say. Looking for ways to troubleshoot or confirm. Since
> > you can't confirm, any suggestions on where I should look for my issue? I
> > can't explain it! All I know is that org chugs and chugs and the direct
> > execution in ESS session is lightning fast.
> >
> >
> >
> > FYI,
> >>
> >> > dim(tmp)
> >> [1] 964805      9
> >>
> >>
> >>
> > Was that just to show the size, or is something wrong with my file?
> >
> >
> >> Chuck
> >>
> >>
> >
> > Thanks for attempting to replicate!
> > John
> >
> >
> >> [ rest deleted ]
> >>
> >>
> >>
> >>
> > On Wed, Oct 31, 2012 at 3:12 PM, <cberry@tajo.ucsd.edu> wrote:
> >
> >     John Hendy <jw.hendy@gmail.com> writes:
> >     
> >     > On Wed, Oct 31, 2012 at 11:41 AM,  <span
> >     dir="ltr"><mailto:cberry@tajo.ucsd.edu></span> wrote:
> >     > John Hendy <mailto:jw.hendy@gmail.com> writes:
> >     >
> >     >> I edited the subject to be more concise/clear.I let orgmode
> >     chug away
> >     >> on reading in some ~10-30mb csv files for nearly 30min.
> >     >
> >     > [rest deleted]
> >     >
> >     > You need an ECM.I did my best to provide one, other than the
> >     file, which I offered to provide if others requested that I upload
> >     it somewhere. Since you have done so, so have I:
> >     > - https://docs.google.com/open?id=0BzQupOSnvw08WHdabHh5VVczRGM
> >     
> >     > Let me know if that doesn&#39;t work. I put it on Google docs
> >     and sometimes have issues with the sharing settings...
> >     
> >     Not an ECM in my book, but ...
> >     
> >     
> >
> > What else would you like? I provided:
> > - the config
> > - the data
> > - how to [attempt to] reproduce
> > - the org-mode text
> >
> >  
> >
> >     On my 4 year old MacBook:
> >     
> >     ,----
> >     |
> >     | #+PROPERTY: session *R*
> >     |
> >     | #+name: bigcsv
> >     | #+begin_src R
> >     | bigcsv <- Sys.glob("~/Downloads/*.csv")
> >     | #+end_src
> >     |
> >     | #+RESULTS: bigcsv
> >     | : /Users/cberry/Downloads/test-file.csv
> >     |
> >     | #+name: readbig
> >     | #+begin_src R :results output
> >     |   system.time(
> >     |     tmp <- read.csv(bigcsv)
> >     |     )
> >     |
> >     | #+end_src
> >     |
> >     | #+RESULTS: readbig
> >     | :    user  system elapsed
> >     | :   5.679   0.306   6.002
> >     |
> >     `----
> >     
> >     About the same as running from ESS.
> >     
> >     
> >
> > Not sure what to say. Looking for ways to troubleshoot or confirm.
> > Since you can't confirm, any suggestions on where I should look for my
> > issue? I can't explain it! All I know is that org chugs and chugs and
> > the direct execution in ESS session is lightning fast.
> >
> >
> >
> >     FYI,
> >     
> >     > dim(tmp)
> >     [1] 964805      9
> >     
> >     
> >     
> >
> > Was that just to show the size, or is something wrong with my file?
> >  
> >
> >     Chuck
> >     
> >     
> >
> >
> > Thanks for attempting to replicate!
> > John
> >  
> >
> >     [ rest deleted ]
> >     
> >     
> >     
> >     
> >
> 
> -- 
> Thomas S. Dye
> http://www.tsdye.com
> 

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-10-31 22:53         ` Nick Dokos
@ 2012-11-01 14:53           ` John Hendy
  2012-11-01 15:38             ` Nick Dokos
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2012-11-01 14:53 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode, cberry

[-- Attachment #1: Type: text/plain, Size: 5992 bytes --]

On Wed, Oct 31, 2012 at 5:53 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> John Hendy <jw.hendy@gmail.com> wrote:
>
> > On Wed, Oct 31, 2012 at 3:12 PM, <cberry@tajo.ucsd.edu> wrote:
> >
> >     John Hendy <jw.hendy@gmail.com> writes:
> >
> >     > On Wed, Oct 31, 2012 at 11:41 AM,  <span dir="ltr"><mailto:
> cberry@tajo.ucsd.edu></span> wrote:
> >     > John Hendy <mailto:jw.hendy@gmail.com> writes:
> >     >
> >     >> I edited the subject to be more concise/clear.I let orgmode chug
> away
> >     >> on reading in some ~10-30mb csv files for nearly 30min.
> >     >
> >     > [rest deleted]
> >     >
> >     > You need an ECM.I did my best to provide one, other than the file,
> which I offered to provide
> >     if others requested that I upload it somewhere. Since you have done
> so, so have I:
> >     > - https://docs.google.com/open?id=0BzQupOSnvw08WHdabHh5VVczRGM
> >
> >     > Let me know if that doesn&#39;t work. I put it on Google docs and
> sometimes have issues with
> >     the sharing settings...
> >
> >     Not an ECM in my book, but ...
> >
> > What else would you like? I provided:
> > - the config
> > - the data
> > - how to [attempt to] reproduce
> > - the org-mode text
> >
>
> Smaller set of data I'd guess :-) But it does not seem to be the
> size of the data that matters.
>
> >
> >
> >     On my 4 year old MacBook:
> >
> >     ,----
> >     |
> >     | #+PROPERTY: session *R*
> >     |
> >     | #+name: bigcsv
> >     | #+begin_src R
> >     | bigcsv <- Sys.glob("~/Downloads/*.csv")
> >     | #+end_src
> >     |
> >     | #+RESULTS: bigcsv
> >     | : /Users/cberry/Downloads/test-file.csv
> >     |
> >     | #+name: readbig
> >     | #+begin_src R :results output
> >     |   system.time(
> >     |     tmp <- read.csv(bigcsv)
> >     |     )
> >     |
> >     | #+end_src
> >     |
> >     | #+RESULTS: readbig
> >     | :    user  system elapsed
> >     | :   5.679   0.306   6.002
> >     |
> >     `----
> >
> >     About the same as running from ESS.
> >
> > Not sure what to say. Looking for ways to troubleshoot or confirm. Since
> you can't confirm, any
> > suggestions on where I should look for my issue? I can't explain it! All
> I know is that org chugs
> > and chugs and the direct execution in ESS session is lightning fast.
> >
>
> A few things to try in no particular order:
>
>
This was extremely helpful. Thanks for the suggestions.

Here's my attempt at an ECM, though I'm going to keep using the big file
since that's what's actually doing it an I've already uploaded it :)
- Using emacs config here: http://pastebin.com/raw.php?i=iTbRtCE9
- Using this org-mode file:

#+begin_src org

* headline

#+begin_src R :session r :results silent
# file here:
https://docs.google.com/uc?export=download&confirm=no_antivirus&id=0BzQupOSnvw08WHdabHh5VVczRGM
data <- read.csv("path/to/file.csv")
#+end_src

#+end_src org

- Execute block with C-c C-c after downloading and changing path

 o run top (or whatever equivalent is available on your OS) and see
>   whether the CPU (or one of the CPUs) gets pegged at 100% utilization
>   and stays there. If yes, that's an indication of an infinite loop
>   somewhere.
>
>
- quit any other instances of emacs/R
- start `top` in terminal
- execute block
- Use '<' '>' to sort back and forth between cpu and ram

Observations
- R is at 80-100% cpu for about 5sec
- Then emacs shifts to fairly constant ~100% cpu usage
- After about a minute, the minibuffer expands to ~1/3 of the window height
and fills with the csv data
- Finished after ~5min total time
- So, R took about 5sec, emacs took another 5min to finish


> o run vmstat (or equivalent) and see if any of the counters are out of
> whack.
>   That requires some experience though.
>
>
I'll skip for now; no experience with that.


> o use elp-instrument-package to instrument org and run the test, getting
>   a profile. I'm not sure whether the results will be useful, since you
>   are going to interrupt the test when you run out of patience, but it
>   cannot hurt and it might tell you something useful.
>
> o run your ECM on a different computer/OS/emacs installation. Being able
>   to compare things side by side is often very useful.
>
> o Halve your file and run the test on each half (but that's probably not
>   the problem given Chuck's results).
>
> o Reinstall org from scratch - you might have some corruption in one of
>   the compiled files that's causing it to go into an infinite loop.
>
>
- `cd ~/.elisp`
- `sudo rm -r org.git`
- `git clone http://git://orgmode.org/org-mode.git org.git`
- cd org.git && make clean && make && make doc
- Quit previous emacs instance; reopen
- Remove (require 'org-install) per prompt; restart again
- Repeat `top` experiment

Results:
- Didn't even see R flash on the screen this time; emacs just jumped to 100%
- After 1min 10sec, the minibuffer filled with data
- At that point I quit, as I think it will be a repeat of the above


> o Turn on debug-on-quit, start your test, wait a bit and then interrupt
>   it. Check the backtrace.  Do it again and check whether the backtrace
>   looks the same. That's often an indication of an infinite loop
>   (inferring an infinite loop from a two element sample is statistically
>   suspect of course, but surprisingly effective nevertheless). The point
>   here is that the infinite loop is in emacs and the backtrace tells you
>   something about the parties involved.
>
>
- =M-x customize-variable RET debug-on-quit RET=
- Toggled to on; saved for current session
- Waited about a min (till the minibuffer filled), then did C-g

Don't have experience with debugging. It brings me to a *Backtrace* buffer,
which is empty except for the line "Debugger entered--Lisp error: (quit)"

Thanks for the suggestions and help. That was quite above and beyond. Much
appreciated.


Best regards,
John

These are obviously not independent and the results of one experiment will
> have to guide you in what you try next.
>
> Good luck,
> Nick
>

[-- Attachment #2: Type: text/html, Size: 9116 bytes --]

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-01 14:53           ` John Hendy
@ 2012-11-01 15:38             ` Nick Dokos
  2012-11-01 18:17               ` John Hendy
  2012-11-01 18:18               ` John Hendy
  0 siblings, 2 replies; 217+ messages in thread
From: Nick Dokos @ 2012-11-01 15:38 UTC (permalink / raw)
  To: John Hendy; +Cc: cberry, emacs-orgmode

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

>     o run top (or whatever equivalent is available on your OS) and see
>       whether the CPU (or one of the CPUs) gets pegged at 100% utilization
>       and stays there. If yes, that's an indication of an infinite loop
>       somewhere.
> 
> - quit any other instances of emacs/R
> - start `top` in terminal
> - execute block
> - Use '<' '>' to sort back and forth between cpu and ram
> 
> Observations
> - R is at 80-100% cpu for about 5sec
> - Then emacs shifts to fairly constant ~100% cpu usage 
> - After about a minute, the minibuffer expands to ~1/3 of the window height and fills with the csv
> data
> - Finished after ~5min total time
> - So, R took about 5sec, emacs took another 5min to finish
>  
> 

So not an infinite loop. That's progress ;-)

Perhaps emacs is thrashing? If you are on linux, use swapon -s
or (perhaps better) iostat, or (perhaps even better, at least if
you are on the Gnome 2.x desktop[fn:1]), run the system monitor
applet, click Properties, enable all the monitored resources
(cpu, mem, net, swap, load, disk) and watch it while you are
running the test: in particular, check memory and swap. If you
are swapping even a little bit, that's enough to cause severe
performacne problems[fn:2], which can be cured by using less memory
(so stop any memory hogs from running) or by adding memory.

Top can also show you memory and swap so maybe that's the quickest
way to check.

Nick

Footnotes:

[fn:1] You can pobably do this in other desktops but I have no
       experience with them, so no guidance to give.

[fn:2] My old laptop with 1GB of memory would swap whenever I ran mairix
       to index my mail: it would take 30 minutes or so to finish.  My
       new(er) laptop has 4GB and finishes in 30 seconds: memory usage
       peaks at about 2.5 GB.

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-01 15:38             ` Nick Dokos
@ 2012-11-01 18:17               ` John Hendy
  2012-11-01 18:18               ` John Hendy
  1 sibling, 0 replies; 217+ messages in thread
From: John Hendy @ 2012-11-01 18:17 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: cberry, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2272 bytes --]

On Thu, Nov 1, 2012 at 10:38 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> John Hendy <jw.hendy@gmail.com> wrote:
>
> >     o run top (or whatever equivalent is available on your OS) and see
> >       whether the CPU (or one of the CPUs) gets pegged at 100%
> utilization
> >       and stays there. If yes, that's an indication of an infinite loop
> >       somewhere.
> >
> > - quit any other instances of emacs/R
> > - start `top` in terminal
> > - execute block
> > - Use '<' '>' to sort back and forth between cpu and ram
> >
> > Observations
> > - R is at 80-100% cpu for about 5sec
> > - Then emacs shifts to fairly constant ~100% cpu usage
> > - After about a minute, the minibuffer expands to ~1/3 of the window
> height and fills with the csv
> > data
> > - Finished after ~5min total time
> > - So, R took about 5sec, emacs took another 5min to finish
> >
> >
>
> So not an infinite loop. That's progress ;-)
>
> Perhaps emacs is thrashing? If you are on linux, use swapon -s
> or (perhaps better) iostat, or (perhaps even better, at least if
> you are on the Gnome 2.x desktop[fn:1]), run the system monitor
> applet, click Properties, enable all the monitored resources
> (cpu, mem, net, swap, load, disk) and watch it while you are
> running the test: in particular, check memory and swap. If you
> are swapping even a little bit, that's enough to cause severe
> performacne problems[fn:2], which can be cured by using less memory
> (so stop any memory hogs from running) or by adding memory.
>
> Top can also show you memory and swap so maybe that's the quickest
> way to check.
>
>
It's not swap... :)

$ free
total       used       free     shared    buffers     cached
Mem:       3978864    2427132    1551732          0     122072     509140
-/+ buffers/cache:    1795920    2182944
Swap:            0          0          0



Best regards,
John


> Nick
>
> Footnotes:
>
> [fn:1] You can pobably do this in other desktops but I have no
>        experience with them, so no guidance to give.
>
> [fn:2] My old laptop with 1GB of memory would swap whenever I ran mairix
>        to index my mail: it would take 30 minutes or so to finish.  My
>        new(er) laptop has 4GB and finishes in 30 seconds: memory usage
>        peaks at about 2.5 GB.
>
>

[-- Attachment #2: Type: text/html, Size: 3204 bytes --]

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-01 15:38             ` Nick Dokos
  2012-11-01 18:17               ` John Hendy
@ 2012-11-01 18:18               ` John Hendy
  2012-11-01 18:48                 ` Nick Dokos
  1 sibling, 1 reply; 217+ messages in thread
From: John Hendy @ 2012-11-01 18:18 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: cberry, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2389 bytes --]

On Thu, Nov 1, 2012 at 10:38 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> John Hendy <jw.hendy@gmail.com> wrote:
>
> >     o run top (or whatever equivalent is available on your OS) and see
> >       whether the CPU (or one of the CPUs) gets pegged at 100%
> utilization
> >       and stays there. If yes, that's an indication of an infinite loop
> >       somewhere.
> >
> > - quit any other instances of emacs/R
> > - start `top` in terminal
> > - execute block
> > - Use '<' '>' to sort back and forth between cpu and ram
> >
> > Observations
> > - R is at 80-100% cpu for about 5sec
> > - Then emacs shifts to fairly constant ~100% cpu usage
> > - After about a minute, the minibuffer expands to ~1/3 of the window
> height and fills with the csv
> > data
> > - Finished after ~5min total time
> > - So, R took about 5sec, emacs took another 5min to finish
> >
> >
>
> So not an infinite loop. That's progress ;-)
>
> Perhaps emacs is thrashing? If you are on linux, use swapon -s
> or (perhaps better) iostat, or (perhaps even better, at least if
> you are on the Gnome 2.x desktop[fn:1]), run the system monitor
> applet, click Properties, enable all the monitored resources
> (cpu, mem, net, swap, load, disk) and watch it while you are
> running the test: in particular, check memory and swap. If you
> are swapping even a little bit, that's enough to cause severe
> performacne problems[fn:2], which can be cured by using less memory
> (so stop any memory hogs from running) or by adding memory.
>

Oh, and I'm conscious of R using RAM, so I tried to run this stuff without
browsers open, no other R sessions, etc. Prior to running R and without a
browser, I'm typically around 10-15% RAM utilized...

I have 4gb, so that should be enough to read this, especially per Chuck's
results! This is also an i7 work computer. It should fly (and in the ESS
session itself, it does).


John


>
> Top can also show you memory and swap so maybe that's the quickest
> way to check.
>
> Nick
>
> Footnotes:
>
> [fn:1] You can pobably do this in other desktops but I have no
>        experience with them, so no guidance to give.
>
> [fn:2] My old laptop with 1GB of memory would swap whenever I ran mairix
>        to index my mail: it would take 30 minutes or so to finish.  My
>        new(er) laptop has 4GB and finishes in 30 seconds: memory usage
>        peaks at about 2.5 GB.
>
>

[-- Attachment #2: Type: text/html, Size: 3213 bytes --]

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-01 18:18               ` John Hendy
@ 2012-11-01 18:48                 ` Nick Dokos
  2012-11-14  3:27                   ` Aaron Ecay
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2012-11-01 18:48 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode, cberry

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

> On Thu, Nov 1, 2012 at 10:38 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> 
>     John Hendy <jw.hendy@gmail.com> wrote:
>    
>     >     o run top (or whatever equivalent is available on your OS) and see
>     >       whether the CPU (or one of the CPUs) gets pegged at 100% utilization
>     >       and stays there. If yes, that's an indication of an infinite loop
>     >       somewhere.
>     >
>     > - quit any other instances of emacs/R
>     > - start `top` in terminal
>     > - execute block
>     > - Use '<' '>' to sort back and forth between cpu and ram
>     >
>     > Observations
>     > - R is at 80-100% cpu for about 5sec
>     > - Then emacs shifts to fairly constant ~100% cpu usage 
>     > - After about a minute, the minibuffer expands to ~1/3 of the window height and fills with the
>     csv
>     > data
>     > - Finished after ~5min total time
>     > - So, R took about 5sec, emacs took another 5min to finish
>     >  
>     >
>    
>     So not an infinite loop. That's progress ;-)
>    
>     Perhaps emacs is thrashing? If you are on linux, use swapon -s
>     or (perhaps better) iostat, or (perhaps even better, at least if
>     you are on the Gnome 2.x desktop[fn:1]), run the system monitor
>     applet, click Properties, enable all the monitored resources
>     (cpu, mem, net, swap, load, disk) and watch it while you are
>     running the test: in particular, check memory and swap. If you
>     are swapping even a little bit, that's enough to cause severe
>     performacne problems[fn:2], which can be cured by using less memory
>     (so stop any memory hogs from running) or by adding memory.
> 
> Oh, and I'm conscious of R using RAM, so I tried to run this stuff without browsers open, no other R
> sessions, etc. Prior to running R and without a browser, I'm typically around 10-15% RAM utilized...
> 
> I have 4gb, so that should be enough to read this, especially per Chuck's results! This is also an i7
> work computer. It should fly (and in the ESS session itself, it does).
> 

Check /var/log/syslog (or thereabouts) to see if the kernel is seeing errors with
some blocks on the disk and keeps retrying. Assuming SMART is enabled, run smartctl -a
as well and look for problems.

Nick

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-01 18:48                 ` Nick Dokos
@ 2012-11-14  3:27                   ` Aaron Ecay
  2012-11-14  4:52                     ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: Aaron Ecay @ 2012-11-14  3:27 UTC (permalink / raw)
  To: nicholas.dokos, John Hendy; +Cc: cberry, emacs-orgmode

I just ran into this problem.  It is caused by the calls to
‘org-babel-import-elisp-from-file’ on lines 310 and 343 of ‘ob-R.el’
(for non-session and session code blocks respectively).  I determined
this by setting ‘debug-on-quit’ to t in Emacs, then hitting C-g when cpu
usage spiked, and examining the backtrace.

It seems like Emacs tries to read in the last value of the R command, to
print it in the minibuffer.  It gets bogged down doing so.  As a
stopgap, putting NULL as the last line of the source block fixes the
problem (the value “returned” by the block is just NULL).  I believe
setting “:results output” (as opposed to “value”) would also make the
bug disappear, since the output will be very small.  This is likely what
made cberry’s test differ from John’s.

I’m not sure what the right strategy would be for a fix.  Two ideas
would be:
1) adding a sanity check to o-b-import-elisp-from-file, which asks the
   user whether to really import very large files (or just ignores such
   files)
2) adding a new :results handling header arg “really-silent” (probably
   with a better name...) that discards the result entirely, not even
   printing it to the minibuffer.

-- 
Aaron Ecay

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-14  3:27                   ` Aaron Ecay
@ 2012-11-14  4:52                     ` John Hendy
  2012-11-14  6:32                       ` Aaron Ecay
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2012-11-14  4:52 UTC (permalink / raw)
  To: nicholas.dokos, John Hendy, emacs-orgmode, cberry

[-- Attachment #1: Type: text/plain, Size: 2861 bytes --]

On Tue, Nov 13, 2012 at 9:27 PM, Aaron Ecay <aaronecay@gmail.com> wrote:

> I just ran into this problem.  It is caused by the calls to
> ‘org-babel-import-elisp-from-file’ on lines 310 and 343 of ‘ob-R.el’
> (for non-session and session code blocks respectively).  I determined
> this by setting ‘debug-on-quit’ to t in Emacs, then hitting C-g when cpu
> usage spiked, and examining the backtrace.
>
>
Yes! I'm not crazy! I'm not very familiar with the debug options in emacs
and had a heck of a time setting it up right the last time. Thanks so much
for checking this out.


> It seems like Emacs tries to read in the last value of the R command, to
> print it in the minibuffer.  It gets bogged down doing so.  As a
> stopgap, putting NULL as the last line of the source block fixes the
> problem (the value “returned” by the block is just NULL).  I believe
> setting “:results output” (as opposed to “value”) would also make the
> bug disappear, since the output will be very small.  This is likely what
> made cberry’s test differ from John’s.
>
>
Crazy. I really wondered if it had something to do with trying to spit out
the results into the minibuffer. Why is that behavior included?


> I’m not sure what the right strategy would be for a fix.  Two ideas
> would be:
> 1) adding a sanity check to o-b-import-elisp-from-file, which asks the
>    user whether to really import very large files (or just ignores such
>    files)
>

Are you sure it's only on file import? I was generating some large output
when I first experienced this. It was only to avoid running that code that
I wrote it to file once and decided to just read it once per session
afterward (thinking reading would be faster than generating the input on
demand). I was generating a grid of interactions with something akin to:

#+begin_src R
dat <- expand.grid(var1 = seq(0, 40000, by = 200), var2 = seq(0, 40000, by
= 200))
#+end_src

I can check this tomorrow if you'd like, but I remember it lagging as it
tried to print all of that into the minibuffer.


> 2) adding a new :results handling header arg “really-silent” (probably
>    with a better name...) that discards the result entirely, not even
>    printing it to the minibuffer.
>
>
I like this, in addition to changing the minibuffer output as it is. It
would be fantastic to have the minibuffer say more than it does already
(something akin to "Block execution complete"). I have to change to the R
buffer to see if there were any errors. I like how the LaTeX exporter tells
you if PDF export failed. It'd be nice to see something like (in addition
to no results in the minibuffer), "Block execution complete but with
errors."

Thanks again, and I'm glad you were able to track this down.


John


> --
> Aaron Ecay
>

[-- Attachment #2: Type: text/html, Size: 4021 bytes --]

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-14  4:52                     ` John Hendy
@ 2012-11-14  6:32                       ` Aaron Ecay
  2012-11-14  8:28                         ` Thomas S. Dye
  0 siblings, 1 reply; 217+ messages in thread
From: Aaron Ecay @ 2012-11-14  6:32 UTC (permalink / raw)
  To: John Hendy, nicholas.dokos, emacs-orgmode, cberry

2012ko azaroak 13an, John Hendy-ek idatzi zuen:

[...]
> Crazy. I really wondered if it had something to do with trying to spit
> out the results into the minibuffer. Why is that behavior included?

“:results silent” just means “silent except for the minibuffer”; IDK
why.

> Are you sure it's only on file import? I was generating some large
> output when I first experienced this.

Yes, that’s what I meant (and didn’t explain well).  Org writes R’s
output to a file, and then imports it into Emacs (to print in the
minibuffer).  But it also does an expensive transformation before
printing it – whence the slowdown.

> I have to
> change to the R buffer to see if there were any errors.

I agree that this is sub-optimal.

I seem to remember that ob-R.el is unmaintained (or was at some point in
the past).  Once there is consensus on what a fix should look like, I
can attempt to produce a patch implementing it.  And I’ll take a crack
at error reporting in the minibuffer too.

-- 
Aaron Ecay

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-14  6:32                       ` Aaron Ecay
@ 2012-11-14  8:28                         ` Thomas S. Dye
  2012-11-14  8:35                           ` Andreas Leha
  0 siblings, 1 reply; 217+ messages in thread
From: Thomas S. Dye @ 2012-11-14  8:28 UTC (permalink / raw)
  To: emacs-orgmode

Aloha Aaron,

Welcome to Org-mode.

Aaron Ecay <aaronecay@gmail.com> writes:

> 2012ko azaroak 13an, John Hendy-ek idatzi zuen:
>
> [...]
>> Crazy. I really wondered if it had something to do with trying to spit
>> out the results into the minibuffer. Why is that behavior included?
>
> “:results silent” just means “silent except for the minibuffer”; IDK
> why.

I think "silent" has to do with the Org buffer that contains the source
code block.  Non-silent blocks do something in the buffer.  This was,
for me, one of the amazing things about babel when it was being
developed.  One could "speak" any language and have sensible results
written back to a plain text file.

>
>> Are you sure it's only on file import? I was generating some large
>> output when I first experienced this.
>
> Yes, that’s what I meant (and didn’t explain well).  Org writes R’s
> output to a file, and then imports it into Emacs (to print in the
> minibuffer).  But it also does an expensive transformation before
> printing it – whence the slowdown.
>
>> I have to
>> change to the R buffer to see if there were any errors.
>
> I agree that this is sub-optimal.
>
> I seem to remember that ob-R.el is unmaintained (or was at some point in
> the past).  Once there is consensus on what a fix should look like, I
> can attempt to produce a patch implementing it.  And I’ll take a crack
> at error reporting in the minibuffer too.

Yes, ob-R.el is currently without a maintainer. My sense and experience
is that Eric S. is happy to entertain patches to the various ob language
files.  My experience is also that active maintainers welcome
patches--I don't think there is a barrier to patch proposals.

I can help with documentation if your patch results in some substantive
changes to R support in babel.  Please don't hesitate to ask if need be.

All the best,
Tom

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

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-14  8:28                         ` Thomas S. Dye
@ 2012-11-14  8:35                           ` Andreas Leha
  2012-11-16 15:45                             ` Eric Schulte
  0 siblings, 1 reply; 217+ messages in thread
From: Andreas Leha @ 2012-11-14  8:35 UTC (permalink / raw)
  To: emacs-orgmode

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

> Aloha Aaron,
>
> Welcome to Org-mode.
>
> Aaron Ecay <aaronecay@gmail.com> writes:
>
>> 2012ko azaroak 13an, John Hendy-ek idatzi zuen:
>>
>> [...]
>>> Crazy. I really wondered if it had something to do with trying to spit
>>> out the results into the minibuffer. Why is that behavior included?
>>
>> “:results silent” just means “silent except for the minibuffer”; IDK
>> why.
>

[...]

Just for the record:
I would also love to see the "really-silent results".

Regards,
Andreas

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-14  8:35                           ` Andreas Leha
@ 2012-11-16 15:45                             ` Eric Schulte
  2012-11-16 17:47                               ` Andreas Leha
  2012-11-18  0:41                               ` Aaron Ecay
  0 siblings, 2 replies; 217+ messages in thread
From: Eric Schulte @ 2012-11-16 15:45 UTC (permalink / raw)
  To: Andreas Leha; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1657 bytes --]

Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:

> tsd@tsdye.com (Thomas S. Dye) writes:
>
>> Aloha Aaron,
>>
>> Welcome to Org-mode.
>>
>> Aaron Ecay <aaronecay@gmail.com> writes:
>>
>>> 2012ko azaroak 13an, John Hendy-ek idatzi zuen:
>>>
>>> [...]
>>>> Crazy. I really wondered if it had something to do with trying to spit
>>>> out the results into the minibuffer. Why is that behavior included?
>>>
>>> “:results silent” just means “silent except for the minibuffer”; IDK
>>> why.
>>
>
> [...]
>
> Just for the record:
> I would also love to see the "really-silent results".
>

Yes, the existing ":results silent" option still echos the results to
the minibuffer.  It was originally added in the case where one does not
want to change the Org-mode buffer (but would still like to see code
block output).

The attached patch adds a "really-silent" results header argument.  To
see the impact compare the running time of the following two code
blocks.

    #+begin_src sh :results really-silent
      seq 100000000
    #+end_src

    #+begin_src sh :results silent
      seq 100000000
    #+end_src

Before such a patch is applied it would need corresponding
documentation, and the "really-silent" moniker may need to be
reconsidered in favor of something more informative (the main purpose of
this header argument is not silence but is rather avoiding all post
processing), and ideally shorter as well.  These new header arguments
are of no value if they are not easily discover-able and easily
remember-able to help others avoid the same issue that launched this
thread.

Cheers,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-really-silent-header-avoids-result-post-process.patch --]
[-- Type: text/x-patch, Size: 2974 bytes --]

From 8ae5b59acdaaa271c797756bfe7f9479e1f9a277 Mon Sep 17 00:00:00 2001
From: Eric Schulte <eric.schulte@gmx.com>
Date: Fri, 16 Nov 2012 08:40:46 -0700
Subject: [PATCH] "really-silent" header avoids result post-process

This patch introduces a new header argument which hide all code block
results from Emacs so that they are not processed into Emacs-lisp
objects; a process which may take a great deal of time for large
objects.

* lisp/ob.el (org-babel-common-header-args-w-values): Adding the new
  "really-silent" header argument.
  (org-babel-execute-src-block): Don't do *any* result processing if the
  "really-silent" header argument has been specified.
  (org-babel-sha1-hash): Remove the really-silent header argument from
  header arg lists when calculating cache sums.
  (org-babel-insert-result): Flesh out some documentation.
---
 lisp/ob.el | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/lisp/ob.el b/lisp/ob.el
index 69a5c58..167fe1a 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -421,7 +421,7 @@ then run `org-babel-pop-to-session'."
     (padline	. ((yes no)))
     (results	. ((file list vector table scalar verbatim)
 		   (raw html latex org code pp drawer)
-		   (replace silent append prepend)
+		   (replace silent really-silent append prepend)
 		   (output value)))
     (rownames	. ((no yes)))
     (sep	. :any)
@@ -562,6 +562,8 @@ block."
 		(message "executing %s code block%s..."
 			 (capitalize lang)
 			 (if (nth 4 info) (format " (%s)" (nth 4 info)) ""))
+		(if (member "really-silent" result-params)
+		(message "result silenced")
 		(setq result
 		      ((lambda (result)
 			 (if (and (eq (cdr (assoc :result-type params)) 'value)
@@ -581,7 +583,8 @@ block."
 		(org-babel-insert-result
 		 result result-params info new-hash indent lang)
 		(run-hooks 'org-babel-after-execute-hook)
-		result))
+		result
+		)))
 	  (setq call-process-region 'org-babel-call-process-region-original))))))
 
 (defun org-babel-expand-body:generic (body params &optional var-lines)
@@ -1028,7 +1031,8 @@ the current subtree."
 	  (sort (copy-sequence (nth 2 info))
 		(lambda (a b) (string< (car a) (car b)))))
     (let* ((rm (lambda (lst)
-		 (dolist (p '("replace" "silent" "append" "prepend"))
+		 (dolist (p '("replace" "silent" "really-silent"
+			      "append" "prepend"))
 		   (setq lst (remove p lst)))
 		 lst))
 	   (norm (lambda (arg)
@@ -1851,7 +1855,10 @@ RESULT-PARAMS can take the following values:
 replace - (default option) insert results after the source block
           replacing any previously inserted results
 
-silent -- no results are inserted
+silent -- no results are inserted into the Org-mode buffer but
+          the results are echoed to the minibuffer and are
+          ingested by Emacs (a potentially time consuming
+          process)
 
 file ---- the results are interpreted as a file path, and are
           inserted into the buffer using the Org-mode file syntax
-- 
1.8.0


[-- Attachment #3: Type: text/plain, Size: 46 bytes --]


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

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-16 15:45                             ` Eric Schulte
@ 2012-11-16 17:47                               ` Andreas Leha
  2012-11-16 19:00                                 ` John Hendy
  2012-11-16 20:25                                 ` Achim Gratz
  2012-11-18  0:41                               ` Aaron Ecay
  1 sibling, 2 replies; 217+ messages in thread
From: Andreas Leha @ 2012-11-16 17:47 UTC (permalink / raw)
  To: emacs-orgmode

Hi Eric,

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

> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>
>> tsd@tsdye.com (Thomas S. Dye) writes:
>>
>>> Aloha Aaron,
>>>
>>> Welcome to Org-mode.
>>>
>>> Aaron Ecay <aaronecay@gmail.com> writes:
>>>
>>>> 2012ko azaroak 13an, John Hendy-ek idatzi zuen:
>>>>
>>>> [...]
>>>>> Crazy. I really wondered if it had something to do with trying to spit
>>>>> out the results into the minibuffer. Why is that behavior included?
>>>>
>>>> “:results silent” just means “silent except for the minibuffer”; IDK
>>>> why.
>>>
>>
>> [...]
>>
>> Just for the record:
>> I would also love to see the "really-silent results".
>>
>
> Yes, the existing ":results silent" option still echos the results to
> the minibuffer.  It was originally added in the case where one does not
> want to change the Org-mode buffer (but would still like to see code
> block output).
>
> The attached patch adds a "really-silent" results header argument.  To
> see the impact compare the running time of the following two code
> blocks.
>
>     #+begin_src sh :results really-silent
>       seq 100000000
>     #+end_src
>     #+begin_src sh :results silent
>       seq 100000000
>     #+end_src
>
> Before such a patch is applied it would need corresponding
> documentation, and the "really-silent" moniker may need to be
> reconsidered in favor of something more informative (the main purpose of
> this header argument is not silence but is rather avoiding all post
> processing), and ideally shorter as well.  These new header arguments
> are of no value if they are not easily discover-able and easily
> remember-able to help others avoid the same issue that launched this
> thread.
>
> Cheers,

this is simply great!  Thank a lot.  I just tested and like it a lot!

With respect to the name: I think choosing a new name is hard because it
really should be "silent".  What is now "silent" would better be named
"minibuffer" or sth. similar.  But since changing that would break quite
some (of my) code, I would suggest simply "none" for the new
"really-silent".

Just my 2ct.

Thanks again.  I'll start using it right now.

Regards,
Andreas

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-16 17:47                               ` Andreas Leha
@ 2012-11-16 19:00                                 ` John Hendy
  2012-11-16 20:25                                 ` Achim Gratz
  1 sibling, 0 replies; 217+ messages in thread
From: John Hendy @ 2012-11-16 19:00 UTC (permalink / raw)
  To: Andreas Leha; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2915 bytes --]

On Fri, Nov 16, 2012 at 11:47 AM, Andreas Leha <
andreas.leha@med.uni-goettingen.de> wrote:

> Hi Eric,
>
> Eric Schulte <schulte.eric@gmail.com> writes:
>
> > Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
> >
> >> tsd@tsdye.com (Thomas S. Dye) writes:
> >>
> >>> Aloha Aaron,
> >>>
> >>> Welcome to Org-mode.
> >>>
> >>> Aaron Ecay <aaronecay@gmail.com> writes:
> >>>
> >>>> 2012ko azaroak 13an, John Hendy-ek idatzi zuen:
> >>>>
> >>>> [...]
> >>>>> Crazy. I really wondered if it had something to do with trying to
> spit
> >>>>> out the results into the minibuffer. Why is that behavior included?
> >>>>
> >>>> “:results silent” just means “silent except for the minibuffer”; IDK
> >>>> why.
> >>>
> >>
> >> [...]
> >>
> >> Just for the record:
> >> I would also love to see the "really-silent results".
> >>
> >
> > Yes, the existing ":results silent" option still echos the results to
> > the minibuffer.  It was originally added in the case where one does not
> > want to change the Org-mode buffer (but would still like to see code
> > block output).
> >
> > The attached patch adds a "really-silent" results header argument.  To
> > see the impact compare the running time of the following two code
> > blocks.
> >
> >     #+begin_src sh :results really-silent
> >       seq 100000000
> >     #+end_src
> >     #+begin_src sh :results silent
> >       seq 100000000
> >     #+end_src
> >
> > Before such a patch is applied it would need corresponding
> > documentation, and the "really-silent" moniker may need to be
> > reconsidered in favor of something more informative (the main purpose of
> > this header argument is not silence but is rather avoiding all post
> > processing), and ideally shorter as well.  These new header arguments
> > are of no value if they are not easily discover-able and easily
> > remember-able to help others avoid the same issue that launched this
> > thread.
> >
> > Cheers,
>
> this is simply great!  Thank a lot.  I just tested and like it a lot!
>
>
I'll have to give this a try.


> With respect to the name: I think choosing a new name is hard because it
> really should be "silent".  What is now "silent" would better be named
> "minibuffer" or sth. similar.  But since changing that would break quite
> some (of my) code, I would suggest simply "none" for the new
> "really-silent".
>

I like the "none" idea. Or another approach would be a variable/in-buffer
setting that defines the meaning of "silent"? Something like
=org-babel-echo-results-in-minibuffer= or something like that? Though
perhaps folks would like to mix and match silent and none within the same
document.

Thanks for creating the patch, Eric. I'll try shortly.

Best regards,
John


>
> Just my 2ct.
>
> Thanks again.  I'll start using it right now.
>
> Regards,
> Andreas
>
>
>

[-- Attachment #2: Type: text/html, Size: 4337 bytes --]

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-16 17:47                               ` Andreas Leha
  2012-11-16 19:00                                 ` John Hendy
@ 2012-11-16 20:25                                 ` Achim Gratz
  2012-11-17 17:12                                   ` Eric Schulte
  1 sibling, 1 reply; 217+ messages in thread
From: Achim Gratz @ 2012-11-16 20:25 UTC (permalink / raw)
  To: emacs-orgmode

Andreas Leha writes:
> I would suggest simply "none" for the new "really-silent".

Yes please, especially since I tried ":results none" two days ago to
achieve that effect and wondered why it wouldn't work.  :-)


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

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-16 20:25                                 ` Achim Gratz
@ 2012-11-17 17:12                                   ` Eric Schulte
  0 siblings, 0 replies; 217+ messages in thread
From: Eric Schulte @ 2012-11-17 17:12 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Achim Gratz <Stromeko@nexgo.de> writes:

> Andreas Leha writes:
>> I would suggest simply "none" for the new "really-silent".
>
> Yes please, especially since I tried ":results none" two days ago to
> achieve that effect and wondered why it wouldn't work.  :-)
>

Great, since "none" seems like the obvious choice I just committed a
version of this patch which places this behavior behind ":results none".

At some point documentation should be added to the relevant portion of
the manual, but at least we now have this for those reading the mailing
list and for those who simply try "none" with this behavior in mind.

Cheers,

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

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-16 15:45                             ` Eric Schulte
  2012-11-16 17:47                               ` Andreas Leha
@ 2012-11-18  0:41                               ` Aaron Ecay
  2012-11-18  0:57                                 ` Eric Schulte
  1 sibling, 1 reply; 217+ messages in thread
From: Aaron Ecay @ 2012-11-18  0:41 UTC (permalink / raw)
  To: Eric Schulte, Andreas Leha; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2076 bytes --]

2012ko azaroak 16an, Eric Schulte-ek idatzi zuen:

> 
> The attached patch adds a "really-silent" results header argument.  To
> see the impact compare the running time of the following two code
> blocks.

Unfortunately, the attached patch doesn’t work correctly.  This can be
seen by replacing the “seq” command in your examples with a command that
has side effects – notify-send, aplay, etc.  In the :results none” case,
the command is not run at all.

That’s because the “(funcall cmd body params)” call at l. 574 of ob.el
(patched version) has been put in a branch that is only run if :results
!= none.  That funcall is responsible for actually evaluating the code
block.

(The indentation of the patch as applied isn’t correct – the two
branches of the if on l. 565 are indented at the same depth as each
other, and as the if.  So it’s possible that the problem is due to a
paren in the wrong place.  But I cannot see a way to make this approach
work.)

The code generating the slowdown is in backend-specific files.  So, for
example, a new branch needs to be added to the case statements in
org-babel-R-evaluate(-session), to detect the :results none case and not
read the result.  I suspect that each backend will need this treatment
(unless some of them share code).

In the meantime, attached to this email is a patch that implements a
size check on reading results.  If the results file is over 10kb, it
asks the user whether to proceed.  You can test this by evaluating:

#+begin_src sh :results silent
  seq 10000
#+end_src

10kb of results actually doesn’t result in a very serious hang (~5sec on
my system).  But I chose the value as more of a sanity check – odds are
(?) that very few people want to see 10k of results in the (mini)buffer.
The value could be made customizable.

I also chose the polarity of the y-or-n-p so that picking the default
(yes) option does the sensible thing of not hanging emacs, although it
thus does discard data.  I’m not sure which is the worse problem.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-ob.el-add-a-size-check-to-org-babel-import-elis.patch --]
[-- Type: text/x-patch, Size: 2677 bytes --]

From 1053f3acfc21f24fc994ae85adff6779838b0ce7 Mon Sep 17 00:00:00 2001
From: Aaron Ecay <aaronecay@gmail.com>
Date: Sat, 17 Nov 2012 19:26:43 -0500
Subject: [PATCH] lisp/ob.el: add a size check to
 `org-babel-import-elisp-from-file'

Reading large results can cause emacs to hang for a long time.  Ask the
user whether to proceed in such cases.

Signed-off-by: Aaron Ecay <aaronecay@gmail.com>
---
 lisp/ob.el | 42 ++++++++++++++++++++++++------------------
 1 file changed, 24 insertions(+), 18 deletions(-)

diff --git a/lisp/ob.el b/lisp/ob.el
index bf4b455..b2385e9 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -2462,24 +2462,30 @@ appropriate."
 (defun org-babel-import-elisp-from-file (file-name &optional separator)
   "Read the results located at FILE-NAME into an elisp table.
 If the table is trivial, then return it as a scalar."
-  (let (result)
-    (save-window-excursion
-      (with-temp-buffer
-	(condition-case err
-	    (progn
-	      (org-table-import file-name separator)
-	      (delete-file file-name)
-	      (setq result (mapcar (lambda (row)
-				     (mapcar #'org-babel-string-read row))
-				   (org-table-to-lisp))))
-	  (error (message "Error reading results: %s" err) nil)))
-      (if (null (cdr result)) ;; if result is trivial vector, then scalarize it
-	  (if (consp (car result))
-	      (if (null (cdr (car result)))
-		  (caar result)
-		result)
-	    (car result))
-	result))))
+  (let* ((file-size (nth 7 (file-attributes file-name)))
+         (can-load (or (< file-size (* 10 1024)) ; 10kb
+                       (not (y-or-n-p (concat "Displaying the block's large "
+                                              "results may hang emacs; skip "
+                                              "reading them?"))))))
+    (when can-load
+      (let (result)
+        (save-window-excursion
+          (with-temp-buffer
+            (condition-case err
+                (progn
+                  (org-table-import file-name separator)
+                  (delete-file file-name)
+                  (setq result (mapcar (lambda (row)
+                                         (mapcar #'org-babel-string-read row))
+                                       (org-table-to-lisp))))
+              (error (message "Error reading results: %s" err) nil)))
+          (if (null (cdr result)) ;; if result is trivial vector, then scalarize it
+              (if (consp (car result))
+                  (if (null (cdr (car result)))
+                      (caar result)
+                    result)
+                (car result))
+            result))))))
 
 (defun org-babel-string-read (cell)
   "Strip nested \"s from around strings."
-- 
1.8.0


[-- Attachment #3: Type: text/plain, Size: 17 bytes --]



-- 
Aaron Ecay

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-18  0:41                               ` Aaron Ecay
@ 2012-11-18  0:57                                 ` Eric Schulte
  2012-11-18  1:41                                   ` Aaron Ecay
  0 siblings, 1 reply; 217+ messages in thread
From: Eric Schulte @ 2012-11-18  0:57 UTC (permalink / raw)
  To: Andreas Leha; +Cc: emacs-orgmode

Aaron Ecay <aaronecay@gmail.com> writes:

> 2012ko azaroak 16an, Eric Schulte-ek idatzi zuen:
>
>> 
>> The attached patch adds a "really-silent" results header argument.  To
>> see the impact compare the running time of the following two code
>> blocks.
>
> Unfortunately, the attached patch doesn’t work correctly.  This can be
> seen by replacing the “seq” command in your examples with a command that
> has side effects – notify-send, aplay, etc.  In the :results none” case,
> the command is not run at all.
>
> That’s because the “(funcall cmd body params)” call at l. 574 of ob.el
> (patched version) has been put in a branch that is only run if :results
> != none.  That funcall is responsible for actually evaluating the code
> block.
>

Oh!, thanks for catching this, I just pushed up a fix.

>
> (The indentation of the patch as applied isn’t correct – the two
> branches of the if on l. 565 are indented at the same depth as each
> other, and as the if.  So it’s possible that the problem is due to a
> paren in the wrong place.  But I cannot see a way to make this approach
> work.)
>

Yes, sometimes I find this approach to be preferable to make the diffs
more readable and to avoid over-indentation in very large functions.

>
> The code generating the slowdown is in backend-specific files.  So, for
> example, a new branch needs to be added to the case statements in
> org-babel-R-evaluate(-session), to detect the :results none case and not
> read the result.  I suspect that each backend will need this treatment
> (unless some of them share code).
>
> In the meantime, attached to this email is a patch that implements a
> size check on reading results.  If the results file is over 10kb, it
> asks the user whether to proceed.  You can test this by evaluating:
>
> #+begin_src sh :results silent
>   seq 10000
> #+end_src
>
> 10kb of results actually doesn’t result in a very serious hang (~5sec on
> my system).  But I chose the value as more of a sanity check – odds are
> (?) that very few people want to see 10k of results in the (mini)buffer.
> The value could be made customizable.
>
> I also chose the polarity of the y-or-n-p so that picking the default
> (yes) option does the sensible thing of not hanging emacs, although it
> thus does discard data.  I’m not sure which is the worse problem.
>

I may be outvoted, but I find this approach too be overly complicated.
Also, size may frequently not be the best proxy for the time which Emacs
will take to ingest the results.

Best,

>
> From 1053f3acfc21f24fc994ae85adff6779838b0ce7 Mon Sep 17 00:00:00 2001
> From: Aaron Ecay <aaronecay@gmail.com>
> Date: Sat, 17 Nov 2012 19:26:43 -0500
> Subject: [PATCH] lisp/ob.el: add a size check to
>  `org-babel-import-elisp-from-file'
>
> Reading large results can cause emacs to hang for a long time.  Ask the
> user whether to proceed in such cases.
>
> Signed-off-by: Aaron Ecay <aaronecay@gmail.com>
> ---
>  lisp/ob.el | 42 ++++++++++++++++++++++++------------------
>  1 file changed, 24 insertions(+), 18 deletions(-)
>
> diff --git a/lisp/ob.el b/lisp/ob.el
> index bf4b455..b2385e9 100644
> --- a/lisp/ob.el
> +++ b/lisp/ob.el
> @@ -2462,24 +2462,30 @@ appropriate."
>  (defun org-babel-import-elisp-from-file (file-name &optional separator)
>    "Read the results located at FILE-NAME into an elisp table.
>  If the table is trivial, then return it as a scalar."
> -  (let (result)
> -    (save-window-excursion
> -      (with-temp-buffer
> -	(condition-case err
> -	    (progn
> -	      (org-table-import file-name separator)
> -	      (delete-file file-name)
> -	      (setq result (mapcar (lambda (row)
> -				     (mapcar #'org-babel-string-read row))
> -				   (org-table-to-lisp))))
> -	  (error (message "Error reading results: %s" err) nil)))
> -      (if (null (cdr result)) ;; if result is trivial vector, then scalarize it
> -	  (if (consp (car result))
> -	      (if (null (cdr (car result)))
> -		  (caar result)
> -		result)
> -	    (car result))
> -	result))))
> +  (let* ((file-size (nth 7 (file-attributes file-name)))
> +         (can-load (or (< file-size (* 10 1024)) ; 10kb
> +                       (not (y-or-n-p (concat "Displaying the block's large "
> +                                              "results may hang emacs; skip "
> +                                              "reading them?"))))))
> +    (when can-load
> +      (let (result)
> +        (save-window-excursion
> +          (with-temp-buffer
> +            (condition-case err
> +                (progn
> +                  (org-table-import file-name separator)
> +                  (delete-file file-name)
> +                  (setq result (mapcar (lambda (row)
> +                                         (mapcar #'org-babel-string-read row))
> +                                       (org-table-to-lisp))))
> +              (error (message "Error reading results: %s" err) nil)))
> +          (if (null (cdr result)) ;; if result is trivial vector, then scalarize it
> +              (if (consp (car result))
> +                  (if (null (cdr (car result)))
> +                      (caar result)
> +                    result)
> +                (car result))
> +            result))))))
>  
>  (defun org-babel-string-read (cell)
>    "Strip nested \"s from around strings."
> -- 
> 1.8.0

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

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-18  0:57                                 ` Eric Schulte
@ 2012-11-18  1:41                                   ` Aaron Ecay
  2012-11-19  1:18                                     ` Eric Schulte
  0 siblings, 1 reply; 217+ messages in thread
From: Aaron Ecay @ 2012-11-18  1:41 UTC (permalink / raw)
  To: Eric Schulte, Andreas Leha; +Cc: emacs-orgmode

2012ko azaroak 17an, Eric Schulte-ek idatzi zuen:

> Oh!, thanks for catching this, I just pushed up a fix.

This is no longer a (complete) fix for the original problem, though.  (A
large part of) the slowdown comes from reading the results from a temp
file and transforming them into an elispy format, which is handled by
the backends.  Your code only prevents them from being echoed to the
minibuffer.

You can see this by trying your original “seq” tests.  You should see
them taking the same (very long) amount of time.

If you set debug-on-quit to t (before evaluating the block) and
interrupt emacs with C-g when it hangs, you’ll see a backtrace that goes
through ‘org-babel-execute:sh’ and then
‘org-babel-import-elisp-from-file’.  The presence of the former in the
call stack is why I claim that per-backend fixes are ultimately needed.
The latter is where my patch addresses the problem in a temporary way.

> 
> I may be outvoted, but I find this approach too be overly complicated.
> Also, size may frequently not be the best proxy for the time which
> Emacs will take to ingest the results.

I agree that my patch is a stopgap.  But until per-backend fixes are
available, this allows certain code to run that otherwise wouldn’t (at
least not without hacks, such as putting NULL at the end of an R source
block so that the “.Last.value” in the block is trivial).

-- 
Aaron Ecay

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-18  1:41                                   ` Aaron Ecay
@ 2012-11-19  1:18                                     ` Eric Schulte
  2012-11-19  5:11                                       ` Eric Schulte
  0 siblings, 1 reply; 217+ messages in thread
From: Eric Schulte @ 2012-11-19  1:18 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2546 bytes --]

Aaron Ecay <aaronecay@gmail.com> writes:

> 2012ko azaroak 17an, Eric Schulte-ek idatzi zuen:
>
>> Oh!, thanks for catching this, I just pushed up a fix.
>
> This is no longer a (complete) fix for the original problem, though.  (A
> large part of) the slowdown comes from reading the results from a temp
> file and transforming them into an elispy format, which is handled by
> the backends.  Your code only prevents them from being echoed to the
> minibuffer.
>
> You can see this by trying your original “seq” tests.  You should see
> them taking the same (very long) amount of time.
>
> If you set debug-on-quit to t (before evaluating the block) and
> interrupt emacs with C-g when it hangs, you’ll see a backtrace that goes
> through ‘org-babel-execute:sh’ and then
> ‘org-babel-import-elisp-from-file’.  The presence of the former in the
> call stack is why I claim that per-backend fixes are ultimately needed.
> The latter is where my patch addresses the problem in a temporary way.
>

I apologize for rushing through your previous email and missing
important portions of the content.

>
>> 
>> I may be outvoted, but I find this approach too be overly complicated.
>> Also, size may frequently not be the best proxy for the time which
>> Emacs will take to ingest the results.
>
> I agree that my patch is a stopgap.  But until per-backend fixes are
> available, this allows certain code to run that otherwise wouldn’t (at
> least not without hacks, such as putting NULL at the end of an R source
> block so that the “.Last.value” in the block is trivial).

I'm attaching a new patch which should serve as a more permanent
solution, however, given that it touches almost every backend I want to
give the list a chance to try it out before committing it.  This patch
introduces a new macro (`org-babel-result-cond') which attempts to unify
the results processing.  Not only does this check for ":results none"
and ignore all results in that case, but it also checks whether the
results should be parsed as a scalar or a vector.  Hopefully this will
serve as useful refactoring and reduce the total amount of code as well
as provide for more uniform results processing across languages.

Please let me know if this looks like a good permanent solution.

I see that I'm now getting 5 test failures with this patch applied
locally, but I won't have time to look at this further until early next
week at the earliest, so I'm sharing the existing patch now.

Thanks,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-babel-result-cond-unified-handling-of-results.patch --]
[-- Type: text/x-patch, Size: 17068 bytes --]

From a2878534832923e42aef49176b87d9993c04af71 Mon Sep 17 00:00:00 2001
From: Eric Schulte <eric.schulte@gmx.com>
Date: Sun, 18 Nov 2012 18:02:09 -0700
Subject: [PATCH] org-babel-result-cond - unified handling of results

* lisp/ob.el (org-babel-result-cond): This function should now be used
  by all language backends to handle the processing of raw code block
  output into scalar results, table results, or ignored results
  depending on the value of result-params.

* lisp/ob-C.el (org-babel-C-execute): Use org-babel-result-cond.
* lisp/ob-R.el (org-babel-R-evaluate-external-process): Use
  org-babel-result-cond.
  (org-babel-R-evaluate-session): Use org-babel-result-cond.
* lisp/ob-awk.el (org-babel-execute:awk): Use org-babel-result-cond.
* lisp/ob-clojure.el (org-babel-execute:clojure): Use
  org-babel-result-cond.
* lisp/ob-emacs-lisp.el (org-babel-execute:emacs-lisp): Use
  org-babel-result-cond.
* lisp/ob-fortran.el (org-babel-execute:fortran): Use
  org-babel-result-cond.
* lisp/ob-io.el (org-babel-io-evaluate): Use org-babel-result-cond.
* lisp/ob-java.el (org-babel-execute:java): Use org-babel-result-cond.
* lisp/ob-lisp.el (org-babel-execute:lisp): Use org-babel-result-cond.
* lisp/ob-maxima.el (org-babel-execute:maxima): Use
  org-babel-result-cond.
* lisp/ob-picolisp.el (org-babel-execute:picolisp): Use
  org-babel-result-cond.
* lisp/ob-python.el (org-babel-python-evaluate-external-process): Use
  org-babel-result-cond.
  (org-babel-python-evaluate-session): Use org-babel-result-cond.
* lisp/ob-scala.el (org-babel-scala-evaluate): Use org-babel-result-cond.
* lisp/ob-sh.el (org-babel-sh-evaluate): Use org-babel-result-cond.
* lisp/ob-shen.el (org-babel-execute:shen): Use org-babel-result-cond.
* lisp/ob-sql.el (org-babel-execute:sql): Use org-babel-result-cond.
* lisp/ob-sqlite.el (org-babel-execute:sqlite): Use
  org-babel-result-cond.
---
 lisp/ob-C.el          | 10 +++++-----
 lisp/ob-R.el          | 18 ++++++++----------
 lisp/ob-awk.el        |  6 ++----
 lisp/ob-clojure.el    |  5 ++---
 lisp/ob-emacs-lisp.el |  9 ++++-----
 lisp/ob-fortran.el    | 10 +++++-----
 lisp/ob-io.el         |  4 ++--
 lisp/ob-java.el       |  8 ++++----
 lisp/ob-lisp.el       |  4 ++--
 lisp/ob-maxima.el     |  6 ++----
 lisp/ob-picolisp.el   |  9 ++-------
 lisp/ob-python.el     | 14 ++++----------
 lisp/ob-scala.el      |  4 ++--
 lisp/ob-sh.el         |  6 ++----
 lisp/ob-shen.el       |  5 ++---
 lisp/ob-sql.el        |  8 ++------
 lisp/ob-sqlite.el     | 32 +++++++++++++++-----------------
 lisp/ob.el            | 14 ++++++++++++++
 18 files changed, 79 insertions(+), 93 deletions(-)

diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index ba50722..55e4b40 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -106,11 +106,11 @@ or `org-babel-execute:C++'."
 		     (org-babel-process-file-name tmp-src-file)) ""))))
     ((lambda (results)
        (org-babel-reassemble-table
-	(if (member "vector" (cdr (assoc :result-params params)))
-	    (let ((tmp-file (org-babel-temp-file "c-")))
-	      (with-temp-file tmp-file (insert results))
-	      (org-babel-import-elisp-from-file tmp-file))
-	  (org-babel-read results))
+	(org-babel-result-cond (cdr (assoc :result-params params))
+	  (org-babel-read results)
+	  (let ((tmp-file (org-babel-temp-file "c-")))
+	    (with-temp-file tmp-file (insert results))
+	    (org-babel-import-elisp-from-file tmp-file)))
 	(org-babel-pick-name
 	 (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
 	(org-babel-pick-name
diff --git a/lisp/ob-R.el b/lisp/ob-R.el
index 3dedb39..5711f38 100644
--- a/lisp/ob-R.el
+++ b/lisp/ob-R.el
@@ -302,11 +302,10 @@ last statement in BODY, as elisp."
 			       (format "{function ()\n{\n%s\n}}()" body)
 			       (org-babel-process-file-name tmp-file 'noquote)))
        (org-babel-R-process-value-result
-	(if (or (member "scalar" result-params)
-		(member "verbatim" result-params))
-	    (with-temp-buffer
-	      (insert-file-contents tmp-file)
-	      (buffer-string))
+	(org-babel-result-cond result-params
+	  (with-temp-buffer
+	    (insert-file-contents tmp-file)
+	    (buffer-string))
 	  (org-babel-import-elisp-from-file tmp-file '(16)))
 	column-names-p)))
     (output (org-babel-eval org-babel-R-command body))))
@@ -335,11 +334,10 @@ last statement in BODY, as elisp."
 		  "FALSE")
 		".Last.value" (org-babel-process-file-name tmp-file 'noquote)))
        (org-babel-R-process-value-result
-	(if (or (member "scalar" result-params)
-		(member "verbatim" result-params))
-	    (with-temp-buffer
-	      (insert-file-contents tmp-file)
-	      (buffer-string))
+	(org-babel-result-cond result-params
+	  (with-temp-buffer
+	    (insert-file-contents tmp-file)
+	    (buffer-string))
 	  (org-babel-import-elisp-from-file tmp-file '(16)))
 	column-names-p)))
     (output
diff --git a/lisp/ob-awk.el b/lisp/ob-awk.el
index 6e13996..6ce67f4 100644
--- a/lisp/ob-awk.el
+++ b/lisp/ob-awk.el
@@ -78,10 +78,8 @@ called by `org-babel-execute-src-block'"
     (org-babel-reassemble-table
      ((lambda (results)
 	(when results
-	  (if (or (member "scalar" result-params)
-		  (member "verbatim" result-params)
-		  (member "output" result-params))
-	      results
+	  (org-babel-result-cond result-params
+	    results
 	    (let ((tmp (org-babel-temp-file "awk-results-")))
 	      (with-temp-file tmp (insert results))
 	      (org-babel-import-elisp-from-file tmp)))))
diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el
index f389404..f0361d3 100644
--- a/lisp/ob-clojure.el
+++ b/lisp/ob-clojure.el
@@ -79,9 +79,8 @@
     (insert (org-babel-expand-body:clojure body params))
     ((lambda (result)
        (let ((result-params (cdr (assoc :result-params params))))
-	 (if (or (member "scalar" result-params)
-		 (member "verbatim" result-params))
-	     result
+	 (org-babel-result-cond result-params
+	   result
 	   (condition-case nil (org-babel-script-escape result)
 	     (error result)))))
      (slime-eval
diff --git a/lisp/ob-emacs-lisp.el b/lisp/ob-emacs-lisp.el
index d83ca24..e2e4c6c 100644
--- a/lisp/ob-emacs-lisp.el
+++ b/lisp/ob-emacs-lisp.el
@@ -56,11 +56,10 @@
   "Execute a block of emacs-lisp code with Babel."
   (save-window-excursion
     ((lambda (result)
-       (if (or (member "scalar" (cdr (assoc :result-params params)))
-	       (member "verbatim" (cdr (assoc :result-params params))))
-	   (let ((print-level nil)
-		 (print-length nil))
-	     (format "%S" result))
+       (org-babel-result-cond (cdr (assoc :result-params params))
+	 (let ((print-level nil)
+	       (print-length nil))
+	   (format "%S" result))
 	 (org-babel-reassemble-table
 	  result
 	  (org-babel-pick-name (cdr (assoc :colname-names params))
diff --git a/lisp/ob-fortran.el b/lisp/ob-fortran.el
index 7f2d1a8..fb688bc 100644
--- a/lisp/ob-fortran.el
+++ b/lisp/ob-fortran.el
@@ -62,11 +62,11 @@
 		     (org-babel-process-file-name tmp-src-file)) ""))))
     ((lambda (results)
        (org-babel-reassemble-table
-	(if (member "vector" (cdr (assoc :result-params params)))
-	    (let ((tmp-file (org-babel-temp-file "f-")))
-	      (with-temp-file tmp-file (insert results))
-	      (org-babel-import-elisp-from-file tmp-file))
-	  (org-babel-read results))
+	(org-babel-result-cond (cdr (assoc :result-params params))
+	  (org-babel-read results)
+	  (let ((tmp-file (org-babel-temp-file "f-")))
+	    (with-temp-file tmp-file (insert results))
+	    (org-babel-import-elisp-from-file tmp-file)))
 	(org-babel-pick-name
 	 (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
 	(org-babel-pick-name
diff --git a/lisp/ob-io.el b/lisp/ob-io.el
index 881f35a..f47bef8 100644
--- a/lisp/ob-io.el
+++ b/lisp/ob-io.el
@@ -98,8 +98,8 @@ in BODY as elisp."
                   (wrapper (format org-babel-io-wrapper-method body)))
              (with-temp-file src-file (insert wrapper))
              ((lambda (raw)
-                (if (member "code" result-params)
-                    raw
+                (org-babel-result-cond result-params
+		  raw
                   (org-babel-io-table-or-string raw)))
               (org-babel-eval
                (concat org-babel-io-command " " src-file) ""))))))
diff --git a/lisp/ob-java.el b/lisp/ob-java.el
index 75afda1..99f66b9 100644
--- a/lisp/ob-java.el
+++ b/lisp/ob-java.el
@@ -58,11 +58,11 @@
       (make-directory packagename 'parents))
     ((lambda (results)
        (org-babel-reassemble-table
-	(if (member "vector" (cdr (assoc :result-params params)))
-	    (let ((tmp-file (org-babel-temp-file "c-")))
+	(org-babel-result-cond (cdr (assoc :result-params params))
+	  (org-babel-read results)
+	  (let ((tmp-file (org-babel-temp-file "c-")))
 	      (with-temp-file tmp-file (insert results))
-	      (org-babel-import-elisp-from-file tmp-file))
-	  (org-babel-read results))
+	      (org-babel-import-elisp-from-file tmp-file)))
 	(org-babel-pick-name
 	 (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
 	(org-babel-pick-name
diff --git a/lisp/ob-lisp.el b/lisp/ob-lisp.el
index 71e80bd..1b120a8 100644
--- a/lisp/ob-lisp.el
+++ b/lisp/ob-lisp.el
@@ -76,8 +76,8 @@ current directory string."
   (require 'slime)
   (org-babel-reassemble-table
    ((lambda (result)
-      (if (member "output" (cdr (assoc :result-params params)))
-	  (car result)
+      (org-babel-result-cond (cdr (assoc :result-params params))
+	(car result)
 	(condition-case nil
 	    (read (org-babel-lisp-vector-to-list (cadr result)))
 	  (error (cadr result)))))
diff --git a/lisp/ob-maxima.el b/lisp/ob-maxima.el
index 06fa3cf..7e5a556 100644
--- a/lisp/ob-maxima.el
+++ b/lisp/ob-maxima.el
@@ -89,10 +89,8 @@ called by `org-babel-execute-src-block'."
 	    (org-babel-eval cmd "")))))
     (if (org-babel-maxima-graphical-output-file params)
 	nil
-      (if (or (member "scalar" result-params)
-	      (member "verbatim" result-params)
-	      (member "output" result-params))
-	  result
+      (org-babel-result-cond result-params
+	result
 	(let ((tmp-file (org-babel-temp-file "maxima-res-")))
 	  (with-temp-file tmp-file (insert result))
 	  (org-babel-import-elisp-from-file tmp-file))))))
diff --git a/lisp/ob-picolisp.el b/lisp/ob-picolisp.el
index 025993c..1972d29 100644
--- a/lisp/ob-picolisp.el
+++ b/lisp/ob-picolisp.el
@@ -123,13 +123,8 @@
            (t full-body))))
 
     ((lambda (result)
-       (if (or (member "verbatim" result-params)
-               (member "scalar" result-params)
-               (member "output" result-params)
-               (member "code" result-params)
-               (member "pp" result-params)
-               (= (length result) 0))
-           result
+       (org-babel-result-cond result-params
+	 result
          (read result)))
      (if (not (string= session-name "none"))
          ;; session based evaluation
diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index 041f4b5..4d94ecf 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -216,11 +216,8 @@ If RESULT-TYPE equals 'output then return standard output as a
 string.  If RESULT-TYPE equals 'value then return the value of the
 last statement in BODY, as elisp."
   ((lambda (raw)
-     (if (or (member "code" result-params)
-	     (member "pp" result-params)
-	     (and (member "output" result-params)
-		  (not (member "table" result-params))))
-	 raw
+     (org-babel-result-cond result-params
+       raw
        (org-babel-python-table-or-string (org-babel-trim raw))))
    (case result-type
      (output (org-babel-eval org-babel-python-command
@@ -269,11 +266,8 @@ last statement in BODY, as elisp."
 		       (funcall send-wait))))
     ((lambda (results)
        (unless (string= (substring org-babel-python-eoe-indicator 1 -1) results)
-	 (if (or (member "code" result-params)
-		 (member "pp" result-params)
-		 (and (member "output" result-params)
-		      (not (member "table" result-params))))
-	     results
+	 (org-babel-result-cond result-params
+	   results
 	   (org-babel-python-table-or-string results))))
      (case result-type
        (output
diff --git a/lisp/ob-scala.el b/lisp/ob-scala.el
index ea3c3f2..df344ff 100644
--- a/lisp/ob-scala.el
+++ b/lisp/ob-scala.el
@@ -104,8 +104,8 @@ in BODY as elisp."
             (wrapper (format org-babel-scala-wrapper-method body)))
        (with-temp-file src-file (insert wrapper))
        ((lambda (raw)
-          (if (member "code" result-params)
-              raw
+          (org-babel-result-cond result-params
+	    raw
             (org-babel-scala-table-or-string raw)))
         (org-babel-eval
          (concat org-babel-scala-command " " src-file) ""))))))
diff --git a/lisp/ob-sh.el b/lisp/ob-sh.el
index 1cb607f..9b21d05 100644
--- a/lisp/ob-sh.el
+++ b/lisp/ob-sh.el
@@ -141,10 +141,8 @@ return the value of the last statement in BODY."
   ((lambda (results)
      (when results
        (let ((result-params (cdr (assoc :result-params params))))
-	 (if (or (member "scalar" result-params)
-		 (member "verbatim" result-params)
-		 (member "output" result-params))
-	     results
+	 (org-babel-result-cond result-params
+	   results
 	   (let ((tmp-file (org-babel-temp-file "sh-")))
 	     (with-temp-file tmp-file (insert results))
 	     (org-babel-import-elisp-from-file tmp-file))))))
diff --git a/lisp/ob-shen.el b/lisp/ob-shen.el
index 8f4b132..220efcf 100644
--- a/lisp/ob-shen.el
+++ b/lisp/ob-shen.el
@@ -66,9 +66,8 @@ This function is called by `org-babel-execute-src-block'"
 	 (result-params (cdr (assoc :result-params params)))
          (full-body (org-babel-expand-body:shen body params)))
     ((lambda (results)
-       (if (or (member 'scalar result-params)
-	       (member 'verbatim result-params))
-	   results
+       (org-babel-result-cond result-params 
+	 results
 	 (condition-case nil (org-babel-script-escape results)
 	   (error results))))
      (with-temp-buffer
diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index 20a136a..90a6e0a 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -103,12 +103,8 @@ This function is called by `org-babel-execute-src-block'."
        (org-babel-expand-body:sql body params)))
     (message command)
     (shell-command command)
-    (if (or (member "scalar" result-params)
-	    (member "verbatim" result-params)
-	    (member "html" result-params)
-	    (member "code" result-params)
-	    (equal (point-min) (point-max)))
-	(with-temp-buffer
+    (org-babel-result-cond result-params
+      (with-temp-buffer
 	  (progn (insert-file-contents-literally out-file) (buffer-string)))
       (with-temp-buffer
 	;; need to figure out what the delimiter is for the header row
diff --git a/lisp/ob-sqlite.el b/lisp/ob-sqlite.el
index b1696d9..1f8a6c0 100644
--- a/lisp/ob-sqlite.el
+++ b/lisp/ob-sqlite.el
@@ -98,23 +98,21 @@ This function is called by `org-babel-execute-src-block'."
 	  (cons "db " db)))
 	;; body of the code block
 	(org-babel-expand-body:sqlite body params)))
-      (if (or (member "scalar" result-params)
-	      (member "verbatim" result-params)
-	      (member "html" result-params)
-	      (member "code" result-params)
-	      (equal (point-min) (point-max)))
-	  (buffer-string)
-	(org-table-convert-region (point-min) (point-max)
-				  (if (or (member :csv others)
-					  (member :column others)
-					  (member :line others)
-					  (member :list others)
-					  (member :html others) separator)
-				      nil
-				    '(4)))
-	(org-babel-sqlite-table-or-scalar
-	 (org-babel-sqlite-offset-colnames
-	  (org-table-to-lisp) headers-p))))))
+      (org-babel-result-cond result-params
+	(buffer-string)
+	(if (equal (point-min) (point-max))
+	    ""
+	  (org-table-convert-region (point-min) (point-max)
+				    (if (or (member :csv others)
+					    (member :column others)
+					    (member :line others)
+					    (member :list others)
+					    (member :html others) separator)
+					nil
+				      '(4)))
+	  (org-babel-sqlite-table-or-scalar
+	   (org-babel-sqlite-offset-colnames
+	    (org-table-to-lisp) headers-p)))))))
 
 (defun org-babel-sqlite-expand-vars (body vars)
   "Expand the variables held in VARS in BODY."
diff --git a/lisp/ob.el b/lisp/ob.el
index 84b1180..e0192a1 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -2561,6 +2561,20 @@ additionally processed by `shell-quote-argument'"
 Used by `org-babel-temp-file'.  This directory will be removed on
 Emacs shutdown."))
 
+(defmacro org-babel-result-cond (result-params scalar-form &rest table-forms)
+  "Call the code to parse raw string results according to RESULT-PARAMS."
+  (declare (indent 1))
+  `(unless (member "none" result-params)
+     (if (or (member "scalar" result-params)
+	     (member "verbatim" result-params)
+	     (member "html" result-params)
+	     (member "code" result-params)
+	     (member "pp" result-params)
+	     (and (member "output" result-params)
+		  (not (member "table" result-params))))
+	 ,scalar-form
+       ,@table-forms)))
+
 (defun org-babel-temp-file (prefix &optional suffix)
   "Create a temporary file in the `org-babel-temporary-directory'.
 Passes PREFIX and SUFFIX directly to `make-temp-file' with the
-- 
1.8.0


[-- Attachment #3: Type: text/plain, Size: 46 bytes --]


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

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

* Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly
  2012-11-19  1:18                                     ` Eric Schulte
@ 2012-11-19  5:11                                       ` Eric Schulte
  0 siblings, 0 replies; 217+ messages in thread
From: Eric Schulte @ 2012-11-19  5:11 UTC (permalink / raw)
  To: emacs-orgmode

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

> Aaron Ecay <aaronecay@gmail.com> writes:
>
>> 2012ko azaroak 17an, Eric Schulte-ek idatzi zuen:
>>
>>> Oh!, thanks for catching this, I just pushed up a fix.
>>
>> This is no longer a (complete) fix for the original problem, though.  (A
>> large part of) the slowdown comes from reading the results from a temp
>> file and transforming them into an elispy format, which is handled by
>> the backends.  Your code only prevents them from being echoed to the
>> minibuffer.
>>
>> You can see this by trying your original “seq” tests.  You should see
>> them taking the same (very long) amount of time.
>>
>> If you set debug-on-quit to t (before evaluating the block) and
>> interrupt emacs with C-g when it hangs, you’ll see a backtrace that goes
>> through ‘org-babel-execute:sh’ and then
>> ‘org-babel-import-elisp-from-file’.  The presence of the former in the
>> call stack is why I claim that per-backend fixes are ultimately needed.
>> The latter is where my patch addresses the problem in a temporary way.
>>
>
> I apologize for rushing through your previous email and missing
> important portions of the content.
>
>>
>>> 
>>> I may be outvoted, but I find this approach too be overly complicated.
>>> Also, size may frequently not be the best proxy for the time which
>>> Emacs will take to ingest the results.
>>
>> I agree that my patch is a stopgap.  But until per-backend fixes are
>> available, this allows certain code to run that otherwise wouldn’t (at
>> least not without hacks, such as putting NULL at the end of an R source
>> block so that the “.Last.value” in the block is trivial).
>
> I'm attaching a new patch which should serve as a more permanent
> solution, however, given that it touches almost every backend I want to
> give the list a chance to try it out before committing it.  This patch
> introduces a new macro (`org-babel-result-cond') which attempts to unify
> the results processing.  Not only does this check for ":results none"
> and ignore all results in that case, but it also checks whether the
> results should be parsed as a scalar or a vector.  Hopefully this will
> serve as useful refactoring and reduce the total amount of code as well
> as provide for more uniform results processing across languages.
>
> Please let me know if this looks like a good permanent solution.
>
> I see that I'm now getting 5 test failures with this patch applied
> locally, but I won't have time to look at this further until early next
> week at the earliest, so I'm sharing the existing patch now.
>
> Thanks,

Alright, I've now changed the above patch so that as many tests are
passing locally as were passing without the patch.  Given that, I've
applied this patch to the main git repository.  Everything which worked
previously should still be working, only now the ":results none" options
should have the desired effect.

Cheers,

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

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

* python sessions
@ 2013-03-19 21:40 Gary Oberbrunner
  2013-03-20  0:04 ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: Gary Oberbrunner @ 2013-03-19 21:40 UTC (permalink / raw)
  To: Orgmode Mailing List

[-- Attachment #1: Type: text/plain, Size: 762 bytes --]

I must be failing to understand something.  I'm running Emacs 24.3 on
Windows, with latest trunk org-mode.  I can't get python functions to
persist across blocks in session mode.  Here's my foo.org:

===============

* My Document
#+BEGIN_SRC python :exports results :results output :session
def foo(x):
  return x+1
print "hi"
#+END_SRC

#+RESULTS:
: hi

#+BEGIN_SRC python :exports results :results output :session
print foo(100)
print "bye"
#+END_SRC

========================

In session mode, shouldn't foo be defined in the second python block?  When
I export this, I get "NameError: name 'foo' is not defined"

I may be doing something wrong, because if I name my python session, I
never see a buffer of that name, and I expected to.  Any help?

-- 
Gary

[-- Attachment #2: Type: text/html, Size: 1166 bytes --]

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

* Re: python sessions
  2013-03-19 21:40 python sessions Gary Oberbrunner
@ 2013-03-20  0:04 ` John Hendy
  2013-03-20  3:07   ` Nick Dokos
  2013-03-20  7:08   ` Andreas Röhler
  0 siblings, 2 replies; 217+ messages in thread
From: John Hendy @ 2013-03-20  0:04 UTC (permalink / raw)
  To: Gary Oberbrunner; +Cc: Orgmode Mailing List

On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner <garyo@oberbrunner.com> wrote:
> I must be failing to understand something.  I'm running Emacs 24.3 on
> Windows, with latest trunk org-mode.  I can't get python functions to
> persist across blocks in session mode.  Here's my foo.org:
>
> ===============
>
> * My Document
> #+BEGIN_SRC python :exports results :results output :session
> def foo(x):
>   return x+1
> print "hi"
> #+END_SRC
>
> #+RESULTS:
> : hi
>
> #+BEGIN_SRC python :exports results :results output :session
> print foo(100)
> print "bye"
> #+END_SRC
>
> ========================
>
> In session mode, shouldn't foo be defined in the second python block?  When
> I export this, I get "NameError: name 'foo' is not defined"
>
> I may be doing something wrong, because if I name my python session, I never
> see a buffer of that name, and I expected to.  Any help?
>
> --
> Gary

You should probably post your babel configuration from .emacs. This
works for me (mostly). I'm using python 3.3 and so the print function
has changed to requiring parentheses. I can switch to a buffer called
*Python*, however, and =print("hi")= works fine.

If I change to =print(foo(100))=, I get 101 in the #+RESULTS block.

It's probably got something to do with your setup; taking a look at
your config should help others help you out.


Best regards,
John

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

* Re: python sessions
  2013-03-20  0:04 ` John Hendy
@ 2013-03-20  3:07   ` Nick Dokos
  2013-03-20  6:44     ` Andreas Röhler
  2013-03-20  7:08   ` Andreas Röhler
  1 sibling, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2013-03-20  3:07 UTC (permalink / raw)
  To: John Hendy; +Cc: Orgmode Mailing List, Gary Oberbrunner

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

> On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner <garyo@oberbrunner.com> wrote:
> > I must be failing to understand something.  I'm running Emacs 24.3 on
> > Windows, with latest trunk org-mode.  I can't get python functions to
> > persist across blocks in session mode.  Here's my foo.org:
> >
> > ===============
> >
> > * My Document
> > #+BEGIN_SRC python :exports results :results output :session
> > def foo(x):
> >   return x+1
> > print "hi"
> > #+END_SRC
> >
> > #+RESULTS:
> > : hi
> >
> > #+BEGIN_SRC python :exports results :results output :session
> > print foo(100)
> > print "bye"
> > #+END_SRC
> >
> > ========================
> >
> > In session mode, shouldn't foo be defined in the second python block?  When
> > I export this, I get "NameError: name 'foo' is not defined"
> >
> > I may be doing something wrong, because if I name my python session, I never
> > see a buffer of that name, and I expected to.  Any help?
> >
> > --
> > Gary
> 
> You should probably post your babel configuration from .emacs. This
> works for me (mostly). I'm using python 3.3 and so the print function
> has changed to requiring parentheses. I can switch to a buffer called
> *Python*, however, and =print("hi")= works fine.
> 
> If I change to =print(foo(100))=, I get 101 in the #+RESULTS block.
> 

I don't - I get the same error as Gary.

And looking at the code of org-babel-python-initiate-session-by-key,
I don't understand how it's supposed to work: python-buffer is nil
to begin with; the cond takes the first branch and starts a python session.
When we come to

      (setq org-babel-python-buffers
	    (cons (cons session python-buffer)
		  (assq-delete-all session org-babel-python-buffers)))

python-buffer is still nil, so we are cooked.

Maybe python-buffer was set as a side-effect of run-python in earlier
versions of emacs? If so, it does not seem to be the case now.

Nick

Org-mode version 8.0-pre (release_8.0-pre-144-g855dcf.dirty @ /home/nick/elisp/org-mode/lisp/)
GNU Emacs 24.3.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.4) of 2012-12-29 on alphaville

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

* Re: python sessions
  2013-03-20  3:07   ` Nick Dokos
@ 2013-03-20  6:44     ` Andreas Röhler
  2013-03-20 12:54       ` Ista Zahn
  0 siblings, 1 reply; 217+ messages in thread
From: Andreas Röhler @ 2013-03-20  6:44 UTC (permalink / raw)
  To: emacs-orgmode

Am 20.03.2013 04:07, schrieb Nick Dokos:
> John Hendy <jw.hendy@gmail.com> wrote:
>
>> On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner <garyo@oberbrunner.com> wrote:
>>> I must be failing to understand something.  I'm running Emacs 24.3 on
>>> Windows, with latest trunk org-mode.  I can't get python functions to
>>> persist across blocks in session mode.  Here's my foo.org:
>>>
>>> ===============
>>>
>>> * My Document
>>> #+BEGIN_SRC python :exports results :results output :session
>>> def foo(x):
>>>    return x+1
>>> print "hi"
>>> #+END_SRC
>>>
>>> #+RESULTS:
>>> : hi
>>>
>>> #+BEGIN_SRC python :exports results :results output :session
>>> print foo(100)
>>> print "bye"
>>> #+END_SRC
>>>
>>> ========================
>>>
>>> In session mode, shouldn't foo be defined in the second python block?  When
>>> I export this, I get "NameError: name 'foo' is not defined"
>>>
>>> I may be doing something wrong, because if I name my python session, I never
>>> see a buffer of that name, and I expected to.  Any help?
>>>
>>> --
>>> Gary
>>
>> You should probably post your babel configuration from .emacs. This
>> works for me (mostly). I'm using python 3.3 and so the print function
>> has changed to requiring parentheses. I can switch to a buffer called
>> *Python*, however, and =print("hi")= works fine.
>>
>> If I change to =print(foo(100))=, I get 101 in the #+RESULTS block.
>>
>
> I don't - I get the same error as Gary.
>
> And looking at the code of org-babel-python-initiate-session-by-key,
> I don't understand how it's supposed to work: python-buffer is nil
> to begin with; the cond takes the first branch and starts a python session.
> When we come to
>
>        (setq org-babel-python-buffers
> 	    (cons (cons session python-buffer)
> 		  (assq-delete-all session org-babel-python-buffers)))
>
> python-buffer is still nil, so we are cooked.
>
> Maybe python-buffer was set as a side-effect of run-python in earlier
> versions of emacs? If so, it does not seem to be the case now.
>
> Nick
>
> Org-mode version 8.0-pre (release_8.0-pre-144-g855dcf.dirty @ /home/nick/elisp/org-mode/lisp/)
> GNU Emacs 24.3.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.4) of 2012-12-29 on alphaville
>
>

AFAIU :session is broken, because Python shell as opened by run-python or py-shell isn't used by ob-babel.
Seems ob-babel sends it's code w/ an own shell command, thus opening a new python shell internally every time.

Did :session ever work? Then I might be wrong with this comment.

Andreas

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

* Re: python sessions
  2013-03-20  0:04 ` John Hendy
  2013-03-20  3:07   ` Nick Dokos
@ 2013-03-20  7:08   ` Andreas Röhler
  2013-03-20 15:38     ` John Hendy
  1 sibling, 1 reply; 217+ messages in thread
From: Andreas Röhler @ 2013-03-20  7:08 UTC (permalink / raw)
  To: emacs-orgmode

Am 20.03.2013 01:04, schrieb John Hendy:
> On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner <garyo@oberbrunner.com> wrote:
>> I must be failing to understand something.  I'm running Emacs 24.3 on
>> Windows, with latest trunk org-mode.  I can't get python functions to
>> persist across blocks in session mode.  Here's my foo.org:
>>
>> ===============
>>
>> * My Document
>> #+BEGIN_SRC python :exports results :results output :session
>> def foo(x):
>>    return x+1
>> print "hi"
>> #+END_SRC
>>
>> #+RESULTS:
>> : hi
>>
>> #+BEGIN_SRC python :exports results :results output :session
>> print foo(100)
>> print "bye"
>> #+END_SRC
>>
>> ========================
>>
>> In session mode, shouldn't foo be defined in the second python block?  When
>> I export this, I get "NameError: name 'foo' is not defined"
>>
>> I may be doing something wrong, because if I name my python session, I never
>> see a buffer of that name, and I expected to.  Any help?
>>
>> --
>> Gary
>
> You should probably post your babel configuration from .emacs. This
> works for me (mostly). I'm using python 3.3

Hi John,

let's point out though that matter is not at stake.
As the OP got output, system Python must be a 2...

Best,

Andreas

  and so the print function
> has changed to requiring parentheses. I can switch to a buffer called
> *Python*, however, and =print("hi")= works fine.
>
> If I change to =print(foo(100))=, I get 101 in the #+RESULTS block.
>
> It's probably got something to do with your setup; taking a look at
> your config should help others help you out.
>
>
> Best regards,
> John
>
>

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

* Re: python sessions
  2013-03-20  6:44     ` Andreas Röhler
@ 2013-03-20 12:54       ` Ista Zahn
  2013-03-20 14:08         ` Nick Dokos
  2013-03-20 17:21         ` Andreas Röhler
  0 siblings, 2 replies; 217+ messages in thread
From: Ista Zahn @ 2013-03-20 12:54 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: emacs-orgmode

On Wed, Mar 20, 2013 at 2:44 AM, Andreas Röhler
<andreas.roehler@easy-emacs.de> wrote:
> Am 20.03.2013 04:07, schrieb Nick Dokos:
>
>> John Hendy <jw.hendy@gmail.com> wrote:
>>
>>> On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner <garyo@oberbrunner.com>
>>> wrote:
>>>>
>>>> I must be failing to understand something.  I'm running Emacs 24.3 on
>>>> Windows, with latest trunk org-mode.  I can't get python functions to
>>>> persist across blocks in session mode.  Here's my foo.org:
>>>>
>>>> ===============
>>>>
>>>> * My Document
>>>> #+BEGIN_SRC python :exports results :results output :session
>>>> def foo(x):
>>>>    return x+1
>>>> print "hi"
>>>> #+END_SRC
>>>>
>>>> #+RESULTS:
>>>> : hi
>>>>
>>>> #+BEGIN_SRC python :exports results :results output :session
>>>> print foo(100)
>>>> print "bye"
>>>> #+END_SRC
>>>>
>>>> ========================
>>>>
>>>> In session mode, shouldn't foo be defined in the second python block?
>>>> When
>>>> I export this, I get "NameError: name 'foo' is not defined"
>>>>
>>>> I may be doing something wrong, because if I name my python session, I
>>>> never
>>>> see a buffer of that name, and I expected to.  Any help?
>>>>
>>>> --
>>>> Gary
>>>
>>>
>>> You should probably post your babel configuration from .emacs. This
>>> works for me (mostly). I'm using python 3.3 and so the print function
>>> has changed to requiring parentheses. I can switch to a buffer called
>>> *Python*, however, and =print("hi")= works fine.
>>>
>>> If I change to =print(foo(100))=, I get 101 in the #+RESULTS block.
>>>
>>
>> I don't - I get the same error as Gary.
>>
>> And looking at the code of org-babel-python-initiate-session-by-key,
>> I don't understand how it's supposed to work: python-buffer is nil
>> to begin with; the cond takes the first branch and starts a python
>> session.
>> When we come to
>>
>>        (setq org-babel-python-buffers
>>             (cons (cons session python-buffer)
>>                   (assq-delete-all session org-babel-python-buffers)))
>>
>> python-buffer is still nil, so we are cooked.
>>
>> Maybe python-buffer was set as a side-effect of run-python in earlier
>> versions of emacs? If so, it does not seem to be the case now.
>>
>> Nick
>>
>> Org-mode version 8.0-pre (release_8.0-pre-144-g855dcf.dirty @
>> /home/nick/elisp/org-mode/lisp/)
>> GNU Emacs 24.3.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.4) of
>> 2012-12-29 on alphaville
>>
>>
>
> AFAIU :session is broken, because Python shell as opened by run-python or
> py-shell isn't used by ob-babel.
> Seems ob-babel sends it's code w/ an own shell command, thus opening a new
> python shell internally every time.
>
> Did :session ever work? Then I might be wrong with this comment.

Not only did it work, it currently works for me. I seem to remember
bad interaction with python modes other than the one shipped with
emacs. In my .emacs I have

;; Python
;; there are several modes. Currently using
https://github.com/fgallina/python.el
;; hopefully oneday a glorious default python mode will be shipped
with emacs and we won't need this anymore.

;; (add-to-list 'load-path "~/.emacs.d/izahn")
;; (require 'python)

;; (setq
;;  python-shell-interpreter "ipython"
;;  python-shell-interpreter-args ""
;;  python-shell-prompt-regexp "In \\[[0-9]+\\]: "
;;  python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: "
;;  python-shell-completion-setup-code
;;    "from IPython.core.completerlib import module_completion"
;;  python-shell-completion-module-string-code
;;    "';'.join(module_completion('''%s'''))\n"
;;  python-shell-completion-string-code
;;    "';'.join(get_ipython().Completer.all_completions('''%s'''))\n")

;; (require 'python-mode) ;;

;; python auto completion
(require 'ac-python)

All the python-mode and ipython mode stuff is commented out partly
because it did not play nice with org-mode. Using the default python
mode works for me. So, for those of you who are finding that this is
not working, what python mode are you using?

Best,
Ista

>
> Andreas
>
>
>

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

* Re: python sessions
  2013-03-20 12:54       ` Ista Zahn
@ 2013-03-20 14:08         ` Nick Dokos
  2013-03-20 14:28           ` Gary Oberbrunner
  2013-03-20 17:21         ` Andreas Röhler
  1 sibling, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2013-03-20 14:08 UTC (permalink / raw)
  To: Ista Zahn; +Cc: emacs-orgmode

Ista Zahn <istazahn@gmail.com> wrote:

> >
> > Did :session ever work? Then I might be wrong with this comment.
> 
> Not only did it work, it currently works for me. I seem to remember
> bad interaction with python modes other than the one shipped with
> emacs. In my .emacs I have
> 
> ...
> 
> All the python-mode and ipython mode stuff is commented out partly
> because it did not play nice with org-mode. Using the default python
> mode works for me. So, for those of you who are finding that this is
> not working, what python mode are you using?
> 

The one distributed with emacs 24.3.50 (at least afaict: I don't think
I'm doing twisted things but you never know :-) ).

Question for you: what version of org mode?

Nick

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

* Re: python sessions
  2013-03-20 14:08         ` Nick Dokos
@ 2013-03-20 14:28           ` Gary Oberbrunner
  0 siblings, 0 replies; 217+ messages in thread
From: Gary Oberbrunner @ 2013-03-20 14:28 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Orgmode Mailing List, Ista Zahn

[-- Attachment #1: Type: text/plain, Size: 1309 bytes --]

I am using a snapshot build of Emacs:
emacs-trunk-r112044-20130314-w32-i386.zip, which says it is GNU Emacs
24.3.50.1 (i386-mingw-nt6.1.7601) of 2013-03-14 on VBOX
on Windows 7/64.

My python-mode comes from the python.el shipped with the above emacs, which
says it is Version: 0.24.2.

Org-mode is from git trunk:
 commit 3842b073c332256ebfeecb0b01f859bb720cb68f
 Author: Bastien Guerry <bzg@altern.org>
 Date:   Mon Mar 18 20:36:46 2013 +0100



On Wed, Mar 20, 2013 at 10:08 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> Ista Zahn <istazahn@gmail.com> wrote:
>
> > >
> > > Did :session ever work? Then I might be wrong with this comment.
> >
> > Not only did it work, it currently works for me. I seem to remember
> > bad interaction with python modes other than the one shipped with
> > emacs. In my .emacs I have
> >
> > ...
> >
> > All the python-mode and ipython mode stuff is commented out partly
> > because it did not play nice with org-mode. Using the default python
> > mode works for me. So, for those of you who are finding that this is
> > not working, what python mode are you using?
> >
>
> The one distributed with emacs 24.3.50 (at least afaict: I don't think
> I'm doing twisted things but you never know :-) ).
>
> Question for you: what version of org mode?
>
> Nick
>
>
>


-- 
Gary

[-- Attachment #2: Type: text/html, Size: 2123 bytes --]

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

* Re: python sessions
  2013-03-20  7:08   ` Andreas Röhler
@ 2013-03-20 15:38     ` John Hendy
  2013-03-20 15:42       ` John Hendy
                         ` (2 more replies)
  0 siblings, 3 replies; 217+ messages in thread
From: John Hendy @ 2013-03-20 15:38 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: emacs-orgmode

On Wed, Mar 20, 2013 at 2:08 AM, Andreas Röhler
<andreas.roehler@easy-emacs.de> wrote:
> Am 20.03.2013 01:04, schrieb John Hendy:
>
>> On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner <garyo@oberbrunner.com>
>> wrote:
>>>
>>> I must be failing to understand something.  I'm running Emacs 24.3 on
>>> Windows, with latest trunk org-mode.  I can't get python functions to
>>> persist across blocks in session mode.  Here's my foo.org:

<snip>

>> You should probably post your babel configuration from .emacs. This
>> works for me (mostly). I'm using python 3.3
>
>
> Hi John,
>
> let's point out though that matter is not at stake.
> As the OP got output, system Python must be a 2...
>

True, which is why I clarified my version. The foo() command still
worked for me; I simply had issues due to print() syntax changes
between 2 -> 3. So... I've tried to eliminate this and retried today
with the following process (note setting the python command to
"python2"):

- Start emacs with `emacs -q`

- M-x load-file ~/Desktop/minimal-config

#+begin_src minimal-config

;; load path
(add-to-list 'load-path "~/.elisp/org.git/lisp/")

;; setup babel languages
(org-babel-do-load-languages
 'org-babel-load-languages
 '((python .t )))
(setq org-babel-python-command "python2")

#+end_src

- For reference
$ python2 --version
Python 2.7.3

On first I get a syntax error executing the first block:

#+RESULTS:
: first
: ... ... ...   File "<stdin>", line 4
:     print "end first"
:         ^
: SyntaxError: invalid syntax

On a whim, I simply inserted a newline, and it worked. Here is the
full file with my executed results (C-c C-c on each block):

#+begin_src orgmode file

* My Document

The first block says:
#+BEGIN_SRC python :exports results :results output :session *PyFoo*
print "first"
def foo(x):
  print "In foo(%s)"%x
  return x+1

print "end first"
#+END_SRC

#+RESULTS:
: first
: ... ... ... >>> end first

The result is:
#+BEGIN_SRC python :exports results :results output :session *PyFoo*
print "hello"
print foo(100)
print "bye"
#+END_SRC

#+RESULTS:
: hello
: In foo(100)
: 101
: bye

#+end_src orgmode file

*Note:* I do not get a *PyFoo* session, only a *Python* buffer. When I
got to kill emacs, here is the session info asking me if I want to
kill the running buffer process:

Python		run	*Python*	/dev/pts/2   python2 -i -c import sys; sys.path.remove('')


So, seems to work for me. This is on Arch Linux:

- uname -a
Linux hostname 3.8.3-2-ARCH #1 SMP PREEMPT Sun Mar 17 13:04:22 CET
2013 x86_64 GNU/Linux

- emacs --version
GNU Emacs 24.2.1

- M-x org-version
Org-mode version 8.0-pre (release_8.0-pre-146-g73fe0a @
/home/jwhendy/.elisp/org.git/lisp/)


Best regards,
John


> Best,
>
> Andreas
>

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

* Re: python sessions
  2013-03-20 15:38     ` John Hendy
@ 2013-03-20 15:42       ` John Hendy
  2013-03-20 16:06       ` Nick Dokos
       [not found]       ` <CAFChFygPrhuHHyMo2Vk2_OdksWVB=oACA7jnOXN+itUNqh-nqw@mail.gmail.com>
  2 siblings, 0 replies; 217+ messages in thread
From: John Hendy @ 2013-03-20 15:42 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: emacs-orgmode

On Wed, Mar 20, 2013 at 10:38 AM, John Hendy <jw.hendy@gmail.com> wrote:

<snip>

> I've tried to eliminate this and retried today
> with the following process (note setting the python command to
> "python2"):
>
> - Start emacs with `emacs -q`
>

Just caught this... I used -q accidentally instead of -Q. Re-did with
-Q and get same results (successful block execution).


John

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

* Re: python sessions
  2013-03-20 15:38     ` John Hendy
  2013-03-20 15:42       ` John Hendy
@ 2013-03-20 16:06       ` Nick Dokos
       [not found]         ` <CAFChFygsUeBejEY6m2bSU0C5cjLYz0nUADH=s+BYxajfZ2sKKQ@mail.gmail.com>
  2013-03-20 17:08         ` Andreas Röhler
       [not found]       ` <CAFChFygPrhuHHyMo2Vk2_OdksWVB=oACA7jnOXN+itUNqh-nqw@mail.gmail.com>
  2 siblings, 2 replies; 217+ messages in thread
From: Nick Dokos @ 2013-03-20 16:06 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

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

> 
> - M-x org-version
> Org-mode version 8.0-pre (release_8.0-pre-146-g73fe0a @
> /home/jwhendy/.elisp/org.git/lisp/)
> 
> 

That's pretty close to what I'm using. Can you do me a favor: start
emacs -Q and evaluate the variable org-babel-python-buffers before and
after executing a python block with a :session argument and post
the results?

Thanks,
Nick

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

* Fwd:  python sessions
       [not found]         ` <CAFChFygsUeBejEY6m2bSU0C5cjLYz0nUADH=s+BYxajfZ2sKKQ@mail.gmail.com>
@ 2013-03-20 16:12           ` Gary Oberbrunner
  0 siblings, 0 replies; 217+ messages in thread
From: Gary Oberbrunner @ 2013-03-20 16:12 UTC (permalink / raw)
  To: Orgmode Mailing List

[-- Attachment #1: Type: text/plain, Size: 1037 bytes --]

[sorry, forgot to reply all]

---------- Forwarded message ----------
From: Gary Oberbrunner <garyo@oberbrunner.com>
Date: Wed, Mar 20, 2013 at 12:11 PM
Subject: Re: [O] python sessions
To: nicholas.dokos@hp.com


After starting emacs -Q and loading my minimal setup (including require
'org):
 ((:default))
After loading the .org file and doing nothing else, it's the same.
After evaling one code block:
 ((*PyFoo*) (:default))

But note that there is no buffer named *PyFoo* (there is one named
*Python*).



On Wed, Mar 20, 2013 at 12:06 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> John Hendy <jw.hendy@gmail.com> wrote:
>
> >
> > - M-x org-version
> > Org-mode version 8.0-pre (release_8.0-pre-146-g73fe0a @
> > /home/jwhendy/.elisp/org.git/lisp/)
> >
> >
>
> That's pretty close to what I'm using. Can you do me a favor: start
> emacs -Q and evaluate the variable org-babel-python-buffers before and
> after executing a python block with a :session argument and post
> the results?
>
> Thanks,
> Nick
>
>


-- 
Gary



-- 
Gary

[-- Attachment #2: Type: text/html, Size: 1975 bytes --]

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

* Re: python sessions
  2013-03-20 16:06       ` Nick Dokos
       [not found]         ` <CAFChFygsUeBejEY6m2bSU0C5cjLYz0nUADH=s+BYxajfZ2sKKQ@mail.gmail.com>
@ 2013-03-20 17:08         ` Andreas Röhler
  2013-03-20 17:25           ` Nick Dokos
  1 sibling, 1 reply; 217+ messages in thread
From: Andreas Röhler @ 2013-03-20 17:08 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

Am 20.03.2013 17:06, schrieb Nick Dokos:
> John Hendy <jw.hendy@gmail.com> wrote:
>
>>
>> - M-x org-version
>> Org-mode version 8.0-pre (release_8.0-pre-146-g73fe0a @
>> /home/jwhendy/.elisp/org.git/lisp/)
>>
>>
>
> That's pretty close to what I'm using. Can you do me a favor: start
> emacs -Q and evaluate the variable org-babel-python-buffers before and
> after executing a python block with a :session argument and post
> the results?
>
> Thanks,
> Nick
>

Hi,

started from Emacs -Q checking the example given.

Seems `org-babel-execute':python doesn't get the session flag.

Edebug: org-babel-execute:python
org-babel-execute:python
executing Python code block...
  [4 times]
Result: ((:comments . #1="") (:shebang . #1#) (:cache . "no") (:padline . #1#) (:noweb . "no") (:tangle . "no") (:exports . "results") (:results . "replace output") 
(:hlines . "no") (:padnewline . "yes") (:session) (:result-type . output) (:result-params "output" "replace") (:rowname-names) (:colname-names))

Result: (:session)

Result: nil

HTH,

Andreas

Emacs  : GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.14)
  of 2013-03-05
Package: Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef...)

current state:
==============
(setq
  org-export-blocks '((src org-babel-exp-src-block nil)
		     (export-comment org-export-blocks-format-comment t)
		     (ditaa org-export-blocks-format-ditaa nil)
		     (dot org-export-blocks-format-dot nil))
  org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
			  org-babel-execute-safely-maybe)
  org-export-preprocess-before-selecting-backend-code-hook '(org-beamer-select-beamer-code)
  org-tab-first-hook '(org-hide-block-toggle-maybe
		      org-src-native-tab-command-maybe
		      org-babel-hide-result-toggle-maybe
		      org-babel-header-arg-expand)
  org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
		  org-cycle-show-empty-lines
		  org-optimize-window-after-visibility-change)
  org-agenda-before-write-hook '(org-agenda-add-entry-text)
  org-speed-command-hook '(org-speed-command-default-hook
			  org-babel-speed-command-hook)
  org-babel-pre-tangle-hook '(save-buffer)
  org-occur-hook '(org-first-headline-recenter)
  org-export-interblocks '((src org-babel-exp-non-block-elements))
  org-metaup-hook '(org-babel-load-in-session-maybe)
  org-confirm-elisp-link-function 'yes-or-no-p
  org-export-latex-format-toc-function 'org-export-latex-format-toc-default
  org-export-preprocess-before-normalizing-links-hook '(org-remove-file-link-modifiers)
  org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
  org-export-first-hook '(org-beamer-initialize-open-trackers)
  org-mode-hook '(#[nil "\300\301\302\303\304$\207"
		   [org-add-hook change-major-mode-hook org-show-block-all
		    append local]
		   5]
		 #[nil "\300\301\302\303\304$\207"
		   [org-add-hook change-major-mode-hook
		    org-babel-show-result-all append local]
		   5]
		 org-babel-result-hide-spec org-babel-hide-all-hashes)
  org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc
			       org-beamer-auto-fragile-frames
			       org-beamer-place-default-actions-for-lists)
  org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
  org-metadown-hook '(org-babel-pop-to-session-maybe)
  org-src-mode-hook '(org-src-babel-configure-edit-buffer
		     org-src-mode-configure-edit-buffer)
  org-after-todo-state-change-hook '(org-clock-out-if-current)
  org-babel-tangle-lang-exts '(("python" . "py") ("emacs-lisp" . "el"))
  org-babel-load-languages '((sh . t) (python . t))
  org-confirm-shell-link-function 'yes-or-no-p
  )

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

* Re: python sessions
  2013-03-20 12:54       ` Ista Zahn
  2013-03-20 14:08         ` Nick Dokos
@ 2013-03-20 17:21         ` Andreas Röhler
  1 sibling, 0 replies; 217+ messages in thread
From: Andreas Röhler @ 2013-03-20 17:21 UTC (permalink / raw)
  To: Ista Zahn; +Cc: emacs-orgmode

[ ... ]
>> AFAIU :session is broken, because Python shell as opened by run-python or
>> py-shell isn't used by ob-babel.
>> Seems ob-babel sends it's code w/ an own shell command, thus opening a new
>> python shell internally every time.
>>
>> Did :session ever work? Then I might be wrong with this comment.
>
> Not only did it work, it currently works for me.


That's good news, so it might be fixed soon.

I seem to remember
> bad interaction with python modes other than the one shipped with
> emacs.

Shipping should not affect the code ;)
Well, if you feel disturbed by python-mode.el,
please file a bug-report at

https://bugs.launchpad.net/python-mode

python-mode.el prepares some keys and fontifying differently
but should not touch python.el commands.

In case it does, probably should change that...

Andreas

[ ... ]

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

* Re: python sessions
  2013-03-20 17:08         ` Andreas Röhler
@ 2013-03-20 17:25           ` Nick Dokos
  2013-03-20 17:54             ` John Hendy
  2013-03-20 19:01             ` Andreas Röhler
  0 siblings, 2 replies; 217+ messages in thread
From: Nick Dokos @ 2013-03-20 17:25 UTC (permalink / raw)
  To: =?ISO-8859-15?Q?Andreas_R=F6hler?=; +Cc: emacs-orgmode

Andreas Röhler <andreas.roehler@easy-emacs.de> wrote:

> Seems `org-babel-execute':python doesn't get the session flag.
> 
> Edebug: org-babel-execute:python
> org-babel-execute:python
> executing Python code block...
>  [4 times]
> Result: ((:comments . #1="") (:shebang . #1#) (:cache . "no")
> (:padline . #1#) (:noweb . "no") (:tangle . "no") (:exports
> . "results") (:results . "replace output") (:hlines . "no")
> (:padnewline . "yes") (:session) (:result-type . output)

Sure it does:           ^^^^^^^^^^

What it does with it is another matter however. Am I missing something?

Nick

> (:result-params "output" "replace") (:rowname-names) (:colname-names))
> 
> Result: (:session)
> 
> Result: nil
> 

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

* Re: python sessions
  2013-03-20 17:25           ` Nick Dokos
@ 2013-03-20 17:54             ` John Hendy
  2013-03-20 18:15               ` Nick Dokos
  2013-03-20 19:01             ` Andreas Röhler
  1 sibling, 1 reply; 217+ messages in thread
From: John Hendy @ 2013-03-20 17:54 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

On Wed, Mar 20, 2013 at 12:25 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> Andreas Röhler <andreas.roehler@easy-emacs.de> wrote:
>
>> Seems `org-babel-execute':python doesn't get the session flag.
>>
>> Edebug: org-babel-execute:python
>> org-babel-execute:python
>> executing Python code block...
>>  [4 times]
>> Result: ((:comments . #1="") (:shebang . #1#) (:cache . "no")
>> (:padline . #1#) (:noweb . "no") (:tangle . "no") (:exports
>> . "results") (:results . "replace output") (:hlines . "no")
>> (:padnewline . "yes") (:session) (:result-type . output)
>
> Sure it does:           ^^^^^^^^^^
>
> What it does with it is another matter however. Am I missing something?

I was thinking the concern was over not having the session named
properly, but might be wrong (Andreas could confirm).

I've not used python prior to this, but I use R almost daily in Org
and if I do #+begin_src R :session R, I get a buffer actually named
=R=. In this case, I expected the buffer name would be *PyFoo*.
Checking if it was an issue with asterisks, I used =:session py= and
still just get the default *Python* buffer created.


John

>
> Nick
>
>> (:result-params "output" "replace") (:rowname-names) (:colname-names))
>>
>> Result: (:session)
>>
>> Result: nil
>>
>

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

* Re: python sessions
  2013-03-20 17:54             ` John Hendy
@ 2013-03-20 18:15               ` Nick Dokos
  2013-03-20 18:32                 ` Ista Zahn
  2013-03-20 18:42                 ` Andreas Röhler
  0 siblings, 2 replies; 217+ messages in thread
From: Nick Dokos @ 2013-03-20 18:15 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

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

> On Wed, Mar 20, 2013 at 12:25 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> > Andreas Röhler <andreas.roehler@easy-emacs.de> wrote:
> >
> >> Seems `org-babel-execute':python doesn't get the session flag.
> >>
> >> Edebug: org-babel-execute:python
> >> org-babel-execute:python
> >> executing Python code block...
> >>  [4 times]
> >> Result: ((:comments . #1="") (:shebang . #1#) (:cache . "no")
> >> (:padline . #1#) (:noweb . "no") (:tangle . "no") (:exports
> >> . "results") (:results . "replace output") (:hlines . "no")
> >> (:padnewline . "yes") (:session) (:result-type . output)
> >
> > Sure it does:           ^^^^^^^^^^
> >
> > What it does with it is another matter however. Am I missing something?
> 
> I was thinking the concern was over not having the session named
> properly, but might be wrong (Andreas could confirm).
> 

I guessed Andreas tried with an unnamed session (but I agree it would be
best if he confirms): afaics, if I use a session name, it's passed
correctly in the params argument of org-babel-execute:python as
(:session . "foo"), but in the later processing,
org-babel-python-buffers is not set correctly.

> I've not used python prior to this, but I use R almost daily in Org
> and if I do #+begin_src R :session R, I get a buffer actually named
> =R=. In this case, I expected the buffer name would be *PyFoo*.
> Checking if it was an issue with asterisks, I used =:session py= and
> still just get the default *Python* buffer created.
> 

Yes, I think it's ob-python's problem: but as I said before, I don't
understand why it works for you (and Ista Zahn).

Nick

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

* Re: python sessions
  2013-03-20 18:15               ` Nick Dokos
@ 2013-03-20 18:32                 ` Ista Zahn
  2013-03-20 18:39                   ` Nick Dokos
  2013-03-20 18:43                   ` Andreas Röhler
  2013-03-20 18:42                 ` Andreas Röhler
  1 sibling, 2 replies; 217+ messages in thread
From: Ista Zahn @ 2013-03-20 18:32 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

On Wed, Mar 20, 2013 at 2:15 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> John Hendy <jw.hendy@gmail.com> wrote:
>
>> On Wed, Mar 20, 2013 at 12:25 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>> > Andreas Röhler <andreas.roehler@easy-emacs.de> wrote:
>> >
>> >> Seems `org-babel-execute':python doesn't get the session flag.
>> >>
>> >> Edebug: org-babel-execute:python
>> >> org-babel-execute:python
>> >> executing Python code block...
>> >>  [4 times]
>> >> Result: ((:comments . #1="") (:shebang . #1#) (:cache . "no")
>> >> (:padline . #1#) (:noweb . "no") (:tangle . "no") (:exports
>> >> . "results") (:results . "replace output") (:hlines . "no")
>> >> (:padnewline . "yes") (:session) (:result-type . output)
>> >
>> > Sure it does:           ^^^^^^^^^^
>> >
>> > What it does with it is another matter however. Am I missing something?
>>
>> I was thinking the concern was over not having the session named
>> properly, but might be wrong (Andreas could confirm).
>>
>
> I guessed Andreas tried with an unnamed session (but I agree it would be
> best if he confirms): afaics, if I use a session name, it's passed
> correctly in the params argument of org-babel-execute:python as
> (:session . "foo"), but in the later processing,
> org-babel-python-buffers is not set correctly.
>
>> I've not used python prior to this, but I use R almost daily in Org
>> and if I do #+begin_src R :session R, I get a buffer actually named
>> =R=. In this case, I expected the buffer name would be *PyFoo*.
>> Checking if it was an issue with asterisks, I used =:session py= and
>> still just get the default *Python* buffer created.
>>
>
> Yes, I think it's ob-python's problem: but as I said before, I don't
> understand why it works for you (and Ista Zahn).

I guess it depends on the definition of "works". I don't get python
buffers with the name of the :session variable. But I do get separate
python buffers (.e.g., *Python*, *Python*<2>) for each session, and
python blocks get executed in the right python process. To me that
equals "works", but if the issue is that the buffers don't get named
with the value of :session then no, that doesn't work for me either.

Best,
Ista

>
> Nick
>
>
>

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

* Re: python sessions
  2013-03-20 18:32                 ` Ista Zahn
@ 2013-03-20 18:39                   ` Nick Dokos
  2013-03-20 18:43                   ` Andreas Röhler
  1 sibling, 0 replies; 217+ messages in thread
From: Nick Dokos @ 2013-03-20 18:39 UTC (permalink / raw)
  To: Ista Zahn; +Cc: emacs-orgmode

Ista Zahn <istazahn@gmail.com> wrote:

> > Yes, I think it's ob-python's problem: but as I said before, I don't
> > understand why it works for you (and Ista Zahn).
> 
> I guess it depends on the definition of "works". I don't get python
> buffers with the name of the :session variable. But I do get separate
> python buffers (.e.g., *Python*, *Python*<2>) for each session, and
> python blocks get executed in the right python process. To me that
> equals "works", but if the issue is that the buffers don't get named
> with the value of :session then no, that doesn't work for me either.
> 

For me, it does not work at all: I don't get python buffers, period
(forget about what they are named :-) )

Nick

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

* Re: python sessions
  2013-03-20 18:15               ` Nick Dokos
  2013-03-20 18:32                 ` Ista Zahn
@ 2013-03-20 18:42                 ` Andreas Röhler
  1 sibling, 0 replies; 217+ messages in thread
From: Andreas Röhler @ 2013-03-20 18:42 UTC (permalink / raw)
  To: emacs-orgmode

Am 20.03.2013 19:15, schrieb Nick Dokos:
> John Hendy <jw.hendy@gmail.com> wrote:
>
>> On Wed, Mar 20, 2013 at 12:25 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>>> Andreas Röhler <andreas.roehler@easy-emacs.de> wrote:
>>>
>>>> Seems `org-babel-execute':python doesn't get the session flag.
>>>>
>>>> Edebug: org-babel-execute:python
>>>> org-babel-execute:python
>>>> executing Python code block...
>>>>   [4 times]
>>>> Result: ((:comments . #1="") (:shebang . #1#) (:cache . "no")
>>>> (:padline . #1#) (:noweb . "no") (:tangle . "no") (:exports
>>>> . "results") (:results . "replace output") (:hlines . "no")
>>>> (:padnewline . "yes") (:session) (:result-type . output)
>>>
>>> Sure it does:           ^^^^^^^^^^
>>>
>>> What it does with it is another matter however. Am I missing something?
>>
>> I was thinking the concern was over not having the session named
>> properly, but might be wrong (Andreas could confirm).
>>
>
> I guessed Andreas tried with an unnamed session

yes, tried the example given,
ah, see misinterpreted the spot,
thanks,

Andreas

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

* Re: python sessions
  2013-03-20 18:32                 ` Ista Zahn
  2013-03-20 18:39                   ` Nick Dokos
@ 2013-03-20 18:43                   ` Andreas Röhler
  2013-03-20 19:42                     ` Ista Zahn
  1 sibling, 1 reply; 217+ messages in thread
From: Andreas Röhler @ 2013-03-20 18:43 UTC (permalink / raw)
  To: emacs-orgmode


> I guess it depends on the definition of "works". I don't get python
> buffers with the name of the :session variable.

Reads as it works only with named sessions, but fails with unnamed

  But I do get separate
> python buffers (.e.g., *Python*, *Python*<2>) for each session, and
> python blocks get executed in the right python process. To me that
> equals "works", but if the issue is that the buffers don't get named
> with the value of :session then no, that doesn't work for me either.
>
> Best,
> Ista
>
>>
>> Nick
>>
>>
>>
>
>

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

* Re: python sessions
  2013-03-20 17:25           ` Nick Dokos
  2013-03-20 17:54             ` John Hendy
@ 2013-03-20 19:01             ` Andreas Röhler
  1 sibling, 0 replies; 217+ messages in thread
From: Andreas Röhler @ 2013-03-20 19:01 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

Am 20.03.2013 18:25, schrieb Nick Dokos:
> Andreas Röhler <andreas.roehler@easy-emacs.de> wrote:
>
>> Seems `org-babel-execute':python doesn't get the session flag.
>>
>> Edebug: org-babel-execute:python
>> org-babel-execute:python
>> executing Python code block...
>>   [4 times]
>> Result: ((:comments . #1="") (:shebang . #1#) (:cache . "no")
>> (:padline . #1#) (:noweb . "no") (:tangle . "no") (:exports
>> . "results") (:results . "replace output") (:hlines . "no")
>> (:padnewline . "yes") (:session) (:result-type . output)
>
> Sure it does:           ^^^^^^^^^^
>
> What it does with it is another matter however. Am I missing something?
>
> Nick
>
>> (:result-params "output" "replace") (:rowname-names) (:colname-names))
>>
>> Result: (:session)
>>
>> Result: nil
>>
>

At least for unnamed session it's set to nil here

let* ((session (org-babel-python-initiate-session...

later on it takes the wrong route:

(defun org-babel-python-evaluate
   (session body &optional result-type result-params preamble)
   "Evaluate BODY as Python code."
   (if session
       (org-babel-python-evaluate-session
        session body result-type result-params)
     (org-babel-python-evaluate-external-process
      body result-type result-params preamble)))

Best,

Andreas

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

* Re: python sessions
  2013-03-20 18:43                   ` Andreas Röhler
@ 2013-03-20 19:42                     ` Ista Zahn
  2013-03-20 19:53                       ` Andreas Röhler
  0 siblings, 1 reply; 217+ messages in thread
From: Ista Zahn @ 2013-03-20 19:42 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: emacs-orgmode

On Wed, Mar 20, 2013 at 2:43 PM, Andreas Röhler
<andreas.roehler@easy-emacs.de> wrote:
>
>> I guess it depends on the definition of "works". I don't get python
>> buffers with the name of the :session variable.
>
>
> Reads as it works only with named sessions, but fails with unnamed

It fails to name the python process buffers. Everything else works as
expected. Consider this example:

8<---------cut here------------8<
#+BEGIN_SRC python :exports results :results output :session *foo*
  def foo(x):
    return(x+1)

#+END_SRC

#+RESULTS:


#+BEGIN_SRC python :exports results :results output :session *bar*
  def bar(x):
    return(x+2)

#+END_SRC

#+RESULTS:

#+BEGIN_SRC python :exports results :results output :session *foo*
  print(foo(100))
  print(bar(100))

#+END_SRC

#+RESULTS:
: 101
: Traceback (most recent call last):
:   File "<stdin>", line 1, in <module>
: NameError: name 'bar' is not defined

#+BEGIN_SRC python :exports results :results output :session *bar*
  print(foo(100))
  print(bar(100))

#+END_SRC

#+RESULTS:
: Traceback (most recent call last):
:   File "<stdin>", line 1, in <module>
: NameError: name 'foo' is not defined
: 102

8<---------cut here------------8<

the foo function exists when I use :session foo (and not with :session
bar), and the bar function exists when I uses :session bar (and not
with :session foo). That equals "works" in my book. The only thing
that doesn't "work" is that I have buffers

. * tmp.org               1657  Org		  ~/Desktop/tmp.org
  * *Python*<2>            332  Inferior Python:
  * *Python*               332  Inferior Python:

instead of

. * tmp.org               1657  Org		  ~/Desktop/tmp.org
  * *foo*                  332  Inferior Python:
  * *bar*                  332  Inferior Python:

This is with GNU Emacs 24.2.1 and Org-mode version 8.0-pre
(release_8.0-pre-54-gb5a853

Best,
Ista

>
>
>  But I do get separate
>>
>> python buffers (.e.g., *Python*, *Python*<2>) for each session, and
>> python blocks get executed in the right python process. To me that
>> equals "works", but if the issue is that the buffers don't get named
>> with the value of :session then no, that doesn't work for me either.
>>
>> Best,
>> Ista
>>
>>>
>>> Nick
>>>
>>>
>>>
>>
>>
>
>

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

* Re: python sessions
  2013-03-20 19:42                     ` Ista Zahn
@ 2013-03-20 19:53                       ` Andreas Röhler
  2013-03-20 20:12                         ` Ista Zahn
  0 siblings, 1 reply; 217+ messages in thread
From: Andreas Röhler @ 2013-03-20 19:53 UTC (permalink / raw)
  To: Ista Zahn; +Cc: emacs-orgmode

Am 20.03.2013 20:42, schrieb Ista Zahn:
> On Wed, Mar 20, 2013 at 2:43 PM, Andreas Röhler
> <andreas.roehler@easy-emacs.de> wrote:
>>
>>> I guess it depends on the definition of "works". I don't get python
>>> buffers with the name of the :session variable.
>>
>>
>> Reads as it works only with named sessions, but fails with unnamed
>
> It fails to name the python process buffers.

May you try still an unnamed session as sent by OP?

Andreas

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

* Re: python sessions
  2013-03-20 19:53                       ` Andreas Röhler
@ 2013-03-20 20:12                         ` Ista Zahn
  2013-03-20 20:25                           ` Gary Oberbrunner
  0 siblings, 1 reply; 217+ messages in thread
From: Ista Zahn @ 2013-03-20 20:12 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: emacs-orgmode

On Wed, Mar 20, 2013 at 3:53 PM, Andreas Röhler
<andreas.roehler@easy-emacs.de> wrote:
> Am 20.03.2013 20:42, schrieb Ista Zahn:
>
>> On Wed, Mar 20, 2013 at 2:43 PM, Andreas Röhler
>> <andreas.roehler@easy-emacs.de> wrote:
>>>
>>>
>>>> I guess it depends on the definition of "works". I don't get python
>>>> buffers with the name of the :session variable.
>>>
>>>
>>>
>>> Reads as it works only with named sessions, but fails with unnamed

Oops, sorry I totally misread this before. I guess my last email
didn't make much sense!

>>
>>
>> It fails to name the python process buffers.
>
>
> May you try still an unnamed session as sent by OP?

Unnamed sessions works as expected:


#+BEGIN_SRC python :exports results :results output :session
  def foo(x):
    return(x+1)

#+END_SRC

#+RESULTS:


#+BEGIN_SRC python :exports results :results output :session
  def bar(x):
    return(x+2)

#+END_SRC

#+RESULTS:

#+BEGIN_SRC python :exports results :results output :session
  print(foo(100))
  print(bar(100))

#+END_SRC

#+RESULTS:
: 101
: 102


>
> Andreas
>

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

* Re: python sessions
  2013-03-20 20:12                         ` Ista Zahn
@ 2013-03-20 20:25                           ` Gary Oberbrunner
  2013-03-20 22:06                             ` Ista Zahn
  0 siblings, 1 reply; 217+ messages in thread
From: Gary Oberbrunner @ 2013-03-20 20:25 UTC (permalink / raw)
  To: Ista Zahn; +Cc: Orgmode Mailing List

[-- Attachment #1: Type: text/plain, Size: 1412 bytes --]

Ista, what OS are you on?  Maybe this (or part of it anyway) is only a
Windows problem?


On Wed, Mar 20, 2013 at 4:12 PM, Ista Zahn <istazahn@gmail.com> wrote:

> On Wed, Mar 20, 2013 at 3:53 PM, Andreas Röhler
> <andreas.roehler@easy-emacs.de> wrote:
> > Am 20.03.2013 20:42, schrieb Ista Zahn:
> >
> >> On Wed, Mar 20, 2013 at 2:43 PM, Andreas Röhler
> >> <andreas.roehler@easy-emacs.de> wrote:
> >>>
> >>>
> >>>> I guess it depends on the definition of "works". I don't get python
> >>>> buffers with the name of the :session variable.
> >>>
> >>>
> >>>
> >>> Reads as it works only with named sessions, but fails with unnamed
>
> Oops, sorry I totally misread this before. I guess my last email
> didn't make much sense!
>
> >>
> >>
> >> It fails to name the python process buffers.
> >
> >
> > May you try still an unnamed session as sent by OP?
>
> Unnamed sessions works as expected:
>
>
> #+BEGIN_SRC python :exports results :results output :session
>   def foo(x):
>     return(x+1)
>
> #+END_SRC
>
> #+RESULTS:
>
>
> #+BEGIN_SRC python :exports results :results output :session
>   def bar(x):
>     return(x+2)
>
> #+END_SRC
>
> #+RESULTS:
>
> #+BEGIN_SRC python :exports results :results output :session
>   print(foo(100))
>   print(bar(100))
>
> #+END_SRC
>
> #+RESULTS:
> : 101
> : 102
>
>
> >
> > Andreas
> >
>
>


-- 
Gary

[-- Attachment #2: Type: text/html, Size: 2263 bytes --]

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

* Re: python sessions
  2013-03-20 20:25                           ` Gary Oberbrunner
@ 2013-03-20 22:06                             ` Ista Zahn
  0 siblings, 0 replies; 217+ messages in thread
From: Ista Zahn @ 2013-03-20 22:06 UTC (permalink / raw)
  To: Gary Oberbrunner; +Cc: Orgmode Mailing List

On Wed, Mar 20, 2013 at 4:25 PM, Gary Oberbrunner <garyo@oberbrunner.com> wrote:
> Ista, what OS are you on?  Maybe this (or part of it anyway) is only a
> Windows problem?

Maybe -- I'm on Arch Linux.

>
>
> On Wed, Mar 20, 2013 at 4:12 PM, Ista Zahn <istazahn@gmail.com> wrote:
>>
>> On Wed, Mar 20, 2013 at 3:53 PM, Andreas Röhler
>> <andreas.roehler@easy-emacs.de> wrote:
>> > Am 20.03.2013 20:42, schrieb Ista Zahn:
>> >
>> >> On Wed, Mar 20, 2013 at 2:43 PM, Andreas Röhler
>> >> <andreas.roehler@easy-emacs.de> wrote:
>> >>>
>> >>>
>> >>>> I guess it depends on the definition of "works". I don't get python
>> >>>> buffers with the name of the :session variable.
>> >>>
>> >>>
>> >>>
>> >>> Reads as it works only with named sessions, but fails with unnamed
>>
>> Oops, sorry I totally misread this before. I guess my last email
>> didn't make much sense!
>>
>> >>
>> >>
>> >> It fails to name the python process buffers.
>> >
>> >
>> > May you try still an unnamed session as sent by OP?
>>
>> Unnamed sessions works as expected:
>>
>>
>> #+BEGIN_SRC python :exports results :results output :session
>>   def foo(x):
>>     return(x+1)
>>
>> #+END_SRC
>>
>> #+RESULTS:
>>
>>
>> #+BEGIN_SRC python :exports results :results output :session
>>   def bar(x):
>>     return(x+2)
>>
>> #+END_SRC
>>
>> #+RESULTS:
>>
>> #+BEGIN_SRC python :exports results :results output :session
>>   print(foo(100))
>>   print(bar(100))
>>
>> #+END_SRC
>>
>> #+RESULTS:
>> : 101
>> : 102
>>
>>
>> >
>> > Andreas
>> >
>>
>
>
>
> --
> Gary

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

* Re: python sessions
       [not found]           ` <CAFChFyhbeXE4HNLKA6Ubii+MtQwD7=4khAypa+--coZrQiJekA@mail.gmail.com>
@ 2013-03-21  1:22             ` Gary Oberbrunner
  2013-03-21  1:54               ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: Gary Oberbrunner @ 2013-03-21  1:22 UTC (permalink / raw)
  To: Orgmode Mailing List


[-- Attachment #1.1: Type: text/plain, Size: 907 bytes --]

I've attached a patch which works for me, at least in simple tests.  It
should set the buffer name more correctly in session mode.  I also added a
new defcustom for the python command to use for session mode specifically;
that is required for Windows, and I don't think it hurts on other OSes.


On Wed, Mar 20, 2013 at 8:20 PM, Gary Oberbrunner <garyo@oberbrunner.com>wrote:

>
> On Wed, Mar 20, 2013 at 1:00 PM, John Hendy <jw.hendy@gmail.com> wrote:
>
>> Some other things I noticed when modifying your custom config (just to
>> clarify):
>> - Org-mode git repo is located at "/emacs/site-lisp/org-mode/lisp"?
>> - You shouldn't need (perhaps even as strongly as shouldn't use)
>> =(require 'org)=
>>
>
> Ah, I see -- once I add the proper dir, the proper version of org-mode
> will get autoloaded from there (even with emacs -Q).
>
> But it wouldn't actually hurt, would it?
>
> --
> Gary
>



-- 
Gary

[-- Attachment #1.2: Type: text/html, Size: 1733 bytes --]

[-- Attachment #2: 0001-ob-python-fixes-for-session-mode-buffer-name-and-new.patch --]
[-- Type: application/octet-stream, Size: 2226 bytes --]

From d6496c8af8fc4c264e9ec87ac13d285d145241e2 Mon Sep 17 00:00:00 2001
From: Gary Oberbrunner <garyo@genarts.com>
Date: Wed, 20 Mar 2013 21:13:33 -0400
Subject: [PATCH] ob-python: fixes for session mode, buffer name and new
 python session command

 * Add new variable org-babel-python-session-command for use in session mode.
 * Set python session buffer name correctly.
---
 lisp/ob-python.el | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index 7bc9a1f..7bd7bc4 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -47,6 +47,17 @@
   :group 'org-babel
   :type 'string)
 
+;;; This needs to be python -i for Windows at least,
+;;; since python without -i won't output a prompt, which
+;;; would hang ob-python.
+;;; Shouldn't hurt on other systems.
+(defcustom org-babel-python-session-command "python -i"
+  "Name of the command for executing Python code in session mode."
+  :version "24.4"
+  :package-version '(Org . "8.0")
+  :group 'org-babel
+  :type 'string)
+
 (defcustom org-babel-python-mode
   (if (or (featurep 'xemacs) (featurep 'python-mode)) 'python-mode 'python)
   "Preferred python mode for use in running python interactively.
@@ -169,9 +180,16 @@ then create.  Return the initialized session."
       (cond
        ((and (eq 'python org-babel-python-mode)
 	     (fboundp 'run-python)) ; python.el
-	(if (version< "24.1" emacs-version)
-	    (run-python org-babel-python-command)
-	  (run-python)))
+	;; run-python runs or switches to python in python-shell-buffer-name
+        ;; (with '*'s added at beginning and end)
+	;; so name the buffer after the session, zapping any leading/trailing *s
+	(let ((python-shell-buffer-name
+	       (replace-regexp-in-string ;; zap surrounding *
+		"^\\*\\([^*]+\\)\\*$" "\\1" (symbol-name session))))
+	  (if (version< "24.1" emacs-version)
+	      (run-python org-babel-python-session-command)
+	    (run-python))
+	  (setq python-buffer (concat "*" python-shell-buffer-name "*"))))
        ((and (eq 'python-mode org-babel-python-mode)
 	     (fboundp 'py-shell)) ; python-mode.el
 	;; Make sure that py-which-bufname is initialized, as otherwise
-- 
1.7.11.msysgit.1


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

* Re: python sessions
  2013-03-21  1:22             ` Gary Oberbrunner
@ 2013-03-21  1:54               ` John Hendy
  2013-03-21  1:56                 ` Gary Oberbrunner
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2013-03-21  1:54 UTC (permalink / raw)
  To: Gary Oberbrunner; +Cc: Orgmode Mailing List

On Wed, Mar 20, 2013 at 8:22 PM, Gary Oberbrunner <garyo@oberbrunner.com> wrote:
> I've attached a patch which works for me, at least in simple tests.  It
> should set the buffer name more correctly in session mode.  I also added a
> new defcustom for the python command to use for session mode specifically;
> that is required for Windows, and I don't think it hurts on other OSes.
>

Is this fixing *everything* for you, or just the named sessions? Just
wondering if your original issue is fixed, or if you're still having
issues.

If it was fixed... what was it (out of curiosity)? Sorry... still
haven't rebooted into Windows to see if I can replicate on Windows as
well.


John

>
> On Wed, Mar 20, 2013 at 8:20 PM, Gary Oberbrunner <garyo@oberbrunner.com>
> wrote:
>>
>>
>> On Wed, Mar 20, 2013 at 1:00 PM, John Hendy <jw.hendy@gmail.com> wrote:
>>>
>>> Some other things I noticed when modifying your custom config (just to
>>> clarify):
>>> - Org-mode git repo is located at "/emacs/site-lisp/org-mode/lisp"?
>>> - You shouldn't need (perhaps even as strongly as shouldn't use)
>>> =(require 'org)=
>>
>>
>> Ah, I see -- once I add the proper dir, the proper version of org-mode
>> will get autoloaded from there (even with emacs -Q).
>>
>> But it wouldn't actually hurt, would it?
>>
>> --
>> Gary
>
>
>
>
> --
> Gary

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

* Re: python sessions
  2013-03-21  1:54               ` John Hendy
@ 2013-03-21  1:56                 ` Gary Oberbrunner
  2013-03-21  7:42                   ` Andreas Röhler
  0 siblings, 1 reply; 217+ messages in thread
From: Gary Oberbrunner @ 2013-03-21  1:56 UTC (permalink / raw)
  To: John Hendy; +Cc: Orgmode Mailing List

[-- Attachment #1: Type: text/plain, Size: 1772 bytes --]

Both of the issues in my patch were part of it.  The buffer naming and
using "python -i" in session mode.

And I'm still not sure default (nameless) sessions are working, and also in
my real testcase it still hangs sometimes.  So no, not everything is fine
yet.


On Wed, Mar 20, 2013 at 9:54 PM, John Hendy <jw.hendy@gmail.com> wrote:

> On Wed, Mar 20, 2013 at 8:22 PM, Gary Oberbrunner <garyo@oberbrunner.com>
> wrote:
> > I've attached a patch which works for me, at least in simple tests.  It
> > should set the buffer name more correctly in session mode.  I also added
> a
> > new defcustom for the python command to use for session mode
> specifically;
> > that is required for Windows, and I don't think it hurts on other OSes.
> >
>
> Is this fixing *everything* for you, or just the named sessions? Just
> wondering if your original issue is fixed, or if you're still having
> issues.
>
> If it was fixed... what was it (out of curiosity)? Sorry... still
> haven't rebooted into Windows to see if I can replicate on Windows as
> well.
>
>
> John
>
> >
> > On Wed, Mar 20, 2013 at 8:20 PM, Gary Oberbrunner <garyo@oberbrunner.com
> >
> > wrote:
> >>
> >>
> >> On Wed, Mar 20, 2013 at 1:00 PM, John Hendy <jw.hendy@gmail.com> wrote:
> >>>
> >>> Some other things I noticed when modifying your custom config (just to
> >>> clarify):
> >>> - Org-mode git repo is located at "/emacs/site-lisp/org-mode/lisp"?
> >>> - You shouldn't need (perhaps even as strongly as shouldn't use)
> >>> =(require 'org)=
> >>
> >>
> >> Ah, I see -- once I add the proper dir, the proper version of org-mode
> >> will get autoloaded from there (even with emacs -Q).
> >>
> >> But it wouldn't actually hurt, would it?
> >>
> >> --
> >> Gary
> >
> >
> >
> >
> > --
> > Gary
>



-- 
Gary

[-- Attachment #2: Type: text/html, Size: 2754 bytes --]

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

* Re: python sessions
  2013-03-21  1:56                 ` Gary Oberbrunner
@ 2013-03-21  7:42                   ` Andreas Röhler
  2013-03-21  7:43                     ` Bastien
  0 siblings, 1 reply; 217+ messages in thread
From: Andreas Röhler @ 2013-03-21  7:42 UTC (permalink / raw)
  To: emacs-orgmode

Am 21.03.2013 02:56, schrieb Gary Oberbrunner:

Hi Gary,

great if you can make it work for you.

Nonetheless, still thinking

let-var session in

org-babel-execute:python

needs the fix.

Best,

Andreas

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

* Re: python sessions
  2013-03-21  7:42                   ` Andreas Röhler
@ 2013-03-21  7:43                     ` Bastien
  2013-03-21  8:13                       ` Andreas Röhler
  0 siblings, 1 reply; 217+ messages in thread
From: Bastien @ 2013-03-21  7:43 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: emacs-orgmode

Hi Andreas,

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

> Nonetheless, still thinking
>
> let-var session in
>
> org-babel-execute:python
>
> needs the fix.

I've not been following this thread, can you send a patch with
the fix and the reason for it?  Thanks in advance!

-- 
 Bastien

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

* Re: python sessions
  2013-03-21  7:43                     ` Bastien
@ 2013-03-21  8:13                       ` Andreas Röhler
  2013-03-23 22:07                         ` Eric Schulte
  0 siblings, 1 reply; 217+ messages in thread
From: Andreas Röhler @ 2013-03-21  8:13 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Am 21.03.2013 08:43, schrieb Bastien:
> Hi Andreas,
>
> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>
>> Nonetheless, still thinking
>>
>> let-var session in
>>
>> org-babel-execute:python
>>
>> needs the fix.
>
> I've not been following this thread, can you send a patch with
> the fix and the reason for it?  Thanks in advance!
>

Hi Bastien,

unfortunately my org-environment isn't ready yet for developing.
Might take some time, but I'm on it.
Unless someone else sends that probably trivial patch meanwhile....

Best,

Andreas

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

* Re: python sessions
  2013-03-21  8:13                       ` Andreas Röhler
@ 2013-03-23 22:07                         ` Eric Schulte
  2013-03-24  1:29                           ` John Hendy
  2013-03-24  7:47                           ` Andreas Röhler
  0 siblings, 2 replies; 217+ messages in thread
From: Eric Schulte @ 2013-03-23 22:07 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: Bastien, emacs-orgmode

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

> Am 21.03.2013 08:43, schrieb Bastien:
>> Hi Andreas,
>>
>> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>>
>>> Nonetheless, still thinking
>>>
>>> let-var session in
>>>
>>> org-babel-execute:python
>>>
>>> needs the fix.
>>
>> I've not been following this thread, can you send a patch with
>> the fix and the reason for it?  Thanks in advance!
>>
>
> Hi Bastien,
>
> unfortunately my org-environment isn't ready yet for developing.
> Might take some time, but I'm on it.

I also haven't been following this thread.

Forgetting a patch for the moment, is it possible to conclusively state
that there is or isn't a bug in the current ob-python handling and
naming of sessions?  If there is, is there a recipe for reproducing this
bug?

Thanks,

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

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

* Re: python sessions
  2013-03-23 22:07                         ` Eric Schulte
@ 2013-03-24  1:29                           ` John Hendy
  2013-03-24 22:59                             ` Eric Schulte
  2013-03-24  7:47                           ` Andreas Röhler
  1 sibling, 1 reply; 217+ messages in thread
From: John Hendy @ 2013-03-24  1:29 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Bastien, emacs-orgmode

On Sat, Mar 23, 2013 at 5:07 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>
>> Am 21.03.2013 08:43, schrieb Bastien:
>>> Hi Andreas,
>>>
>>> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>>>
>>>> Nonetheless, still thinking
>>>>
>>>> let-var session in
>>>>
>>>> org-babel-execute:python
>>>>
>>>> needs the fix.
>>>
>>> I've not been following this thread, can you send a patch with
>>> the fix and the reason for it?  Thanks in advance!
>>>
>>
>> Hi Bastien,
>>
>> unfortunately my org-environment isn't ready yet for developing.
>> Might take some time, but I'm on it.
>
> I also haven't been following this thread.
>
> Forgetting a patch for the moment, is it possible to conclusively state
> that there is or isn't a bug in the current ob-python handling and
> naming of sessions?  If there is, is there a recipe for reproducing this
> bug?
>

From participating in evaluating code throughout the discussion and
catching the comments throughout, I'd say yes, at least in terms of
how other babel languages function. In other words =#+begin_src R
:session foo= creates an R session named "foo" whereas doing the same
with =python= instead of =R= does not yield a named session.

From what others experienced, however, the functionality was working
correctly (results were persistent across blocks and two differently
names blocks created two different sessions), just not named
correctly.


John

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

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

* Re: python sessions
  2013-03-23 22:07                         ` Eric Schulte
  2013-03-24  1:29                           ` John Hendy
@ 2013-03-24  7:47                           ` Andreas Röhler
  2013-03-24 14:47                             ` John Hendy
  1 sibling, 1 reply; 217+ messages in thread
From: Andreas Röhler @ 2013-03-24  7:47 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Bastien, emacs-orgmode

Am 23.03.2013 23:07, schrieb Eric Schulte:
> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>
>> Am 21.03.2013 08:43, schrieb Bastien:
>>> Hi Andreas,
>>>
>>> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>>>
>>>> Nonetheless, still thinking
>>>>
>>>> let-var session in
>>>>
>>>> org-babel-execute:python
>>>>
>>>> needs the fix.
>>>
>>> I've not been following this thread, can you send a patch with
>>> the fix and the reason for it?  Thanks in advance!
>>>
>>
>> Hi Bastien,
>>
>> unfortunately my org-environment isn't ready yet for developing.
>> Might take some time, but I'm on it.
>
> I also haven't been following this thread.
>
> Forgetting a patch for the moment, is it possible to conclusively state
> that there is or isn't a bug in the current ob-python handling and
> naming of sessions?  If there is, is there a recipe for reproducing this
> bug?
>
> Thanks,
>

Hi,

Ista proved it works for him.

<CA+vqiLHUWvGOgszTO9981NXXbYhnKmcB-rdHbDY8nEhYpzU-og@mail.gmail.com>

Maybe we all other have incomplete resp. not updated installations?

Best regards,

Andreas

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

* Re: python sessions
  2013-03-24  7:47                           ` Andreas Röhler
@ 2013-03-24 14:47                             ` John Hendy
  2013-03-24 15:30                               ` Andreas Röhler
  2013-03-24 16:58                               ` Nick Dokos
  0 siblings, 2 replies; 217+ messages in thread
From: John Hendy @ 2013-03-24 14:47 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: Bastien, emacs-orgmode, Eric Schulte

On Sun, Mar 24, 2013 at 2:47 AM, Andreas Röhler
<andreas.roehler@easy-emacs.de> wrote:
> Am 23.03.2013 23:07, schrieb Eric Schulte:
>>
>> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>>
>>> Am 21.03.2013 08:43, schrieb Bastien:
>>>>
>>>> Hi Andreas,
>>>>
>>>> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>>>>
>>>>> Nonetheless, still thinking
>>>>>
>>>>> let-var session in
>>>>>
>>>>> org-babel-execute:python
>>>>>
>>>>> needs the fix.
>>>>
>>>>
>>>> I've not been following this thread, can you send a patch with
>>>> the fix and the reason for it?  Thanks in advance!
>>>>
>>>
>>> Hi Bastien,
>>>
>>> unfortunately my org-environment isn't ready yet for developing.
>>> Might take some time, but I'm on it.
>>
>>
>> I also haven't been following this thread.
>>
>> Forgetting a patch for the moment, is it possible to conclusively state
>> that there is or isn't a bug in the current ob-python handling and
>> naming of sessions?  If there is, is there a recipe for reproducing this
>> bug?
>>
>> Thanks,
>>
>
> Hi,
>
> Ista proved it works for him.
>
> <CA+vqiLHUWvGOgszTO9981NXXbYhnKmcB-rdHbDY8nEhYpzU-og@mail.gmail.com>
>

This opens up a compose window in gmail for me. I think this is the
thread you might have wanted to point to:
- http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68267.html

That only speaks to =:session name= argument <=> resultant python buffer names.

As Andreas pointed out, however, there *are* individuals having issues
with the actual code execution, and persistence across blocks with the
same :session names. That's another mystery I don't think we've
solved.

Ista and myself both get proper functionality, but session name
arguments don't create named buffers. Others are not getting proper
functionality.


John

> Maybe we all other have incomplete resp. not updated installations?
>
> Best regards,
>
> Andreas
>

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

* Re: python sessions
  2013-03-24 14:47                             ` John Hendy
@ 2013-03-24 15:30                               ` Andreas Röhler
  2013-03-24 16:58                               ` Nick Dokos
  1 sibling, 0 replies; 217+ messages in thread
From: Andreas Röhler @ 2013-03-24 15:30 UTC (permalink / raw)
  To: John Hendy; +Cc: Bastien, emacs-orgmode, Eric Schulte

Am 24.03.2013 15:47, schrieb John Hendy:
> On Sun, Mar 24, 2013 at 2:47 AM, Andreas Röhler
> <andreas.roehler@easy-emacs.de> wrote:
>> Am 23.03.2013 23:07, schrieb Eric Schulte:
>>>
>>> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>>>
>>>> Am 21.03.2013 08:43, schrieb Bastien:
>>>>>
>>>>> Hi Andreas,
>>>>>
>>>>> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>>>>>
>>>>>> Nonetheless, still thinking
>>>>>>
>>>>>> let-var session in
>>>>>>
>>>>>> org-babel-execute:python
>>>>>>
>>>>>> needs the fix.
>>>>>
>>>>>
>>>>> I've not been following this thread, can you send a patch with
>>>>> the fix and the reason for it?  Thanks in advance!
>>>>>
>>>>
>>>> Hi Bastien,
>>>>
>>>> unfortunately my org-environment isn't ready yet for developing.
>>>> Might take some time, but I'm on it.
>>>
>>>
>>> I also haven't been following this thread.
>>>
>>> Forgetting a patch for the moment, is it possible to conclusively state
>>> that there is or isn't a bug in the current ob-python handling and
>>> naming of sessions?  If there is, is there a recipe for reproducing this
>>> bug?
>>>
>>> Thanks,
>>>
>>
>> Hi,
>>
>> Ista proved it works for him.
>>
>> <CA+vqiLHUWvGOgszTO9981NXXbYhnKmcB-rdHbDY8nEhYpzU-og@mail.gmail.com>
>>
>
> This opens up a compose window in gmail for me.


mmh, picked the field thought as message-ID
seems not to work that way.


  I think this is the
> thread you might have wanted to point to:
> - http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68267.html
>

rather this

http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68273.html

Cheers

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

* Re: python sessions
  2013-03-24 14:47                             ` John Hendy
  2013-03-24 15:30                               ` Andreas Röhler
@ 2013-03-24 16:58                               ` Nick Dokos
  2013-03-24 16:59                                 ` John Hendy
  1 sibling, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2013-03-24 16:58 UTC (permalink / raw)
  To: John Hendy; +Cc: Bastien, emacs-orgmode, Eric Schulte

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

> ...
> - http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68267.html
> 
> That only speaks to =:session name= argument <=> resultant python buffer names.
> 
> As Andreas pointed out, however, there *are* individuals having issues
> with the actual code execution, and persistence across blocks with the
> same :session names. That's another mystery I don't think we've
> solved.
> 
> Ista and myself both get proper functionality, but session name
> arguments don't create named buffers. Others are not getting proper
> functionality.
> 

Right - for my part, the python buffers are not even created, let alone
named correctly; i.e. sessions (named or unnamed) don't work at all.

Whether that's my setup or bugs in ob-python.el, I have no idea at this
point: I haven't had time to investigate.

Nick

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

* Re: python sessions
  2013-03-24 16:58                               ` Nick Dokos
@ 2013-03-24 16:59                                 ` John Hendy
  2013-03-24 18:41                                   ` Nick Dokos
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2013-03-24 16:59 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Bastien, emacs-orgmode, Eric Schulte

On Sun, Mar 24, 2013 at 11:58 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> John Hendy <jw.hendy@gmail.com> wrote:
>
>> ...
>> - http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68267.html
>>
>> That only speaks to =:session name= argument <=> resultant python buffer names.
>>
>> As Andreas pointed out, however, there *are* individuals having issues
>> with the actual code execution, and persistence across blocks with the
>> same :session names. That's another mystery I don't think we've
>> solved.
>>
>> Ista and myself both get proper functionality, but session name
>> arguments don't create named buffers. Others are not getting proper
>> functionality.
>>
>
> Right - for my part, the python buffers are not even created, let alone
> named correctly; i.e. sessions (named or unnamed) don't work at all.
>
> Whether that's my setup or bugs in ob-python.el, I have no idea at this
> point: I haven't had time to investigate.

What OS are you using? I have org setup on my dual boot system with
Win7 and just haven't tried on Windows yet.

John

>
> Nick

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

* Re: python sessions
  2013-03-24 16:59                                 ` John Hendy
@ 2013-03-24 18:41                                   ` Nick Dokos
  2013-03-25 20:46                                     ` Andreas Röhler
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2013-03-24 18:41 UTC (permalink / raw)
  To: John Hendy; +Cc: Bastien, emacs-orgmode, Eric Schulte

> >
> > Whether that's my setup or bugs in ob-python.el, I have no idea at this
> > point: I haven't had time to investigate.
> 
> What OS are you using? I have org setup on my dual boot system with
> Win7 and just haven't tried on Windows yet.
> 

GNU Emacs 24.3.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.4) of 2012-12-29
Org-mode version 8.0-pre (release_8.0-pre-147-gfbb30a @ /home/nick/elisp/org-mode/lisp/)
Linux 2.6.38-16-generic #67-Ubuntu SMP Thu Sep 6 17:58:38 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

I think (but cannot swear) that I've also tried on more recent Ubuntu (12.04)
with the same results.

Nick

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

* Re: python sessions
  2013-03-24  1:29                           ` John Hendy
@ 2013-03-24 22:59                             ` Eric Schulte
  2013-03-25  2:38                               ` Nick Dokos
  0 siblings, 1 reply; 217+ messages in thread
From: Eric Schulte @ 2013-03-24 22:59 UTC (permalink / raw)
  To: John Hendy; +Cc: Bastien, emacs-orgmode

>
> From participating in evaluating code throughout the discussion and
> catching the comments throughout, I'd say yes, at least in terms of
> how other babel languages function. In other words =#+begin_src R
> :session foo= creates an R session named "foo" whereas doing the same
> with =python= instead of =R= does not yield a named session.
>
> From what others experienced, however, the functionality was working
> correctly (results were persistent across blocks and two differently
> names blocks created two different sessions), just not named
> correctly.
>

See the cond form starting at line 169 in ob-python.el.  Different
session functionality is used based on the `org-babel-python-mode'
variable, and on the version of Emacs in use (prior to 24.1 or not).

The branch taken when `org-babel-python-mode' equals 'python is
certainly broken, as it never saves the name of the newly created
buffer, so session re-use and use of multiple named sessions probably
works only when `org-babel-python-mode' equals 'python-mode.

It looks to have been years since any serious changes were made to this
portion of the code, so if the python-mode(s) have been changing in the
background this sort of bit-rot is not unexpected.

I never use python personally, so while I may be able to fix this at
some point it certainly will not be in the near future (I need to focus
on graduate school in the near term).  It would be great if someone who
uses Python code blocks could step forward to help with maintenance of
ob-python.el.

Sorry I can't be of more help.

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

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

* Re: python sessions
  2013-03-24 22:59                             ` Eric Schulte
@ 2013-03-25  2:38                               ` Nick Dokos
  2013-03-25  2:59                                 ` John Hendy
  0 siblings, 1 reply; 217+ messages in thread
From: Nick Dokos @ 2013-03-25  2:38 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Bastien, emacs-orgmode

Eric Schulte <schulte.eric@gmail.com> wrote:

> >
> > From participating in evaluating code throughout the discussion and
> > catching the comments throughout, I'd say yes, at least in terms of
> > how other babel languages function. In other words =#+begin_src R
> > :session foo= creates an R session named "foo" whereas doing the same
> > with =python= instead of =R= does not yield a named session.
> >
> > From what others experienced, however, the functionality was working
> > correctly (results were persistent across blocks and two differently
> > names blocks created two different sessions), just not named
> > correctly.
> >
> 
> See the cond form starting at line 169 in ob-python.el.  Different
> session functionality is used based on the `org-babel-python-mode'
> variable, and on the version of Emacs in use (prior to 24.1 or not).
> 
> The branch taken when `org-babel-python-mode' equals 'python is
> certainly broken, as it never saves the name of the newly created
> buffer, so session re-use and use of multiple named sessions probably
> works only when `org-babel-python-mode' equals 'python-mode.
> 

That's me: org-babel-python-mode's value is python, so it's no wonder
it's broken given what Eric says. I'm on emacs 24.3.50 where there is
python.el but no python-mode.el. I tried the "cheap" workaround of
switching the value to python-mode, but that does a (require
'python-mode) somewhere, so that option is out as well.

Thanks,
Nick

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

* Re: python sessions
  2013-03-25  2:38                               ` Nick Dokos
@ 2013-03-25  2:59                                 ` John Hendy
  2013-03-25  6:34                                   ` Andreas Röhler
  2013-03-25 15:40                                   ` Eric Schulte
  0 siblings, 2 replies; 217+ messages in thread
From: John Hendy @ 2013-03-25  2:59 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Bastien, emacs-orgmode, Eric Schulte

On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> Eric Schulte <schulte.eric@gmail.com> wrote:
>
>> >
>> > From participating in evaluating code throughout the discussion and
>> > catching the comments throughout, I'd say yes, at least in terms of
>> > how other babel languages function. In other words =#+begin_src R
>> > :session foo= creates an R session named "foo" whereas doing the same
>> > with =python= instead of =R= does not yield a named session.
>> >
>> > From what others experienced, however, the functionality was working
>> > correctly (results were persistent across blocks and two differently
>> > names blocks created two different sessions), just not named
>> > correctly.
>> >
>>
>> See the cond form starting at line 169 in ob-python.el.  Different
>> session functionality is used based on the `org-babel-python-mode'
>> variable, and on the version of Emacs in use (prior to 24.1 or not).
>>
>> The branch taken when `org-babel-python-mode' equals 'python is
>> certainly broken, as it never saves the name of the newly created
>> buffer, so session re-use and use of multiple named sessions probably
>> works only when `org-babel-python-mode' equals 'python-mode.
>>
>
> That's me: org-babel-python-mode's value is python, so it's no wonder
> it's broken given what Eric says. I'm on emacs 24.3.50 where there is
> python.el but no python-mode.el. I tried the "cheap" workaround of
> switching the value to python-mode, but that does a (require
> 'python-mode) somewhere, so that option is out as well.

I'm on Emacs 24.3.1 and have no python-mode.el, either (only
python.el). My setup is working correctly (again, with the caveat of
not having named sessions).


John

>
> Thanks,
> Nick
>
>
>

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

* Re: python sessions
  2013-03-25  2:59                                 ` John Hendy
@ 2013-03-25  6:34                                   ` Andreas Röhler
  2013-03-25 15:40                                   ` Eric Schulte
  1 sibling, 0 replies; 217+ messages in thread
From: Andreas Röhler @ 2013-03-25  6:34 UTC (permalink / raw)
  To: emacs-orgmode

Am 25.03.2013 03:59, schrieb John Hendy:
> On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>> Eric Schulte <schulte.eric@gmail.com> wrote:
>>
>>>>
>>>>  From participating in evaluating code throughout the discussion and
>>>> catching the comments throughout, I'd say yes, at least in terms of
>>>> how other babel languages function. In other words =#+begin_src R
>>>> :session foo= creates an R session named "foo" whereas doing the same
>>>> with =python= instead of =R= does not yield a named session.
>>>>
>>>>  From what others experienced, however, the functionality was working
>>>> correctly (results were persistent across blocks and two differently
>>>> names blocks created two different sessions), just not named
>>>> correctly.
>>>>
>>>
>>> See the cond form starting at line 169 in ob-python.el.  Different
>>> session functionality is used based on the `org-babel-python-mode'
>>> variable, and on the version of Emacs in use (prior to 24.1 or not).
>>>
>>> The branch taken when `org-babel-python-mode' equals 'python is
>>> certainly broken, as it never saves the name of the newly created
>>> buffer, so session re-use and use of multiple named sessions probably
>>> works only when `org-babel-python-mode' equals 'python-mode.
>>>
>>
>> That's me: org-babel-python-mode's value is python, so it's no wonder
>> it's broken given what Eric says. I'm on emacs 24.3.50 where there is
>> python.el but no python-mode.el. I tried the "cheap" workaround of
>> switching the value to python-mode, but that does a (require
>> 'python-mode) somewhere, so that option is out as well.
>
> I'm on Emacs 24.3.1 and have no python-mode.el, either (only
> python.el). My setup is working correctly (again, with the caveat of
> not having named sessions).
>
>
> John
>
>>
>> Thanks,
>> Nick
>>
>>
>>
>
>

The python-mode(s) question should not be at stake, as in context it matters only for the choice,
which command should start the Python shell - run-python or py-shell.

All ob-python needs is a known buffer, commonly "*Python*", connected to a python-process. This seems done by both modes,
so don't expect the bug here.

Andreas

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

* Re: python sessions
  2013-03-25  2:59                                 ` John Hendy
  2013-03-25  6:34                                   ` Andreas Röhler
@ 2013-03-25 15:40                                   ` Eric Schulte
  2013-03-25 15:55                                     ` John Hendy
  2013-03-25 16:01                                     ` Ista Zahn
  1 sibling, 2 replies; 217+ messages in thread
From: Eric Schulte @ 2013-03-25 15:40 UTC (permalink / raw)
  To: John Hendy; +Cc: Bastien, nicholas.dokos, emacs-orgmode, Eric Schulte

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

> On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>> Eric Schulte <schulte.eric@gmail.com> wrote:
>>
>>> >
>>> > From participating in evaluating code throughout the discussion and
>>> > catching the comments throughout, I'd say yes, at least in terms of
>>> > how other babel languages function. In other words =#+begin_src R
>>> > :session foo= creates an R session named "foo" whereas doing the same
>>> > with =python= instead of =R= does not yield a named session.
>>> >
>>> > From what others experienced, however, the functionality was working
>>> > correctly (results were persistent across blocks and two differently
>>> > names blocks created two different sessions), just not named
>>> > correctly.
>>> >
>>>
>>> See the cond form starting at line 169 in ob-python.el.  Different
>>> session functionality is used based on the `org-babel-python-mode'
>>> variable, and on the version of Emacs in use (prior to 24.1 or not).
>>>
>>> The branch taken when `org-babel-python-mode' equals 'python is
>>> certainly broken, as it never saves the name of the newly created
>>> buffer, so session re-use and use of multiple named sessions probably
>>> works only when `org-babel-python-mode' equals 'python-mode.
>>>
>>
>> That's me: org-babel-python-mode's value is python, so it's no wonder
>> it's broken given what Eric says. I'm on emacs 24.3.50 where there is
>> python.el but no python-mode.el. I tried the "cheap" workaround of
>> switching the value to python-mode, but that does a (require
>> 'python-mode) somewhere, so that option is out as well.
>
> I'm on Emacs 24.3.1 and have no python-mode.el, either (only
> python.el). My setup is working correctly (again, with the caveat of
> not having named sessions).
>

It sounds like we have the same setup, and the following un-named
session example does not work for me.  The first code block evaluates
successfully, but it doesn't appear to be having any impact on the
default session (e.g., in the *Python* buffer).

    Returns the value of x as expected.

    #+begin_src python :session
      x = 1
      return x
    #+end_src

    #+RESULTS:
    : 1

    #+begin_src python :session
      return x
    #+end_src

    #+RESULTS:

The second code block /should/ have access to the x variable defined
previous, but instead it throws an error because x is undefined.

Currently I'd say session support for python is completely broken.

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

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

* Re: python sessions
  2013-03-25 15:40                                   ` Eric Schulte
@ 2013-03-25 15:55                                     ` John Hendy
  2013-03-25 16:07                                       ` Eric Schulte
  2013-03-25 16:01                                     ` Ista Zahn
  1 sibling, 1 reply; 217+ messages in thread
From: John Hendy @ 2013-03-25 15:55 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Bastien, nicholas.dokos, emacs-orgmode

On Mon, Mar 25, 2013 at 10:40 AM, Eric Schulte <schulte.eric@gmail.com> wrote:
> John Hendy <jw.hendy@gmail.com> writes:
>
>> On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>>> Eric Schulte <schulte.eric@gmail.com> wrote:
>>>
>>>> >
>>>> > From participating in evaluating code throughout the discussion and
>>>> > catching the comments throughout, I'd say yes, at least in terms of
>>>> > how other babel languages function. In other words =#+begin_src R
>>>> > :session foo= creates an R session named "foo" whereas doing the same
>>>> > with =python= instead of =R= does not yield a named session.
>>>> >
>>>> > From what others experienced, however, the functionality was working
>>>> > correctly (results were persistent across blocks and two differently
>>>> > names blocks created two different sessions), just not named
>>>> > correctly.
>>>> >
>>>>
>>>> See the cond form starting at line 169 in ob-python.el.  Different
>>>> session functionality is used based on the `org-babel-python-mode'
>>>> variable, and on the version of Emacs in use (prior to 24.1 or not).
>>>>
>>>> The branch taken when `org-babel-python-mode' equals 'python is
>>>> certainly broken, as it never saves the name of the newly created
>>>> buffer, so session re-use and use of multiple named sessions probably
>>>> works only when `org-babel-python-mode' equals 'python-mode.
>>>>
>>>
>>> That's me: org-babel-python-mode's value is python, so it's no wonder
>>> it's broken given what Eric says. I'm on emacs 24.3.50 where there is
>>> python.el but no python-mode.el. I tried the "cheap" workaround of
>>> switching the value to python-mode, but that does a (require
>>> 'python-mode) somewhere, so that option is out as well.
>>
>> I'm on Emacs 24.3.1 and have no python-mode.el, either (only
>> python.el). My setup is working correctly (again, with the caveat of
>> not having named sessions).
>>
>
> It sounds like we have the same setup, and the following un-named
> session example does not work for me.  The first code block evaluates
> successfully, but it doesn't appear to be having any impact on the
> default session (e.g., in the *Python* buffer).
>
>     Returns the value of x as expected.
>
>     #+begin_src python :session
>       x = 1
>       return x
>     #+end_src
>
>     #+RESULTS:
>     : 1
>
>     #+begin_src python :session
>       return x
>     #+end_src
>
>     #+RESULTS:
>
> The second code block /should/ have access to the x variable defined
> previous, but instead it throws an error because x is undefined.
>
> Currently I'd say session support for python is completely broken.

Have *any* changes been made related to python recently? See my
mailing list post with reproducible example:
- http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68238.html

This was definitely working for me with a minimal config and starting
with `emacs -Q`. I cannot reproduce that example anymore. Sessions
don't work any longer, named or un-named for me, and we had two data
points (myself and Ista) for whom it worked (at least for named).

I think something was changed that broke it for my working setup.
Might be nice to figure out what that was.

Is there a way to see one's local git history? Not the git log, but
something like what git versions I've been hopping from/to with each
successive pull? I could try and see what I was at on 3/20 when I
posted that and when I last pulled? I see a change related to
ob-python from Bastien on 3/19... perhaps I could switch to a commit
prior to that and try again?


John

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

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

* Re: python sessions
  2013-03-25 15:40                                   ` Eric Schulte
  2013-03-25 15:55                                     ` John Hendy
@ 2013-03-25 16:01                                     ` Ista Zahn
  2013-03-25 16:23                                       ` John Hendy
  1 sibling, 1 reply; 217+ messages in thread
From: Ista Zahn @ 2013-03-25 16:01 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Bastien, nicholas.dokos, emacs-orgmode

On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte <schulte.eric@gmail.com> wrote:
> John Hendy <jw.hendy@gmail.com> writes:
>
>> On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>>> Eric Schulte <schulte.eric@gmail.com> wrote:
>>>
>>>> >
>>>> > From participating in evaluating code throughout the discussion and
>>>> > catching the comments throughout, I'd say yes, at least in terms of
>>>> > how other babel languages function. In other words =#+begin_src R
>>>> > :session foo= creates an R session named "foo" whereas doing the same
>>>> > with =python= instead of =R= does not yield a named session.
>>>> >
>>>> > From what others experienced, however, the functionality was working
>>>> > correctly (results were persistent across blocks and two differently
>>>> > names blocks created two different sessions), just not named
>>>> > correctly.
>>>> >
>>>>
>>>> See the cond form starting at line 169 in ob-python.el.  Different
>>>> session functionality is used based on the `org-babel-python-mode'
>>>> variable, and on the version of Emacs in use (prior to 24.1 or not).
>>>>
>>>> The branch taken when `org-babel-python-mode' equals 'python is
>>>> certainly broken, as it never saves the name of the newly created
>>>> buffer, so session re-use and use of multiple named sessions probably
>>>> works only when `org-babel-python-mode' equals 'python-mode.
>>>>
>>>
>>> That's me: org-babel-python-mode's value is python, so it's no wonder
>>> it's broken given what Eric says. I'm on emacs 24.3.50 where there is
>>> python.el but no python-mode.el. I tried the "cheap" workaround of
>>> switching the value to python-mode, but that does a (require
>>> 'python-mode) somewhere, so that option is out as well.
>>
>> I'm on Emacs 24.3.1 and have no python-mode.el, either (only
>> python.el). My setup is working correctly (again, with the caveat of
>> not having named sessions).
>>
>
> It sounds like we have the same setup, and the following un-named
> session example does not work for me.  The first code block evaluates
> successfully, but it doesn't appear to be having any impact on the
> default session (e.g., in the *Python* buffer).
>
>     Returns the value of x as expected.
>
>     #+begin_src python :session
>       x = 1
>       return x
>     #+end_src
>
>     #+RESULTS:
>     : 1
>
>     #+begin_src python :session
>       return x
>     #+end_src
>
>     #+RESULTS:
>
> The second code block /should/ have access to the x variable defined
> previous, but instead it throws an error because x is undefined.
>
> Currently I'd say session support for python is completely broken.

As of this morning I've joined the "it does not work" crowd. Python
sessions worked for me last week, but are now completely broken for me
in the way Eric and others describe.

Best,
Ista

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

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

* Re: python sessions
  2013-03-25 15:55                                     ` John Hendy
@ 2013-03-25 16:07                                       ` Eric Schulte
  2013-03-25 16:41                                         ` Nick Dokos
  0 siblings, 1 reply; 217+ messages in thread
From: Eric Schulte @ 2013-03-25 16:07 UTC (permalink / raw)
  To: John Hendy; +Cc: Bastien, nicholas.dokos, emacs-orgmode

>>
>> Currently I'd say session support for python is completely broken.
>
> Have *any* changes been made related to python recently? See my
> mailing list post with reproducible example:
> - http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68238.html
>
> This was definitely working for me with a minimal config and starting
> with `emacs -Q`. I cannot reproduce that example anymore. Sessions
> don't work any longer, named or un-named for me, and we had two data
> points (myself and Ista) for whom it worked (at least for named).
>
> I think something was changed that broke it for my working setup.
> Might be nice to figure out what that was.
>

I certainly haven't touched this code.  The latest change I see to the
relevant portions of the code is commit 4a0afac6 from Bastien on
Feb. 23rd.

>
> Is there a way to see one's local git history? Not the git log, but
> something like what git versions I've been hopping from/to with each
> successive pull? I could try and see what I was at on 3/20 when I
> posted that and when I last pulled? I see a change related to
> ob-python from Bastien on 3/19... perhaps I could switch to a commit
> prior to that and try again?
>

I don't know of a way to show what versions you have used recently.

There are tools to help find the commits causing a change in behavior.
See http://git-scm.com/book/en/Git-Tools-Debugging-with-Git for a pretty
good summary.

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

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

* Re: python sessions
  2013-03-25 16:01                                     ` Ista Zahn
@ 2013-03-25 16:23                                       ` John Hendy
  2013-03-25 16:43                                         ` Eric Schulte
  0 siblings, 1 reply; 217+ messages in thread
From: John Hendy @ 2013-03-25 16:23 UTC (permalink / raw)
  To: Ista Zahn; +Cc: Bastien, nicholas.dokos, emacs-orgmode, Eric Schulte

On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn <istazahn@gmail.com> wrote:
> On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte <schulte.eric@gmail.com> wrote:
>> John Hendy <jw.hendy@gmail.com> writes:
>>
>>> On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>>>> Eric Schulte <schulte.eric@gmail.com> wrote:
>>>>
>>>>> >
>>>>> > From participating in evaluating code throughout the discussion and
>>>>> > catching the comments throughout, I'd say yes, at least in terms of
>>>>> > how other babel languages function. In other words =#+begin_src R
>>>>> > :session foo= creates an R session named "foo" whereas doing the same
>>>>> > with =python= instead of =R= does not yield a named session.
>>>>> >
>>>>> > From what others experienced, however, the functionality was working
>>>>> > correctly (results were persistent across blocks and two differently
>>>>> > names blocks created two different sessions), just not named
>>>>> > correctly.
>>>>> >
>>>>>
>>>>> See the cond form starting at line 169 in ob-python.el.  Different
>>>>> session functionality is used based on the `org-babel-python-mode'
>>>>> variable, and on the version of Emacs in use (prior to 24.1 or not).
>>>>>
>>>>> The branch taken when `org-babel-python-mode' equals 'python is
>>>>> certainly broken, as it never saves the name of the newly created
>>>>> buffer, so session re-use and use of multiple named sessions probably
>>>>> works only when `org-babel-python-mode' equals 'python-mode.
>>>>>
>>>>
>>>> That's me: org-babel-python-mode's value is python, so it's no wonder
>>>> it's broken given what Eric says. I'm on emacs 24.3.50 where there is
>>>> python.el but no python-mode.el. I tried the "cheap" workaround of
>>>> switching the value to python-mode, but that does a (require
>>>> 'python-mode) somewhere, so that option is out as well.
>>>
>>> I'm on Emacs 24.3.1 and have no python-mode.el, either (only
>>> python.el). My setup is working correctly (again, with the caveat of
>>> not having named sessions).
>>>
>>
>> It sounds like we have the same setup, and the following un-named
>> session example does not work for me.  The first code block evaluates
>> successfully, but it doesn't appear to be having any impact on the
>> default session (e.g., in the *Python* buffer).
>>
>>     Returns the value of x as expected.
>>
>>     #+begin_src python :session
>>       x = 1
>>       return x
>>     #+end_src
>>
>>     #+RESULTS:
>>     : 1
>>
>>     #+begin_src python :session
>>       return x
>>     #+end_src
>>
>>     #+RESULTS:
>>
>> The second code block /should/ have access to the x variable defined
>> previous, but instead it throws an error because x is undefined.
>>
>> Currently I'd say session support for python is completely broken.
>
> As of this morning I've joined the "it does not work" crowd. Python
> sessions worked for me last week, but are now completely broken for me
> in the way Eric and others describe.

Interesting... checked out back to that commit
(eff59a15d76647ce8282626b9eb463dc3706d56e) and it still doesn't work.
On a whim, I checked my pacman log (Arch's install system) and
coincidentally on Mar 20 /after/ I wrote that post in which things
work, I ran a system package update.

$ grep -i emacs /var/log/pacman.log

[2013-03-20 12:51] upgraded emacs (24.2-4 -> 24.3-1)

Using the Arch Rollback Machine, I downloaded Emacs 24.2.4 and
downgraded (also required downgrading imageMagick from 6.8.3.10 ->
6.8.2.3). Now it works again (refer to the reproducible example from
the mailing list post):
- http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68238.html

Eric, your example fails for me. I get:

>>> x = 1
>>> return x
  File "<stdin>", line 1
SyntaxError: 'return' outside function

This works, hoever:

#+begin_src python :session
      x = 1
      x
#+end_src

#+RESULTS:
: 1

#+begin_src python :session
      x
#+end_src

#+RESULTS:
: 1

So, with emacs 24.2.4 and current Org-mode (pulled just now) and clean
make, *both* named and un-named sessions work for me on Arch Linux.

John

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

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

* Re: python sessions
  2013-03-25 16:07                                       ` Eric Schulte
@ 2013-03-25 16:41                                         ` Nick Dokos
  0 siblings, 0 replies; 217+ messages in thread
From: Nick Dokos @ 2013-03-25 16:41 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Bastien, emacs-orgmode

Eric Schulte <schulte.eric@gmail.com> wrote:

> >>
> >> Currently I'd say session support for python is completely broken.
> >
> > Have *any* changes been made related to python recently? See my
> > mailing list post with reproducible example:
> > - http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68238.html
> >
> > This was definitely working for me with a minimal config and starting
> > with `emacs -Q`. I cannot reproduce that example anymore. Sessions
> > don't work any longer, named or un-named for me, and we had two data
> > points (myself and Ista) for whom it worked (at least for named).
> >
> > I think something was changed that broke it for my working setup.
> > Might be nice to figure out what that was.
> >
> 
> I certainly haven't touched this code.  The latest change I see to the
> relevant portions of the code is commit 4a0afac6 from Bastien on
> Feb. 23rd.
> 

At least, we now all agree that it's broken ;-)

> >
> > Is there a way to see one's local git history? Not the git log, but
> > something like what git versions I've been hopping from/to with each
> > successive pull? I could try and see what I was at on 3/20 when I
> > posted that and when I last pulled? I see a change related to
> > ob-python from Bastien on 3/19... perhaps I could switch to a commit
> > prior to that and try again?
> >
> 
> I don't know of a way to show what versions you have used recently.
> 

I think `git reflog' can do that, but it's kinda cryptic, so it might
be more trouble than it's worth.

Nick

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

* Re: python sessions
  2013-03-25 16:23                                       ` John Hendy
@ 2013-03-25 16:43                                         ` Eric Schulte
  2013-03-25 17:27                                           ` Andreas Röhler
  0 siblings, 1 reply; 217+ messages in thread
From: Eric Schulte @ 2013-03-25 16:43 UTC (permalink / raw)
  To: John Hendy; +Cc: Bastien, nicholas.dokos, emacs-orgmode, Ista Zahn

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

> On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn <istazahn@gmail.com> wrote:
>> On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte <schulte.eric@gmail.com> wrote:
>>> John Hendy <jw.hendy@gmail.com> writes:
>>>
>>>> On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>>>>> Eric Schulte <schulte.eric@gmail.com> wrote:
>>>>>
>>>>>> >
>>>>>> > From participating in evaluating code throughout the discussion and
>>>>>> > catching the comments throughout, I'd say yes, at least in terms of
>>>>>> > how other babel languages function. In other words =#+begin_src R
>>>>>> > :session foo= creates an R session named "foo" whereas doing the same
>>>>>> > with =python= instead of =R= does not yield a named session.
>>>>>> >
>>>>>> > From what others experienced, however, the functionality was working
>>>>>> > correctly (results were persistent across blocks and two differently
>>>>>> > names blocks created two different sessions), just not named
>>>>>> > correctly.
>>>>>> >
>>>>>>
>>>>>> See the cond form starting at line 169 in ob-python.el.  Different
>>>>>> session functionality is used based on the `org-babel-python-mode'
>>>>>> variable, and on the version of Emacs in use (prior to 24.1 or not).
>>>>>>
>>>>>> The branch taken when `org-babel-python-mode' equals 'python is
>>>>>> certainly broken, as it never saves the name of the newly created
>>>>>> buffer, so session re-use and use of multiple named sessions probably
>>>>>> works only when `org-babel-python-mode' equals 'python-mode.
>>>>>>
>>>>>
>>>>> That's me: org-babel-python-mode's value is python, so it's no wonder
>>>>> it's broken given what Eric says. I'm on emacs 24.3.50 where there is
>>>>> python.el but no python-mode.el. I tried the "cheap" workaround of
>>>>> switching the value to python-mode, but that does a (require
>>>>> 'python-mode) somewhere, so that option is out as well.
>>>>
>>>> I'm on Emacs 24.3.1 and have no python-mode.el, either (only
>>>> python.el). My setup is working correctly (again, with the caveat of
>>>> not having named sessions).
>>>>
>>>
>>> It sounds like we have the same setup, and the following un-named
>>> session example does not work for me.  The first code block evaluates
>>> successfully, but it doesn't appear to be having any impact on the
>>> default session (e.g., in the *Python* buffer).
>>>
>>>     Returns the value of x as expected.
>>>
>>>     #+begin_src python :session
>>>       x = 1
>>>       return x
>>>     #+end_src
>>>
>>>     #+RESULTS:
>>>     : 1
>>>
>>>     #+begin_src python :session
>>>       return x
>>>     #+end_src
>>>
>>>     #+RESULTS:
>>>
>>> The second code block /should/ have access to the x variable defined
>>> previous, but instead it throws an error because x is undefined.
>>>
>>> Currently I'd say session support for python is completely broken.
>>
>> As of this morning I've joined the "it does not work" crowd. Python
>> sessions worked for me last week, but are now completely broken for me
>> in the way Eric and others describe.
>
> Interesting... checked out back to that commit
> (eff59a15d76647ce8282626b9eb463dc3706d56e) and it still doesn't work.
> On a whim, I checked my pacman log (Arch's install system) and
> coincidentally on Mar 20 /after/ I wrote that post in which things
> work, I ran a system package update.
>
> $ grep -i emacs /var/log/pacman.log
>
> [2013-03-20 12:51] upgraded emacs (24.2-4 -> 24.3-1)
>
> Using the Arch Rollback Machine, I downloaded Emacs 24.2.4 and
> downgraded (also required downgrading imageMagick from 6.8.3.10 ->
> 6.8.2.3). Now it works again (refer to the reproducible example from
> the mailing list post):
> - http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68238.html
>
> Eric, your example fails for me. I get:
>

Yes, because my example only works in external (non session) execution
with the current buggy code, where as your example works with session
execution in the old working code.

>
>>>> x = 1
>>>> return x
>   File "<stdin>", line 1
> SyntaxError: 'return' outside function
>
> This works, hoever:
>
> #+begin_src python :session
>       x = 1
>       x
> #+end_src
>
> #+RESULTS:
> : 1
>
> #+begin_src python :session
>       x
> #+end_src
>
> #+RESULTS:
> : 1
>
> So, with emacs 24.2.4 and current Org-mode (pulled just now) and clean
> make, *both* named and un-named sessions work for me on Arch Linux.
>

Aha! Thanks for sleuthing this out.  So the problem lies in changes to
the python.el distributed with Emacs.  I don't suppose we can ask
whoever made these changes to python.el to fix the breakage they've
caused in Org-mode?

Thanks,

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

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

* Re: python sessions
  2013-03-25 16:43                                         ` Eric Schulte
@ 2013-03-25 17:27                                           ` Andreas Röhler
  2013-03-25 17:41                                             ` John Hendy
  2013-03-25 19:30                                             ` Ivan Andrus
  0 siblings, 2 replies; 217+ messages in thread
From: Andreas Röhler @ 2013-03-25 17:27 UTC (permalink / raw)
  To: emacs-orgmode

Am 25.03.2013 17:43, schrieb Eric Schulte:
> John Hendy <jw.hendy@gmail.com> writes:
>
>> On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn <istazahn@gmail.com> wrote:
>>> On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte <schulte.eric@gmail.com> wrote:
>>>> John Hendy <jw.hendy@gmail.com> writes:
>>>>
>>>>> On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>>>>>> Eric Schulte <schulte.eric@gmail.com> wrote:
>>>>>>
>>>>>>>>
>>>>>>>>  From participating in evaluating code throughout the discussion and
>>>>>>>> catching the comments throughout, I'd say yes, at least in terms of
>>>>>>>> how other babel languages function. In other words =#+begin_src R
>>>>>>>> :session foo= creates an R session named "foo" whereas doing the same
>>>>>>>> with =python= instead of =R= does not yield a named session.
>>>>>>>>
>>>>>>>>  From what others experienced, however, the functionality was working
>>>>>>>> correctly (results were persistent across blocks and two differently
>>>>>>>> names blocks created two different sessions), just not named
>>>>>>>> correctly.
>>>>>>>>
>>>>>>>
>>>>>>> See the cond form starting at line 169 in ob-python.el.  Different
>>>>>>> session functionality is used based on the `org-babel-python-mode'
>>>>>>> variable, and on the version of Emacs in use (prior to 24.1 or not).
>>>>>>>
>>>>>>> The branch taken when `org-babel-python-mode' equals 'python is
>>>>>>> certainly broken, as it never saves the name of the newly created
>>>>>>> buffer, so session re-use and use of multiple named sessions probably
>>>>>>> works only when `org-babel-python-mode' equals 'python-mode.
>>>>>>>
>>>>>>
>>>>>> That's me: org-babel-python-mode's value is python, so it's no wonder
>>>>>> it's broken given what Eric says. I'm on emacs 24.3.50 where there is
>>>>>> python.el but no python-mode.el. I tried the "cheap" workaround of
>>>>>> switching the value to python-mode, but that does a (require
>>>>>> 'python-mode) somewhere, so that option is out as well.
>>>>>
>>>>> I'm on Emacs 24.3.1 and have no python-mode.el, either (only
>>>>> python.el). My setup is working correctly (again, with the caveat of
>>>>> not having named sessions).
>>>>>
>>>>
>>>> It sounds like we have the same setup, and the following un-named
>>>> session example does not work for me.  The first code block evaluates
>>>> successfully, but it doesn't appear to be having any impact on the
>>>> default session (e.g., in the *Python* buffer).
>>>>
>>>>      Returns the value of x as expected.
>>>>
>>>>      #+begin_src python :session
>>>>        x = 1
>>>>        return x
>>>>      #+end_src
>>>>
>>>>      #+RESULTS:
>>>>      : 1
>>>>
>>>>      #+begin_src python :session
>>>>        return x
>>>>      #+end_src
>>>>
>>>>      #+RESULTS:
>>>>
>>>> The second code block /should/ have access to the x variable defined
>>>> previous, but instead it throws an error because x is undefined.
>>>>
>>>> Currently I'd say session support for python is completely broken.
>>>
>>> As of this morning I've joined the "it does not work" crowd. Python
>>> sessions worked for me last week, but are now completely broken for me
>>> in the way Eric and others describe.
>>
>> Interesting... checked out back to that commit
>> (eff59a15d76647ce8282626b9eb463dc3706d56e) and it still doesn't work.
>> On a whim, I checked my pacman log (Arch's install system) and
>> coincidentally on Mar 20 /after/ I wrote that post in which things
>> work, I ran a system package update.
>>
>> $ grep -i emacs /var/log/pacman.log
>>
>> [2013-03-20 12:51] upgraded emacs (24.2-4 -> 24.3-1)
>>
>> Using the Arch Rollback Machine, I downloaded Emacs 24.2.4 and
>> downgraded (also required downgrading imageMagick from 6.8.3.10 ->
>> 6.8.2.3). Now it works again (refer to the reproducible example from
>> the mailing list post):
>> - http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68238.html
>>
>> Eric, your example fails for me. I get:
>>
>
> Yes, because my example only works in external (non session) execution
> with the current buggy code, where as your example works with session
> execution in the old working code.
>
>>
>>>>> x = 1
>>>>> return x
>>    File "<stdin>", line 1
>> SyntaxError: 'return' outside function
>>
>> This works, hoever:
>>
>> #+begin_src python :session
>>        x = 1
>>        x
>> #+end_src
>>
>> #+RESULTS:
>> : 1
>>
>> #+begin_src python :session
>>        x
>> #+end_src
>>
>> #+RESULTS:
>> : 1
>>
>> So, with emacs 24.2.4 and current Org-mode (pulled just now) and clean
>> make, *both* named and un-named sessions work for me on Arch Linux.
>>
>
> Aha! Thanks for sleuthing this out.  So the problem lies in changes to
> the python.el distributed with Emacs.  I don't suppose we can ask
> whoever made these changes to python.el to fix the breakage they've
> caused in Org-mode?
>
> Thanks,
>

Please give me some time still to investigate. Still doubt it's python.el
But if yes, probably will be able to tell more.

Best,

Andreas

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

* Re: python sessions
  2013-03-25 17:27                                           ` Andreas Röhler
@ 2013-03-25 17:41                                             ` John Hendy
  2013-03-25 18:16                                               ` Ista Zahn
  2013-03-25 19:30                                             ` Ivan Andrus
  1 sibling, 1 reply; 217+ messages in thread
From: John Hendy @ 2013-03-25 17:41 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: emacs-orgmode

On Mon, Mar 25, 2013 at 12:27 PM, Andreas Röhler
<andreas.roehler@easy-emacs.de> wrote:
> Am 25.03.2013 17:43, schrieb Eric Schulte:
>
>> John Hendy <jw.hendy@gmail.com> writes:
>>
>>> On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn <istazahn@gmail.com> wrote:
>>>>
>>>> On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte <schulte.eric@gmail.com>
>>>> wrote:
>>>>>
>>>>> John Hendy <jw.hendy@gmail.com> writes:
>>>>>
>>>>>> On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos <nicholas.dokos@hp.com>
>>>>>> wrote:
>>>>>>>
>>>>>>> Eric Schulte <schulte.eric@gmail.com> wrote:
>>>>>>>
>>>>>>>>>
>>>>>>>>>  From participating in evaluating code throughout the discussion
>>>>>>>>> and
>>>>>>>>> catching the comments throughout, I'd say yes, at least in terms of
>>>>>>>>> how other babel languages function. In other words =#+begin_src R
>>>>>>>>> :session foo= creates an R session named "foo" whereas doing the
>>>>>>>>> same
>>>>>>>>> with =python= instead of =R= does not yield a named session.
>>>>>>>>>
>>>>>>>>>  From what others experienced, however, the functionality was
>>>>>>>>> working
>>>>>>>>> correctly (results were persistent across blocks and two
>>>>>>>>> differently
>>>>>>>>> names blocks created two different sessions), just not named
>>>>>>>>> correctly.
>>>>>>>>>
>>>>>>>>
>>>>>>>> See the cond form starting at line 169 in ob-python.el.  Different
>>>>>>>> session functionality is used based on the `org-babel-python-mode'
>>>>>>>> variable, and on the version of Emacs in use (prior to 24.1 or not).
>>>>>>>>
>>>>>>>> The branch taken when `org-babel-python-mode' equals 'python is
>>>>>>>> certainly broken, as it never saves the name of the newly created
>>>>>>>> buffer, so session re-use and use of multiple named sessions
>>>>>>>> probably
>>>>>>>> works only when `org-babel-python-mode' equals 'python-mode.
>>>>>>>>
>>>>>>>
>>>>>>> That's me: org-babel-python-mode's value is python, so it's no wonder
>>>>>>> it's broken given what Eric says. I'm on emacs 24.3.50 where there is
>>>>>>> python.el but no python-mode.el. I tried the "cheap" workaround of
>>>>>>> switching the value to python-mode, but that does a (require
>>>>>>> 'python-mode) somewhere, so that option is out as well.
>>>>>>
>>>>>>
>>>>>> I'm on Emacs 24.3.1 and have no python-mode.el, either (only
>>>>>> python.el). My setup is working correctly (again, with the caveat of
>>>>>> not having named sessions).
>>>>>>
>>>>>
>>>>> It sounds like we have the same setup, and the following un-named
>>>>> session example does not work for me.  The first code block evaluates
>>>>> successfully, but it doesn't appear to be having any impact on the
>>>>> default session (e.g., in the *Python* buffer).
>>>>>
>>>>>      Returns the value of x as expected.
>>>>>
>>>>>      #+begin_src python :session
>>>>>        x = 1
>>>>>        return x
>>>>>      #+end_src
>>>>>
>>>>>      #+RESULTS:
>>>>>      : 1
>>>>>
>>>>>      #+begin_src python :session
>>>>>        return x
>>>>>      #+end_src
>>>>>
>>>>>      #+RESULTS:
>>>>>
>>>>> The second code block /should/ have access to the x variable defined
>>>>> previous, but instead it throws an error because x is undefined.
>>>>>
>>>>> Currently I'd say session support for python is completely broken.
>>>>
>>>>
>>>> As of this morning I've joined the "it does not work" crowd. Python
>>>> sessions worked for me last week, but are now completely broken for me
>>>> in the way Eric and others describe.
>>>
>>>
>>> Interesting... checked out back to that commit
>>> (eff59a15d76647ce8282626b9eb463dc3706d56e) and it still doesn't work.
>>> On a whim, I checked my pacman log (Arch's install system) and
>>> coincidentally on Mar 20 /after/ I wrote that post in which things
>>> work, I ran a system package update.
>>>
>>> $ grep -i emacs /var/log/pacman.log
>>>
>>> [2013-03-20 12:51] upgraded emacs (24.2-4 -> 24.3-1)
>>>
>>> Using the Arch Rollback Machine, I downloaded Emacs 24.2.4 and
>>> downgraded (also required downgrading imageMagick from 6.8.3.10 ->
>>> 6.8.2.3). Now it works again (refer to the reproducible example from
>>> the mailing list post):
>>> - http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68238.html
>>>
>>> Eric, your example fails for me. I get:
>>>
>>
>> Yes, because my example only works in external (non session) execution
>> with the current buggy code, where as your example works with session
>> execution in the old working code.
>>
>>>
>>>>>> x = 1
>>>>>> return x
>>>
>>>    File "<stdin>", line 1
>>> SyntaxError: 'return' outside function
>>>
>>> This works, hoever:
>>>
>>> #+begin_src python :session
>>>        x = 1
>>>        x
>>> #+end_src
>>>
>>> #+RESULTS:
>>> : 1
>>>
>>> #+begin_src python :session
>>>        x
>>> #+end_src
>>>
>>> #+RESULTS:
>>> : 1
>>>
>>> So, with emacs 24.2.4 and current Org-mode (pulled just now) and clean
>>> make, *both* named and un-named sessions work for me on Arch Linux.
>>>
>>
>> Aha! Thanks for sleuthing this out.  So the problem lies in changes to
>> the python.el distributed with Emacs.  I don't suppose we can ask
>> whoever made these changes to python.el to fix the breakage they've
>> caused in Org-mode?
>>
>> Thanks,
>>
>
> Please give me some time still to investigate. Still doubt it's python.el
> But if yes, probably will be able to tell more.

Possibly, but know that for me it works with one Emacs version and not
another, both using the same git version of Org and same minimal
config/setup/test file. Perhaps those affected here should post their
Emacs versions?


John

>
> Best,
>
> Andreas
>

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

* Re: python sessions
  2013-03-25 17:41                                             ` John Hendy
@ 2013-03-25 18:16                                               ` Ista Zahn
  0 siblings, 0 replies; 217+ messages in thread
From: Ista Zahn @ 2013-03-25 18:16 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

On Mon, Mar 25, 2013 at 1:41 PM, John Hendy <jw.hendy@gmail.com> wrote:
> On Mon, Mar 25, 2013 at 12:27 PM, Andreas Röhler
> <andreas.roehler@easy-emacs.de> wrote:
>> Am 25.03.2013 17:43, schrieb Eric Schulte:
>>
>>> John Hendy <jw.hendy@gmail.com> writes:
>>>
>>>> On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn <istazahn@gmail.com> wrote:
>>>>>
>>>>> On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte <schulte.eric@gmail.com>
>>>>> wrote:
>>>>>>
>>>>>> John Hendy <jw.hendy@gmail.com> writes:
>>>>>>
>>>>>>> On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos <nicholas.dokos@hp.com>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Eric Schulte <schulte.eric@gmail.com> wrote:
>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  From participating in evaluating code throughout the discussion
>>>>>>>>>> and
>>>>>>>>>> catching the comments throughout, I'd say yes, at least in terms of
>>>>>>>>>> how other babel languages function. In other words =#+begin_src R
>>>>>>>>>> :session foo= creates an R session named "foo" whereas doing the
>>>>>>>>>> same
>>>>>>>>>> with =python= instead of =R= does not yield a named session.
>>>>>>>>>>
>>>>>>>>>>  From what others experienced, however, the functionality was
>>>>>>>>>> working
>>>>>>>>>> correctly (results were persistent across blocks and two
>>>>>>>>>> differently
>>>>>>>>>> names blocks created two different sessions), just not named
>>>>>>>>>> correctly.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> See the cond form starting at line 169 in ob-python.el.  Different
>>>>>>>>> session functionality is used based on the `org-babel-python-mode'
>>>>>>>>> variable, and on the version of Emacs in use (prior to 24.1 or not).
>>>>>>>>>
>>>>>>>>> The branch taken when `org-babel-python-mode' equals 'python is
>>>>>>>>> certainly broken, as it never saves the name of the newly created
>>>>>>>>> buffer, so session re-use and use of multiple named sessions
>>>>>>>>> probably
>>>>>>>>> works only when `org-babel-python-mode' equals 'python-mode.
>>>>>>>>>
>>>>>>>>
>>>>>>>> That's me: org-babel-python-mode's value is python, so it's no wonder
>>>>>>>> it's broken given what Eric says. I'm on emacs 24.3.50 where there is
>>>>>>>> python.el but no python-mode.el. I tried the "cheap" workaround of
>>>>>>>> switching the value to python-mode, but that does a (require
>>>>>>>> 'python-mode) somewhere, so that option is out as well.
>>>>>>>
>>>>>>>
>>>>>>> I'm on Emacs 24.3.1 and have no python-mode.el, either (only
>>>>>>> python.el). My setup is working correctly (again, with the caveat of
>>>>>>> not having named sessions).
>>>>>>>
>>>>>>
>>>>>> It sounds like we have the same setup, and the following un-named
>>>>>> session example does not work for me.  The first code block evaluates
>>>>>> successfully, but it doesn't appear to be having any impact on the
>>>>>> default session (e.g., in the *Python* buffer).
>>>>>>
>>>>>>      Returns the value of x as expected.
>>>>>>
>>>>>>      #+begin_src python :session
>>>>>>        x = 1
>>>>>>        return x
>>>>>>      #+end_src
>>>>>>
>>>>>>      #+RESULTS:
>>>>>>      : 1
>>>>>>
>>>>>>      #+begin_src python :session
>>>>>>        return x
>>>>>>      #+end_src
>>>>>>
>>>>>>      #+RESULTS:
>>>>>>
>>>>>> The second code block /should/ have access to the x variable defined
>>>>>> previous, but instead it throws an error because x is undefined.
>>>>>>
>>>>>> Currently I'd say session support for python is completely broken.
>>>>>
>>>>>
>>>>> As of this morning I've joined the "it does not work" crowd. Python
>>>>> sessions worked for me last week, but are now completely broken for me
>>>>> in the way Eric and others describe.
>>>>
>>>>
>>>> Interesting... checked out back to that commit
>>>> (eff59a15d76647ce8282626b9eb463dc3706d56e) and it still doesn't work.
>>>> On a whim, I checked my pacman log (Arch's install system) and
>>>> coincidentally on Mar 20 /after/ I wrote that post in which things
>>>> work, I ran a system package update.
>>>>
>>>> $ grep -i emacs /var/log/pacman.log
>>>>
>>>> [2013-03-20 12:51] upgraded emacs (24.2-4 -> 24.3-1)
>>>>
>>>> Using the Arch Rollback Machine, I downloaded Emacs 24.2.4 and
>>>> downgraded (also required downgrading imageMagick from 6.8.3.10 ->
>>>> 6.8.2.3). Now it works again (refer to the reproducible example from
>>>> the mailing list post):
>>>> - http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68238.html
>>>>
>>>> Eric, your example fails for me. I get:
>>>>
>>>
>>> Yes, because my example only works in external (non session) execution
>>> with the current buggy code, where as your example works with session
>>> execution in the old working code.
>>>
>>>>
>>>>>>> x = 1
>>>>>>> return x
>>>>
>>>>    File "<stdin>", line 1
>>>> SyntaxError: 'return' outside function
>>>>
>>>> This works, hoever:
>>>>
>>>> #+begin_src python :session
>>>>        x = 1
>>>>        x
>>>> #+end_src
>>>>
>>>> #+RESULTS:
>>>> : 1
>>>>
>>>> #+begin_src python :session
>>>>        x
>>>> #+end_src
>>>>
>>>> #+RESULTS:
>>>> : 1
>>>>
>>>> So, with emacs 24.2.4 and current Org-mode (pulled just now) and clean
>>>> make, *both* named and un-named sessions work for me on Arch Linux.
>>>>
>>>
>>> Aha! Thanks for sleuthing this out.  So the problem lies in changes to
>>> the python.el distributed with Emacs.  I don't suppose we can ask
>>> whoever made these changes to python.el to fix the breakage they've
>>> caused in Org-mode?
>>>
>>> Thanks,
>>>
>>
>> Please give me some time still to investigate. Still doubt it's python.el
>> But if yes, probably will be able to tell more.
>
> Possibly, but know that for me it works with one Emacs version and not
> another, both using the same git version of Org and same minimal
> config/setup/test file. Perhaps those affected here should post their
> Emacs versions?

Worked for me last week with emacs 24.2.1 and org 8.0-pre
(release_8.0-pre-54-gb5a853. Not working now with emacs 24.3.1 and org
8.0-pre (release_8.0-pre-152-g42e1a6

>
>
> John
>
>>
>> Best,
>>
>> Andreas
>>
>

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

* Re: python sessions
  2013-03-25 17:27                                           ` Andreas Röhler
  2013-03-25 17:41                                             ` John Hendy
@ 2013-03-25 19:30                                             ` Ivan Andrus
  1 sibling, 0 replies; 217+ messages in thread
From: Ivan Andrus @ 2013-03-25 19:30 UTC (permalink / raw)
  To: emacs-orgmode

On Mar 25, 2013, at 11:27 AM, Andreas Röhler <andreas.roehler@easy-emacs.de> wrote:
> Am 25.03.2013 17:43, schrieb Eric Schulte:
>> John Hendy <jw.hendy@gmail.com> writes:
>> 
>>> On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn <istazahn@gmail.com> wrote:
>>>> On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte <schulte.eric@gmail.com> wrote:
>>>>> John Hendy <jw.hendy@gmail.com> writes:
>>>>> 
>>>>>> On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>>>>>>> Eric Schulte <schulte.eric@gmail.com> wrote:
>>>>>>> 
>>>>>>>>> 
>>>>>>>>> From participating in evaluating code throughout the discussion and
>>>>>>>>> catching the comments throughout, I'd say yes, at least in terms of
>>>>>>>>> how other babel languages function. In other words =#+begin_src R
>>>>>>>>> :session foo= creates an R session named "foo" whereas doing the same
>>>>>>>>> with =python= instead of =R= does not yield a named session.
>>>>>>>>> 
>>>>>>>>> From what others experienced, however, the functionality was working
>>>>>>>>> correctly (results were persistent across blocks and two differently
>>>>>>>>> names blocks created two different sessions), just not named
>>>>>>>>> correctly.
>>>>>>>>> 
>>>>>>>> 
>>>>>>>> See the cond form starting at line 169 in ob-python.el.  Different
>>>>>>>> session functionality is used based on the `org-babel-python-mode'
>>>>>>>> variable, and on the version of Emacs in use (prior to 24.1 or not).
>>>>>>>> 
>>>>>>>> The branch taken when `org-babel-python-mode' equals 'python is
>>>>>>>> certainly broken, as it never saves the name of the newly created
>>>>>>>> buffer, so session re-use and use of multiple named sessions probably
>>>>>>>> works only when `org-babel-python-mode' equals 'python-mode.
>>>>>>>> 
>>>>>>> 
>>>>>>> That's me: org-babel-python-mode's value is python, so it's no wonder
>>>>>>> it's broken given what Eric says. I'm on emacs 24.3.50 where there is
>>>>>>> python.el but no python-mode.el. I tried the "cheap" workaround of
>>>>>>> switching the value to python-mode, but that does a (require
>>>>>>> 'python-mode) somewhere, so that option is out as well.
>>>>>> 
>>>>>> I'm on Emacs 24.3.1 and have no python-mode.el, either (only
>>>>>> python.el). My setup is working correctly (again, with the caveat of
>>>>>> not having named sessions).
>>>>>> 
>>>>> 
>>>>> It sounds like we have the same setup, and the following un-named
>>>>> session example does not work for me.  The first code block evaluates
>>>>> successfully, but it doesn't appear to be having any impact on the
>>>>> default session (e.g., in the *Python* buffer).
>>>>> 
>>>>>    Returns the value of x as expected.
>>>>> 
>>>>>    #+begin_src python :session
>>>>>      x = 1
>>>>>      return x
>>>>>    #+end_src
>>>>> 
>>>>>    #+RESULTS:
>>>>>    : 1
>>>>> 
>>>>>    #+begin_src python :session
>>>>>      return x
>>>>>    #+end_src
>>>>> 
>>>>>    #+RESULTS:
>>>>> 
>>>>> The second code block /should/ have access to the x variable defined
>>>>> previous, but instead it throws an error because x is undefined.
>>>>> 
>>>>> Currently I'd say session support for python is completely broken.
>>>> 
>>>> As of this morning I've joined the "it does not work" crowd. Python
>>>> sessions worked for me last week, but are now completely broken for me
>>>> in the way Eric and others describe.
>>> 
>>> Interesting... checked out back to that commit
>>> (eff59a15d76647ce8282626b9eb463dc3706d56e) and it still doesn't work.
>>> On a whim, I checked my pacman log (Arch's install system) and
>>> coincidentally on Mar 20 /after/ I wrote that post in which things
>>> work, I ran a system package update.
>>> 
>>> $ grep -i emacs /var/log/pacman.log
>>> 
>>> [2013-03-20 12:51] upgraded emacs (24.2-4 -> 24.3-1)
>>> 
>>> Using the Arch Rollback Machine, I downloaded Emacs 24.2.4 and
>>> downgraded (also required downgrading imageMagick from 6.8.3.10 ->
>>> 6.8.2.3). Now it works again (refer to the reproducible example from
>>> the mailing list post):
>>> - http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68238.html
>>> 
>>> Eric, your example fails for me. I get:
>>> 
>> 
>> Yes, because my example only works in external (non session) execution
>> with the current buggy code, where as your example works with session
>> execution in the old working code.
>> 
>>> 
>>>>>> x = 1
>>>>>> return x
>>>  File "<stdin>", line 1
>>> SyntaxError: 'return' outside function
>>> 
>>> This works, hoever:
>>> 
>>> #+begin_src python :session
>>>      x = 1
>>>      x
>>> #+end_src
>>> 
>>> #+RESULTS:
>>> : 1
>>> 
>>> #+begin_src python :session
>>>      x
>>> #+end_src
>>> 
>>> #+RESULTS:
>>> : 1
>>> 
>>> So, with emacs 24.2.4 and current Org-mode (pulled just now) and clean
>>> make, *both* named and un-named sessions work for me on Arch Linux.
>>> 
>> 
>> Aha! Thanks for sleuthing this out.  So the problem lies in changes to
>> the python.el distributed with Emacs.  I don't suppose we can ask
>> whoever made these changes to python.el to fix the breakage they've
>> caused in Org-mode?
>> 
>> Thanks,
>> 
> 
> Please give me some time still to investigate. Still doubt it's python.el
> But if yes, probably will be able to tell more.

I think 24.3 is where they changed python.el to fgallina's python.el.  So I'd be 
willing to bet that it _is_ the problem since it's a complete rewrite and many 
things changed.

-Ivan

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

* Re: python sessions
  2013-03-24 18:41                                   ` Nick Dokos
@ 2013-03-25 20:46                                     ` Andreas Röhler
  2013-03-25 21:37                                       ` Eric Schulte
  0 siblings, 1 reply; 217+ messages in thread
From: Andreas Röhler @ 2013-03-25 20:46 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Ivan Andrus, Bastien, emacs-orgmode, Eric Schulte

Am 24.03.2013 19:41, schrieb Nick Dokos:
>>>


running into this, func def seems missing:



Debugger entered--Lisp error: (void-function org-babel-result-cond)
   (org-babel-result-cond result-params results (org-babel-python-table-or-string results))
   (if (string= (substring org-babel-python-eoe-indicator 1 -1) results) nil (org-babel-result-cond result-params results (org-babel-python-table-or-string results)))
   (unless (string= (substring org-babel-python-eoe-indicator 1 -1) results) (org-babel-result-cond result-params results (org-babel-python-table-or-string results)))
   (lambda (results) (unless (string= (substring org-babel-python-eoe-indicator 1 -1) results) (org-babel-result-cond result-params results 
(org-babel-python-table-or-string results))))("Traceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\nNameError: name 'foo' is not defined\nbye")
   (let* ((send-wait (lambda nil (comint-send-input nil t) (sleep-for 0 5))) (dump-last-value (lambda (tmp-file pp) (mapc (lambda (statement) (insert statement) (funcall 
send-wait)) (if pp (list "import pprint" (format "open('%s', 'w').write(pprint.pformat(_))" ...)) (list (format "open('%s', 'w').write(str(_))" ...)))))) (input-body 
(lambda (body) (mapc (lambda (line) (insert line) (funcall send-wait)) (split-string body "[ \n]")) (funcall send-wait)))) ((lambda (results) (unless (string= (substring 
org-babel-python-eoe-indicator 1 -1) results) (org-babel-result-cond result-params results (org-babel-python-table-or-string results)))) (case result-type (output 
(mapconcat (function org-babel-trim) (butlast (org-babel-comint-with-output (session org-babel-python-eoe-indicator t body) (funcall input-body body) (funcall send-wait) 
(funcall send-wait) (insert org-babel-python-eoe-indicator) (funcall send-wait)) 2) "\n")) (value (let ((tmp-file (org-babel-temp-file "python-"))) 
(org-babel-comint-with-output (session org-babel-python-eoe-indicator nil body) (let (...) (funcall input-body body) (funcall dump-last-value tmp-file ...) (funcall 
send-wait) (funcall send-wait) (insert org-babel-python-eoe-indicator) (funcall send-wait))) (org-babel-eval-read-file tmp-file))))))
   org-babel-python-evaluate-session(#<buffer *Python*> "print(foo(100)) \nprint \"bye\"" output ("output" "replace"))
   (if session (org-babel-python-evaluate-session session body result-type result-params) (org-babel-python-evaluate-external-process body result-type result-params preamble))
   org-babel-python-evaluate(#<buffer *Python*> "print(foo(100)) \nprint \"bye\"" output ("output" "replace") nil)
   (let* ((session (org-babel-python-initiate-session (cdr (assoc :session params)))) (result-params (cdr (assoc :result-params params))) (result-type (cdr (assoc 
:result-type params))) (return-val (when (and (eq result-type (quote value)) (not session)) (cdr (assoc :return params)))) (preamble (cdr (assoc :preamble params))) 
(full-body (org-babel-expand-body:generic (concat body (if return-val (format "\nreturn %s" return-val) "")) params (org-babel-variable-assignments:python params))) (result 
(org-babel-python-evaluate session full-body result-type result-params preamble))) (org-babel-reassemble-table result (org-babel-pick-name (cdr (assoc :colname-names 
params)) (cdr (assoc :colnames params))) (org-babel-pick-name (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))
   org-babel-execute:python("print(foo(100)) \nprint \"bye\"" ((:comments . #1="") (:shebang . #1#) (:cache . "no") (:padline . #1#) (:noweb . "no") (:tangle . "no") 
(:exports . "results") (:results . "replace output") (:hlines . "no") (:padnewline . "yes") (:session) (:result-type . output) (:result-params "output" "replace") 
(:rowname-names) (:colname-names)))
   org-babel-execute-src-block(nil ("python" "print(foo(100)) \nprint \"bye\"" ((:comments . #1="") (:shebang . #1#) (:cache . "no") (:padline . #1#) (:noweb . "no") 
(:tangle . "no") (:exports . "results") (:results . "replace output") (:hlines . "no") (:padnewline . "yes") (:session) (:result-type . output) (:result-params "output" 
"replace") (:rowname-names) (:colname-names)) "" nil 0))
   org-babel-execute-src-block-maybe()
   org-babel-execute-maybe()
   org-babel-execute-safely-maybe()
   run-hook-with-args-until-success(org-babel-execute-safely-maybe)
   org-ctrl-c-ctrl-c(nil)
   call-interactively(org-ctrl-c-ctrl-c nil nil)

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

* Re: python sessions
  2013-03-25 20:46                                     ` Andreas Röhler
@ 2013-03-25 21:37                                       ` Eric Schulte
  2013-03-26  6:29                                         ` Andreas Röhler
  0 siblings, 1 reply; 217+ messages in thread
From: Eric Schulte @ 2013-03-25 21:37 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: emacs-orgmode

> running into this, func def seems missing:
>
> Debugger entered--Lisp error: (void-function org-babel-result-cond)

My guess is that you have a mixed install.  You are mostly running the
Org-mode which ships with Emacs (in which `org-babel-result-cond' is not
defined), but you are running the version of ob-python.el from the
master branch (which expects `org-babel-result-cond' to be defined).

This is an increasingly common problem.  Maybe the following can help.
http://orgmode.org/worg/org-faq.html#keeping-current-with-Org-mode-development


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

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

* Re: python sessions
  2013-03-25 21:37                                       ` Eric Schulte
@ 2013-03-26  6:29                                         ` Andreas Röhler
  2013-03-26 12:32                                           ` Eric Schulte
  0 siblings, 1 reply; 217+ messages in thread
From: Andreas Röhler @ 2013-03-26  6:29 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

Am 25.03.2013 22:37, schrieb Eric Schulte:
>> running into this, func def seems missing:
>>
>> Debugger entered--Lisp error: (void-function org-babel-result-cond)
>
> My guess is that you have a mixed install.  You are mostly running the
> Org-mode which ships with Emacs (in which `org-babel-result-cond' is not
> defined), but you are running the version of ob-python.el from the
> master branch (which expects `org-babel-result-cond' to be defined).
>
> This is an increasingly common problem.  Maybe the following can help.
> http://orgmode.org/worg/org-faq.html#keeping-current-with-Org-mode-development
>
>

Hmm, don't see there anything to change wrt to the issue.

Have in my init

(defun ar-load-feature-org-mode ()
   (interactive)
   (add-to-list 'load-path "MY_PATH/feature-org-mode")
   (add-to-list 'load-path "MY_PATH/feature-org-mode/lisp")
   (find-file "MY_PATH/feature-org-mode/lisp/ob-python.el")
   (load "MY_PATH/feature-org-mode/lisp/org-compat.el" nil t)
   (load "MY_PATH/feature-org-mode/lisp/ob-comint.el" nil t)
   (load "MY_PATH/feature-org-mode/lisp/ob-emacs-lisp.el" nil t)
   (load "MY_PATH/feature-org-mode/lisp/org.el" nil t)
   (load "MY_PATH/feature-org-mode/lisp/ob-eval.el" nil t)
   (load "MY_PATH/feature-org-mode/lisp/ob.el" nil t)
   (load "MY_PATH/feature-org-mode/lisp/ob-python.el")
   ;; (load "MY_PATH/feature-org-mode/testing/org-test-ob-consts.el" nil t)
   ;; (load "MY_PATH/feature-org-mode/testing/org-test.el" nil t)
   (load-this-directory "MY_PATH/feature-org-mode/lisp")
   (org-babel-do-load-languages
    'org-babel-load-languages
    '(
      (sh . t)
      (python . t))))

Maybe should unload existing org-mode first.
Checking for existing features yields:

org-agenda 	org-bbdb 	org-bibtex 	org-compat
org-docview 	org-entities 	org-exp 	org-exp-blocks
org-faces 	org-footnote 	org-gnus 	org-html
org-info 	org-infojs 	org-irc 	org-jsinfo
org-list 	org-loaddefs 	org-macs 	org-mew
org-mhe 	org-pcomplete 	org-rmail 	org-src
org-version 	org-vm 	org-w3m 	org-wl

;;;;;;;;

Thanks,

Andreas

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

* Re: python sessions
  2013-03-26  6:29                                         ` Andreas Röhler
@ 2013-03-26 12:32                                           ` Eric Schulte
  2013-03-26 21:41                                             ` Gary Oberbrunner
  0 siblings, 1 reply; 217+ messages in thread
From: Eric Schulte @ 2013-03-26 12:32 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: emacs-orgmode

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

> Am 25.03.2013 22:37, schrieb Eric Schulte:
>>> running into this, func def seems missing:
>>>
>>> Debugger entered--Lisp error: (void-function org-babel-result-cond)
>>
>> My guess is that you have a mixed install.  You are mostly running the
>> Org-mode which ships with Emacs (in which `org-babel-result-cond' is not
>> defined), but you are running the version of ob-python.el from the
>> master branch (which expects `org-babel-result-cond' to be defined).
>>
>> This is an increasingly common problem.  Maybe the following can help.
>> http://orgmode.org/worg/org-faq.html#keeping-current-with-Org-mode-development
>>
>
> Hmm, don't see there anything to change wrt to the issue.
>

The key is timing, i.e., the path to the *newest* version of Org-mode
must be at the front of the load-path before the first time Org-mode is
required.  I believe this link is the one I should have sent in my
previous email http://orgmode.org/manual/Installation.html.

Especially important is that

  (add-to-list 'load-path "~/path/to/orgdir/lisp")

is at the top of your .emacs.

> Have in my init
>

I don't see where you (require 'org) below, but unless it is always done
interactively and always done after calling your load-feature function,
you're probably out of luck.

>
>
> (defun ar-load-feature-org-mode ()
>   (interactive)
>   (add-to-list 'load-path "MY_PATH/feature-org-mode")
>   (add-to-list 'load-path "MY_PATH/feature-org-mode/lisp")
>   (find-file "MY_PATH/feature-org-mode/lisp/ob-python.el")
>   (load "MY_PATH/feature-org-mode/lisp/org-compat.el" nil t)
>   (load "MY_PATH/feature-org-mode/lisp/ob-comint.el" nil t)
>   (load "MY_PATH/feature-org-mode/lisp/ob-emacs-lisp.el" nil t)
>   (load "MY_PATH/feature-org-mode/lisp/org.el" nil t)
>   (load "MY_PATH/feature-org-mode/lisp/ob-eval.el" nil t)
>   (load "MY_PATH/feature-org-mode/lisp/ob.el" nil t)
>   (load "MY_PATH/feature-org-mode/lisp/ob-python.el")
>   ;; (load "MY_PATH/feature-org-mode/testing/org-test-ob-consts.el" nil t)
>   ;; (load "MY_PATH/feature-org-mode/testing/org-test.el" nil t)
>   (load-this-directory "MY_PATH/feature-org-mode/lisp")
>   (org-babel-do-load-languages
>    'org-babel-load-languages
>    '(
>      (sh . t)
>      (python . t))))
>
> Maybe should unload existing org-mode first.

It is not about "unloading", rather the goal is to *only* load the
newest Org-mode.

Best,

> 
> Checking for existing features yields:
>
> org-agenda 	org-bbdb 	org-bibtex 	org-compat
> org-docview 	org-entities 	org-exp 	org-exp-blocks
> org-faces 	org-footnote 	org-gnus 	org-html
> org-info 	org-infojs 	org-irc 	org-jsinfo
> org-list 	org-loaddefs 	org-macs 	org-mew
> org-mhe 	org-pcomplete 	org-rmail 	org-src
> org-version 	org-vm 	org-w3m 	org-wl
>
> ;;;;;;;;
>
> Thanks,
>
> Andreas

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

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

* Re: python sessions
  2013-03-26 12:32                                           ` Eric Schulte
@ 2013-03-26 21:41                                             ` Gary Oberbrunner
  2013-03-26 21:47                                               ` John Hendy
  2013-03-27  6:19                                               ` Andreas Röhler
  0 siblings, 2 replies; 217+ messages in thread
From: Gary Oberbrunner @ 2013-03-26 21:41 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1099 bytes --]

I did some further testing.  With my patch, my real org-mode python file is
now actually working.  There were a few gotchas I didn't understand about
session mode and python and matplotlib:

1. In session mode, you are essentially running an interactive python.
 (This is made explicit by my patch, which passes -i).
2. In interactive mode, blank lines are special: they indicate the end of
an indented block.  So you have to write your org-mode python a little
differently when using session mode.
3. matplotlib uses an "interactive" backend when started from an
interactive python (sensibly).  So you have to set the backend explicitly
when using session mode, or it hangs forever with no indication what's
wrong.
4. ob-python does not handle python errors at all in session mode: it
ignores them silently.  This makes it really hard to debug the python code.

I'd like to document #s 1-3; where should that go?
I'd like to work on a patch for #4; it seems like the only thing is to
search in the session buffer for likely error strings.  Is there any better
method anyone can think of?

-- 
Gary

[-- Attachment #2: Type: text/html, Size: 1324 bytes --]

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

* Re: python sessions
  2013-03-26 21:41                                             ` Gary Oberbrunner
@ 2013-03-26 21:47                                               ` John Hendy
  2013-03-27  6:19                                               ` Andreas Röhler
  1 sibling, 0 replies; 217+ messages in thread
From: John Hendy @ 2013-03-26 21:47 UTC (permalink / raw)
  To: Gary Oberbrunner; +Cc: emacs-orgmode

On Tue, Mar 26, 2013 at 4:41 PM, Gary Oberbrunner <garyo@oberbrunner.com> wrote:
> I did some further testing.  With my patch, my real org-mode python file is
> now actually working.  There were a few gotchas I didn't understand about
> session mode and python and matplotlib:
>
> 1. In session mode, you are essentially running an interactive python.
> (This is made explicit by my patch, which passes -i).
> 2. In interactive mode, blank lines are special: they indicate the end of an
> indented block.  So you have to write your org-mode python a little
> differently when using session mode.
> 3. matplotlib uses an "interactive" backend when started from an interactive
> python (sensibly).  So you have to set the backend explicitly when using
> session mode, or it hangs forever with no indication what's wrong.
> 4. ob-python does not handle python errors at all in session mode: it
> ignores them silently.  This makes it really hard to debug the python code.
>
> I'd like to document #s 1-3; where should that go?
> I'd like to work on a patch for #4; it seems like the only thing is to
> search in the session buffer for likely error strings.  Is there any better
> method anyone can think of?

You should probably create ob-doc-python:
- http://orgmode.org/tmp/worg/org-contrib/babel/languages.html

If you haven't contributed before:
- http://orgmode.org/worg/worg-git.html

Once you clone (after submitting ssh key) with =git clone
worg@orgmode.org:worg.git=, you'd create:

~/path/to/worg.git/org-contrib/babel/languages/ob-doc-python.org

There's a template at:

~/path/to/worg.git/org-contrib/babel/languages/ob-doc-template.org

Thanks for doing this! I can't believe there's no existing page for
Python on Worg. Maybe you can document more than just this, too :)


John

>
> --
> Gary

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

* Re: python sessions
  2013-03-26 21:41                                             ` Gary Oberbrunner
  2013-03-26 21:47                                               ` John Hendy
@ 2013-03-27  6:19                                               ` Andreas Röhler
  2013-03-30  7:19                                                 ` Andreas Röhler
  1 sibling, 1 reply; 217+ messages in thread
From: Andreas Röhler @ 2013-03-27  6:19 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: garyo

Am 26.03.2013 22:41, schrieb Gary Oberbrunner:
> I did some further testing.  With my patch, my real org-mode python file is
> now actually working.  There were a few gotchas I didn't understand about
> session mode and python and matplotlib:
>
> 1. In session mode, you are essentially running an interactive python.
>   (This is made explicit by my patch, which passes -i).
> 2. In interactive mode, blank lines are special: they indicate the end of
> an indented block.  So you have to write your org-mode python a little
> differently when using session mode.
> 3. matplotlib uses an "interactive" backend when started from an
> interactive python (sensibly).  So you have to set the backend explicitly
> when using session mode, or it hangs forever with no indication what's
> wrong.
> 4. ob-python does not handle python errors at all in session mode: it
> ignores them silently.  This makes it really hard to debug the python code.
>
> I'd like to document #s 1-3; where should that go?
> I'd like to work on a patch for #4; it seems like the only thing is to
> search in the session buffer for likely error strings.  Is there any better
> method anyone can think of?
>

AFAIU the error string is missing, because it's sent the wrong path-to-interpreter,
i.e. using shell-command.
Shell returns 0 or 1, not the Python errors.

Also the interactive spec is related. Usually Python shell as started from py-shell or run-python include this already.
When send from a python-mode, also the empty lines you mentioned and related stuff is treated.

Andreas

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

* Re: python sessions
  2013-03-27  6:19                                               ` Andreas Röhler
@ 2013-03-30  7:19                                                 ` Andreas Röhler
  0 siblings, 0 replies; 217+ messages in thread
From: Andreas Röhler @ 2013-03-30  7:19 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Gary Oberbrunner

Am 27.03.2013 07:19, schrieb Andreas Röhler:
> Am 26.03.2013 22:41, schrieb Gary Oberbrunner:
>> I did some further testing.  With my patch, my real org-mode python file is
>> now actually working.  There were a few gotchas I didn't understand about
>> session mode and python and matplotlib:
>>
>> 1. In session mode, you are essentially running an interactive python.
>>   (This is made explicit by my patch, which passes -i).
>> 2. In interactive mode, blank lines are special: they indicate the end of
>> an indented block.  So you have to write your org-mode python a little
>> differently when using session mode.
>> 3. matplotlib uses an "interactive" backend when started from an
>> interactive python (sensibl

y).  So you have to set the backend explicitly
>> when using session mode, or it hangs forever with no indication what's
>> wrong.
>> 4. ob-python does not handle python errors at all in session mode: it
>> ignores them silently.  This makes it really hard to debug the python code.
>>
>> I'd like to document #s 1-3; where should that go?
>> I'd like to work on a patch for #4; it seems like the only thing is to
>> search in the session buffer for likely error strings.  Is there any better
>> method anyone can think of?
>>
>
> AFAIU the error string is missing, because it's sent the wrong path-to-interpreter,
> i.e. using shell-command.
> Shell returns 0 or 1, not the Python errors.
>
> Also the interactive spec is related. Usually Python shell as started from py-shell or run-python include this already.
> When send from a python-mode, also the empty lines you mentioned and related stuff is treated.
>
> Andreas
>
>
>

That turned out not being the case. I'm quoting:

 > This is incorrect.  In session mode, there is one long-running python
 > interpreter session.  Emacs passes it code snippets, and it spits out
 > stdout and stderr (all mixed up: output from your program, the lines
 > themselves which get echoed, prompts, and error messages if any).  There is
 > never any "return" value since the python interpreter doesn't exit.  The
 > only way to handle errors in interactive mode AFAICS is to use approximate
 > regexes to look for errors, un-handled exceptions and so on.
 >

Cheers

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

end of thread, other threads:[~2013-03-30  7:18 UTC | newest]

Thread overview: 217+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-05 22:15 Handling errors in command line exporting of agenda? John Hendy
2011-08-05 23:34 ` suvayu ali
2011-08-05 23:35   ` suvayu ali
2011-08-08 18:12   ` John Hendy
2011-08-08 18:28     ` suvayu ali
2011-08-08 18:53       ` John Hendy
2011-08-08 18:59         ` suvayu ali
2011-08-08 19:48           ` John Hendy
2011-08-08 20:22             ` suvayu ali
2011-08-08 20:31               ` John Hendy
2011-08-08 20:33               ` Nick Dokos
2011-08-08 20:37             ` Nick Dokos
2011-08-08 20:54               ` John Hendy
2011-08-08 21:09                 ` Nick Dokos
2011-08-08 21:27                   ` John Hendy
2011-08-08 21:30               ` suvayu ali
2011-08-08 22:17                 ` Nick Dokos
2011-08-08 21:46             ` suvayu ali
  -- strict thread matches above, loose matches on Subject: below --
2013-03-19 21:40 python sessions Gary Oberbrunner
2013-03-20  0:04 ` John Hendy
2013-03-20  3:07   ` Nick Dokos
2013-03-20  6:44     ` Andreas Röhler
2013-03-20 12:54       ` Ista Zahn
2013-03-20 14:08         ` Nick Dokos
2013-03-20 14:28           ` Gary Oberbrunner
2013-03-20 17:21         ` Andreas Röhler
2013-03-20  7:08   ` Andreas Röhler
2013-03-20 15:38     ` John Hendy
2013-03-20 15:42       ` John Hendy
2013-03-20 16:06       ` Nick Dokos
     [not found]         ` <CAFChFygsUeBejEY6m2bSU0C5cjLYz0nUADH=s+BYxajfZ2sKKQ@mail.gmail.com>
2013-03-20 16:12           ` Fwd: " Gary Oberbrunner
2013-03-20 17:08         ` Andreas Röhler
2013-03-20 17:25           ` Nick Dokos
2013-03-20 17:54             ` John Hendy
2013-03-20 18:15               ` Nick Dokos
2013-03-20 18:32                 ` Ista Zahn
2013-03-20 18:39                   ` Nick Dokos
2013-03-20 18:43                   ` Andreas Röhler
2013-03-20 19:42                     ` Ista Zahn
2013-03-20 19:53                       ` Andreas Röhler
2013-03-20 20:12                         ` Ista Zahn
2013-03-20 20:25                           ` Gary Oberbrunner
2013-03-20 22:06                             ` Ista Zahn
2013-03-20 18:42                 ` Andreas Röhler
2013-03-20 19:01             ` Andreas Röhler
     [not found]       ` <CAFChFygPrhuHHyMo2Vk2_OdksWVB=oACA7jnOXN+itUNqh-nqw@mail.gmail.com>
     [not found]         ` <CA+M2ft9bO7DU61vVeYrhduVvkg1V6PMuiyvsOy5tNWuXcSUEpw@mail.gmail.com>
     [not found]           ` <CAFChFyhbeXE4HNLKA6Ubii+MtQwD7=4khAypa+--coZrQiJekA@mail.gmail.com>
2013-03-21  1:22             ` Gary Oberbrunner
2013-03-21  1:54               ` John Hendy
2013-03-21  1:56                 ` Gary Oberbrunner
2013-03-21  7:42                   ` Andreas Röhler
2013-03-21  7:43                     ` Bastien
2013-03-21  8:13                       ` Andreas Röhler
2013-03-23 22:07                         ` Eric Schulte
2013-03-24  1:29                           ` John Hendy
2013-03-24 22:59                             ` Eric Schulte
2013-03-25  2:38                               ` Nick Dokos
2013-03-25  2:59                                 ` John Hendy
2013-03-25  6:34                                   ` Andreas Röhler
2013-03-25 15:40                                   ` Eric Schulte
2013-03-25 15:55                                     ` John Hendy
2013-03-25 16:07                                       ` Eric Schulte
2013-03-25 16:41                                         ` Nick Dokos
2013-03-25 16:01                                     ` Ista Zahn
2013-03-25 16:23                                       ` John Hendy
2013-03-25 16:43                                         ` Eric Schulte
2013-03-25 17:27                                           ` Andreas Röhler
2013-03-25 17:41                                             ` John Hendy
2013-03-25 18:16                                               ` Ista Zahn
2013-03-25 19:30                                             ` Ivan Andrus
2013-03-24  7:47                           ` Andreas Röhler
2013-03-24 14:47                             ` John Hendy
2013-03-24 15:30                               ` Andreas Röhler
2013-03-24 16:58                               ` Nick Dokos
2013-03-24 16:59                                 ` John Hendy
2013-03-24 18:41                                   ` Nick Dokos
2013-03-25 20:46                                     ` Andreas Röhler
2013-03-25 21:37                                       ` Eric Schulte
2013-03-26  6:29                                         ` Andreas Röhler
2013-03-26 12:32                                           ` Eric Schulte
2013-03-26 21:41                                             ` Gary Oberbrunner
2013-03-26 21:47                                               ` John Hendy
2013-03-27  6:19                                               ` Andreas Röhler
2013-03-30  7:19                                                 ` Andreas Röhler
2012-10-31  6:12 Bug? R: Org babel block execution *drastically* slower than in ESS session directly John Hendy
2012-10-31 16:41 ` cberry
2012-10-31 17:18   ` John Hendy
2012-10-31 20:12     ` cberry
2012-10-31 20:23       ` John Hendy
2012-10-31 20:56         ` Thomas S. Dye
2012-10-31 23:00           ` Nick Dokos
2012-10-31 22:53         ` Nick Dokos
2012-11-01 14:53           ` John Hendy
2012-11-01 15:38             ` Nick Dokos
2012-11-01 18:17               ` John Hendy
2012-11-01 18:18               ` John Hendy
2012-11-01 18:48                 ` Nick Dokos
2012-11-14  3:27                   ` Aaron Ecay
2012-11-14  4:52                     ` John Hendy
2012-11-14  6:32                       ` Aaron Ecay
2012-11-14  8:28                         ` Thomas S. Dye
2012-11-14  8:35                           ` Andreas Leha
2012-11-16 15:45                             ` Eric Schulte
2012-11-16 17:47                               ` Andreas Leha
2012-11-16 19:00                                 ` John Hendy
2012-11-16 20:25                                 ` Achim Gratz
2012-11-17 17:12                                   ` Eric Schulte
2012-11-18  0:41                               ` Aaron Ecay
2012-11-18  0:57                                 ` Eric Schulte
2012-11-18  1:41                                   ` Aaron Ecay
2012-11-19  1:18                                     ` Eric Schulte
2012-11-19  5:11                                       ` Eric Schulte
2012-08-26 20:11 Alternate format for datetree c b
2012-08-27  1:16 ` John Hendy
2012-08-27  4:04   ` Nick Dokos
2012-08-27  6:08     ` John Hendy
2012-08-28  8:49       ` Ian Barton
2012-08-28 12:49         ` Nick Dokos
2012-08-28 12:50         ` Nick Dokos
2012-08-29  7:49           ` Ian Barton
     [not found]             ` <lists@manor-farm.org>
2012-08-29 14:17               ` Nick Dokos
2012-08-29 14:25             ` John Hendy
2012-08-29 20:01               ` Ian Barton
2012-09-06  7:46                 ` Ian Barton
2012-09-06  5:42       ` c b
2012-09-06  6:26         ` Nick Dokos
2012-09-06  7:00         ` Jambunathan K
2012-09-06 15:33         ` John Hendy
2012-09-06 16:08           ` Jonathan Leech-Pepin
2011-11-02  2:22 Pass LaTeX exporter option prior to \documentclass John Hendy
2011-11-02  2:43 ` suvayu ali
2011-11-02 10:30   ` suvayu ali
2011-11-03 17:48     ` John Hendy
2011-11-03 17:55       ` suvayu ali
2011-11-03 18:07         ` John Hendy
2011-11-04 17:29           ` Nick Dokos
2011-11-04 19:29             ` suvayu ali
2011-10-19 14:54 Prompt for time when clocking in? Nathan Neff
2011-10-19 15:12 ` John Hendy
2011-10-19 15:35   ` Nick Dokos
2011-10-20 16:15     ` Nathan Neff
2011-10-20 17:09       ` Nick Dokos
2011-10-20 17:44         ` Nathan Neff
2011-10-19 16:37 ` Bernt Hansen
2011-06-15 10:29 BUG: Newest org-mode interferes with desktop save Rainer M Krug
2011-06-15 16:49 ` Eric Schulte
2011-06-15 17:35   ` Nick Dokos
2011-06-15 18:23     ` Rainer M Krug
2011-06-15 18:21   ` Rainer M Krug
2011-06-15 18:31     ` Eric Schulte
2011-06-15 18:59       ` Rainer M Krug
2011-06-15 22:40         ` Nick Dokos
2011-06-16  7:15           ` Rainer M Krug
2011-06-16  7:29             ` Jambunathan K
2011-06-16  8:22               ` Rainer M Krug
2011-05-24 15:54 Passing font size to exported LaTeX table John Hendy
2011-05-24 16:44 ` Sebastien Vauban
2011-05-24 18:57   ` John Hendy
2011-05-24 19:25     ` Nick Dokos
2011-05-24 19:31       ` John Hendy
2011-05-24 19:58         ` Thomas S. Dye
2011-05-24 20:42           ` Nick Dokos
2011-05-24 21:12             ` Nick Dokos
2011-05-24 21:19               ` Nick Dokos
2011-05-25  7:22                 ` Thomas S. Dye
2011-05-27  0:58                   ` suvayu ali
2011-05-27  6:46                     ` Thomas S. Dye
2011-05-27  7:07                       ` suvayu ali
2011-05-27 16:17                         ` Thomas S. Dye
2011-05-27 16:50                           ` Suvayu Ali
2011-05-27 17:37                             ` Thomas S. Dye
2011-05-27 18:30                               ` Suvayu Ali
2011-05-27 21:25                                 ` Thomas S. Dye
2011-05-28  7:17                                   ` Sebastien Vauban
2011-05-28 10:14                                     ` Suvayu Ali
2011-05-28 15:21                                       ` Nick Dokos
2011-05-28 18:10                                         ` Suvayu Ali
2011-06-01 18:50                                   ` Nick Dokos
2011-06-01 19:08                                     ` Suvayu Ali
2011-06-10 22:31                                       ` Suvayu Ali
2011-06-13  1:38                                         ` suvayu ali
2011-06-13  1:52                                         ` Nick Dokos
2011-06-13  2:40                                           ` Suvayu Ali
2011-06-13  3:29                                             ` Nick Dokos
2011-06-13  3:45                                           ` Thomas S. Dye
2011-06-13  4:27                                             ` Nick Dokos
2011-06-13  4:56                                               ` Suvayu Ali
2011-06-13  5:29                                                 ` Nick Dokos
2011-06-13  6:42                                                   ` Suvayu Ali
2011-05-24 20:06         ` Nick Dokos
2011-05-24 19:42       ` Sebastien Vauban
2010-08-21 19:30 Gnuplot unevenly spaced non-numeric data plot? John Hendy
2010-08-21 20:35 ` Eric S Fraga
2010-08-21 20:41 ` Nick Dokos
2010-08-21 21:11   ` John Hendy
2010-08-21 22:41     ` John Hendy
2010-08-21 23:17       ` Nick Dokos
2010-08-23 14:22         ` John Hendy
2010-08-23 15:16           ` Nick Dokos
     [not found]             ` <AANLkTi=WTLBL1Giq0GTrjCo-A1s=iP4u1Qxn57cH-xnB@mail.gmail.com>
     [not found]               ` <AANLkTimSVm=-2o39CQ9wSMT276Dee4Tuj9jLKJH-c+cd@mail.gmail.com>
2010-08-24  2:44                 ` [For Worg?] " John Hendy
2010-08-24  5:25                   ` suvayu ali
2010-08-24  5:56               ` Nick Dokos
2010-08-25  0:32                 ` Eric Schulte
2010-08-25  1:06                   ` John Hendy
2010-08-25  1:35                     ` Eric Schulte
2010-08-25 18:38                       ` John Hendy
2010-08-25 18:52                         ` Eric Schulte
     [not found]         ` <jw.hendy@gmail.com>
2012-03-12 21:13           ` Beamer specific setupfile? John Hendy
2012-03-12 21:48             ` Nick Dokos
2012-03-12 22:09               ` John Hendy
2012-03-12 22:30                 ` Nick Dokos
2012-03-12 22:44                   ` Nick Dokos
2012-03-13  5:02                     ` John Hendy
2012-03-13  5:46                       ` Nick Dokos
2012-04-25  8:16                         ` Eric Fraga
2012-04-25  8:59                           ` Eric Fraga
2012-03-12 23:01                 ` Nick Dokos
2012-03-12 21:51             ` Nick Dokos
2012-03-12 22:05             ` Nick Dokos

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