[O] Problems with including ledger files in org-babel

2014-05-12 Thread Adam Turoff
I'm trying to prepare a ledger report by including a ledger file with babel:

#+begin_src ledger :cmdline print
!include ledger.lgr
#+end_src

#+RESULTS:

And each time I try and eval the buffer, the results come back blank.
 org-confirm-babel-evaluate works perfectly fine with other blocks, like
sh, and it works for ledger blocks embedded in org source blocks (described
in the tutorial), but I can't get !include to load an external file.

I'm trying to include some ledger content copied from
http://orgmode.org/worg/org-tutorials/weaving-a-budget.html , and the
'print' option in ledger should always emit some output.

Is this a known issue that hasn't been updated in that tutorial?  Is there
some other way to include external ledger files into org-babel?

This is in org version 8.2.6-14-g063c8b-elpa.

Thanks,

-- Adam


Re: [O] org-ref code

2014-05-12 Thread Andreas Reuleaux
John Kitchin  writes:


> C-c ] should be bound by default to org-ref-insert-cite-link. It is defined
> in a hook function in line 104 of org-ref.org.
>
> I made a custom variable to store the key-binding, but I realized it
> probably doesn't help, since the binding
>
>
>>
>> 1. C-u on it does not give me a choice of citation method
>>
>
> If you type C-u M-x  org-ref-insert-cite-link
>
> do you get a choice?
>
> I just tried this on a fresh pull and it does work for me. I am not sure
> why this wouldn't work for you.  Do you tangle the .el file from the .org
> file? I have this code somewhere else to build it when needed:


I can confirm that C-c ] and C-u C-c ]
work fine for me.

my setup if fairly simple (with org-ref.el tangled from org-ref.org)

  (require 'org-ref)

  (custom-set-variables
   '(org-ref-bibliography-notes "notes.org")
   '(org-ref-default-bibliography  (list "refs.bib"))
   ;; '(org-ref-pdf-directory "...")
   ;; '(org-ref-default-citation-link "...")
   ;; '(org-ref-insert-cite-key "...")
   )

looking forward to discover more of org-ref.

FWIW, I was using textcite:... (with biblatex) as well, helped myself by
just inserting a cite:... and then changing the link with C-c C-l from
cite to textcite. But I really need read up on all those different
citations commands once more, maybe textcite is not really necessary?
Could I add it somehow to the list of choices available in "C-u C-c ]" ?
(I realized there are citetext, citep*, citep as well, that I yet have
to discover).

By the way: the org-ref.org literate programming docs are fine
for someone interested in the gory details / relatively experienced.
Ist there a simpler document just describing its usage - that
you would hand out to your chemistry students e. g. ?

Somehting maybe explaining the differences from the other approaches
that can be found e g in 

  
http://tincman.wordpress.com/2011/01/04/research-paper-management-with-emacs-org-mode-and-reftex/

  
http://www-public.it-sudparis.eu/~berger_o/weblog/2012/03/23/how-to-manage-and-export-bibliographic-notesrefs-in-org-mode/

Thanks for org-ref.

-Andreas




Re: [O] [babel][PATCHES] ob-R patches for review

2014-05-12 Thread Rainer M Krug
Eric Schulte  writes:

> Rainer M Krug  writes:
>
>> Bastien  writes:
>>
>>> Hi Rainer,
>>>
>>> Rainer M Krug  writes:
>>>
 I'll look at it again tomorrow and let you know as I made some changes
 since then. Do you prefer one patch to several?
>>>
>>> Up to Eric's taste -- but in general I think a series of patches
>>> is better, it allows you to isolate and fix conflicts more easily.
>>
>
> I agree, multiple patches make future maintenance easier.
>

OK - I'll do so.

A little bit off-topic, is there a "git way" of splitting one patch into
several patches, if it was a single commit?

>>> I missed some previous discussion in this thread.  Are these patches
>>> ready to be applied as is?
>>>
>>
>>
>> IMO, the patches hard coded behaviors that would better be customizable
>> and optional. 
>>
>> Rainer and I had some back and forth about this -- see the thread.
>
> With respect to these points, I'm inclined to agree with Charles in the
> following.

OK - see further comments below.

>
>> All you have to do is add this:
>>
>> (defvar org-babel-R-assign-elisp-function 'org-babel-R-assign-elisp
>>   "Name or definition of function to handle `:var name=value'
>> header args."
>>   )
>>
>> and change one line in org-babel-variable-assignments:R from
>>
>> (org-babel-R-assign-elisp to
>>
>>(funcall org-babel-R-assign-elisp-function
>>
>> and the user can provide her own elisp assignment function.
>>
>> This gives users who want special behavior like creating something
>> other than a data.frame the option of providing their own function.
>
> Would such a customization variable be difficult to add to your patches?

I don't think so - I'll look into it.

> If not would you mind submitting a version of the patches split into
> multiple commits with as much of the hard-coded R code as feasible
> placed into customizable variables along the lines of the
> `org-babel-R-assign-elisp-function' variable suggested by Charles.  

I am thinking of actually not providing the R code in org-variables, but
to put them into R files and to source them. By doing this, the
customization could be done in R, which will be much easier for R users
then to customize emacs variables.

These would be sourced and stored into an environment "org:functions",
using the same approach as ESS is using to store functions into an
environment "ESSR". I would then put the variables transfered into
"org:variables". These environments would only exist in the search path,
and not overwrite any user set objects in R.

As it needs to be sourced for each R process once, the right place would
be in  org-babel-R-initiate-session - correct?

What would be the best place to put these R files? 

> One lesson I've certainly learned from the Org-mode mailing list is
> that you can't anticipate all of the ways that your code will be used,
> so up-front customizability generally pays off.

OK - point taken - and I am definitely one of those users who thinks
about unusual usages of certain features.

Cheers,

Rainer

>
> Thanks,
> Eric
>
>>
>> Thanks
>>
>> 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 :   +33 - (0)9 58 10 27 44

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

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgpU3s2mZjASa.pgp
Description: PGP signature


Re: [O] Org-hide face leaking out to org-columns view

2014-05-12 Thread Nikolai Weibull
On Sat, May 10, 2014 at 1:35 PM, Nikolai Weibull  wrote:
> Hi!
>
> It seems that if you use
>
> #+STARTUP: indent
>
> the org-hide face used for the hidden stars will remain when using the
> org-columns view, resulting on, in my case, white on gray.

To clarify, this leaks out over the whole item, not just the stars,
making the whole item column hard to read.

> Is there a workaround to this that I’m not thinking of?



Re: [O] Problems with including ledger files in org-babel

2014-05-12 Thread Eric S Fraga
On Monday, 12 May 2014 at 03:27, Adam Turoff wrote:
> I'm trying to prepare a ledger report by including a ledger file with babel:
>
> #+begin_src ledger :cmdline print
> !include ledger.lgr
> #+end_src

I would suggest you try specifying the full path to the ledger file,
i.e. one starting with / (assuming you're using Linux, say).  Babel
executes in another directory potentially and this could be the source
of the problem.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-949-g751506



Re: [O] [babel][PATCHES] ob-R patches for review

2014-05-12 Thread Suvayu Ali
On Mon, May 12, 2014 at 10:33:48AM +0200, Rainer M Krug wrote:
> Eric Schulte  writes:
> 
> > Rainer M Krug  writes:
> >
> >> Bastien  writes:
> >>
> >>> Hi Rainer,
> >>>
> >>> Rainer M Krug  writes:
> >>>
>  I'll look at it again tomorrow and let you know as I made some changes
>  since then. Do you prefer one patch to several?
> >>>
> >>> Up to Eric's taste -- but in general I think a series of patches
> >>> is better, it allows you to isolate and fix conflicts more easily.
> >>
> >
> > I agree, multiple patches make future maintenance easier.
> >
> 
> OK - I'll do so.
> 
> A little bit off-topic, is there a "git way" of splitting one patch into
> several patches, if it was a single commit?

Do an interactive rebase, and amend.

Say this is the commit graph:

  A---B---C---D

You want to split B.  Then you do:

  $ git rebase -i B~

In the editor that pops out, you choose `edit' for B, leave the others
unchanged.  Then git will checkout A for you, and wait for you to edit.
Now you can apply patch B in parts (by hand).

  $ git show B > patch
  $ # apply part1 of patch (assuming you are breaking it into 2 parts)
  $ git commit -a -m "Message for part1" # lets say this is B1
  $ # apply rest of the patch
  $ git commit -a -m "Message for the rest" # and this is B2
  $ git rebase --continue

Now your commit graph should be like this:

  A---B1---B2---C---D

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] [babel][PATCHES] ob-R patches for review

2014-05-12 Thread Rainer M Krug
Suvayu Ali  writes:

> On Mon, May 12, 2014 at 10:33:48AM +0200, Rainer M Krug wrote:
>> Eric Schulte  writes:
>> 
>> > Rainer M Krug  writes:
>> >
>> >> Bastien  writes:
>> >>
>> >>> Hi Rainer,
>> >>>
>> >>> Rainer M Krug  writes:
>> >>>
>>  I'll look at it again tomorrow and let you know as I made some changes
>>  since then. Do you prefer one patch to several?
>> >>>
>> >>> Up to Eric's taste -- but in general I think a series of patches
>> >>> is better, it allows you to isolate and fix conflicts more easily.
>> >>
>> >
>> > I agree, multiple patches make future maintenance easier.
>> >
>> 
>> OK - I'll do so.
>> 
>> A little bit off-topic, is there a "git way" of splitting one patch into
>> several patches, if it was a single commit?
>
> Do an interactive rebase, and amend.
>
> Say this is the commit graph:
>
>   A---B---C---D
>
> You want to split B.  Then you do:
>
>   $ git rebase -i B~
>
> In the editor that pops out, you choose `edit' for B, leave the others
> unchanged.  Then git will checkout A for you, and wait for you to edit.
> Now you can apply patch B in parts (by hand).
>
>   $ git show B > patch
>   $ # apply part1 of patch (assuming you are breaking it into 2 parts)
>   $ git commit -a -m "Message for part1" # lets say this is B1
>   $ # apply rest of the patch
>   $ git commit -a -m "Message for the rest" # and this is B2
>   $ git rebase --continue
>
> Now your commit graph should be like this:
>
>   A---B1---B2---C---D
>
> Hope this helps,

Definitely. Sounds perfect. I will look at it a little bit later and
come back if I have any problems.

Thanks,

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 :   +33 - (0)9 58 10 27 44

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

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgpRruyucpFPf.pgp
Description: PGP signature


[O] Using Emacs, Org-mode and R for Research Writing in Social Sciences

2014-05-12 Thread Vikas Rawal
I have been using Org for writing research papers for a while, gradually 
improving my set up to be able to exactly produce the output I want. In this 
process, I have benefited greatly not only from the resources available on the 
Org-mode website but also from various people who generously provided solutions 
to my numerous queries on this mailing list. I felt that it may be of some use 
if I put together all the pieces and document what I was doing.

I have put the draft for comments at: 
https://github.com/vikasrawal/orgpaper/blob/master/orgpapers.org

It has been written keeping in mind my graduate students as examples of 
potential beneficiaries of the documentation. Which means that I had somewhat 
specific requirements in mind. Also, I have tried to write it for somebody who 
is not familiar with emacs/org-mode and would like to start using the system 
before investing time in learning the nitty-gritties. That is how I have always 
managed to entice my students to using free software. I give them a working 
setup that they can use, and slowly help them learn the insides of it. So the 
focus is not to provide all the possible options and different ways of 
customising the output but to provide a specific usable solution. 

For whatever it is worth, here it is. Pointers to any errors as well as  
comments for improving it would be greatly appreciated. Also, I would be happy 
to contribute it to Worg, if people consider it useful.

With thanks to the Org community,

Vikas






[O] Bug: Cannot export this file as HTML. [8.2.6 (8.2.6-18-gaaae4a-elpa @ /home/kuanyui/.emacs.d/elpa/org-20140512/)]

2014-05-12 Thread kuanyui
102054.619355 #呃...我不太確定該怎麼算,不過跟上面的值好像蠻接近的。

* 第三部份
** Use the Time-Sequence-Graph(Stevens) plotting tool to view the sequence 
number versus time plot of segments being sent from the client to the 
gaia.cs.umass.edu server. Can you identify where TCP's slowstart phase begins 
and ends, and where congestion avoidance takes over? Comment on ways in which 
the measured data differs from the idealized behavior of TCP that we've studied 
in the text.

** Answer each of two questions above for the trace that you have gathered when 
you transferred a file from your computer to gaia.cs.umass.edu
* Footnotes

[fn:1] 

[fn:2] 

[fn:3] 到底 buffer 是限制封包長度還是數量啊

[fn:4] 隨機的?

[fn:5] 需要扣掉嗎?!

[fn:6] 


kuanyui 20140512 GMT+8 

Emacs  : GNU Emacs 24.3.90.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.4)
 of 2014-04-13 on kuanyui-laptop.site
Package: Org-mode version 8.2.6 (8.2.6-18-gaaae4a-elpa @ 
/home/kuanyui/.emacs.d/elpa/org-20140512/)

current state:
==
(setq
 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)
 outline-minor-mode-hook '(wikipedia-outline-magic-keys)
 org-latex-classes '(("article"
  
"\n\\documentclass[12pt,a4paper]{article}\n\\usepackage[margin=2cm]{geometry}\n\\usepackage{fontspec}\n\\setromanfont{cwTeXMing}\n\n\\usepackage{etoolbox}
  % 
Quote部份的字型設定\n\\newfontfamily\\quotefont{cwTeXFangSong}\n\\AtBeginEnvironment{quote}{\\quotefont\\small}\n\n\\setmonofont[Scale=0.9]{Courier}
 % 等寬字型 [FIXME] Courier 中文會爛掉!\n\\font\\cwSong=''cwTeXFangSong'' at 
10pt\n%\\font\\cwHei=''cwTeXHeiBold'' at 10p 
%不知為何會爆掉\n\\font\\cwYen=''cwTeXYen'' at 10pt\n\\font\\cwKai=''cwTeXKai'' at 
10pt\n\\font\\cwMing=''cwTeXMing'' at 10pt\n\\font\\wqyHei=''文泉驛正黑'' at 
10pt\n\\font\\wqyHeiMono=''文泉驛等寬正黑'' at 10pt\n\\font\\wqyHeiMicro=''文泉驛微米黑'' at 
10pt\n\\XeTeXlinebreaklocale ``zh''\n\\XeTeXlinebreakskip = 0pt plus 
1pt\n\\linespread{1.36}\n\n\\usepackage{multicol}\n\n% [FIXME] ox-latex 
的設計不良導致hypersetup必須在這裡插入\n\\usepackage{hyperref}\n\\hypersetup{\n  
colorlinks=true, %把紅框框移掉改用字體顏色不同來顯示連結\n  linkcolor=[rgb]{0,0.37,0.53},\n  
citecolor=[rgb]{0,0.47,0.68},\n  filecolor=[rgb]{0,0.37,0.53},\n  
urlcolor=[rgb]{0,0.37,0.53},\n  pagebackref=true,\n  linktoc=all,}\n"
  ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" 
. "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}") 
("\\paragraph{%s}" . "\\paragraph*{%s}")
  ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
 ("beamer"
  
"\n\\documentclass[presentation]{beamer}\n\\usepackage{fontspec}\n\\setromanfont{wqyHeiMicro}\n\n\\setmonofont[Scale=0.9]{Courier}
 % 等寬字型 [FIXME] Courier 中文會爛掉!\n\\font\\cwSong=''cwTeXFangSong'' at 
10pt\n%\\font\\cwHei=''cwTeXHeiBold'' at 10p 
%不知為何會爆掉\n\\font\\cwYen=''cwTeXYen'' at 10pt\n\\font\\cwKai=''cwTeXKai'' at 
10pt\n\\font\\cwMing=''cwTeXMing'' at 10pt\n\\font\\wqyHei=''文泉驛正黑'' at 
10pt\n\\font\\wqyHeiMono=''文泉驛等寬正黑'' at 10pt\n\\font\\wqyHeiMicro=''文泉驛微米黑'' at 
10pt\n\\XeTeXlinebreaklocale ``zh''\n\\XeTeXlinebreakskip = 0pt plus 
1pt\n\\linespread{1.36}\n\n"
  ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" 
. "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}") 
("\\paragraph{%s}" . "\\paragraph*{%s}")
  ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
 )
 org-latex-default-packages-alist '(("" "hyperref" nil) ("AUTO" "inputenc" t) 
("" "fixltx2e" nil) ("" "graphicx" t) ("" "longtable" nil)
("" "float" nil) ("" "wrapfig" nil) ("" 
"rotating" nil) ("normalem" "ulem" t) ("" "amsmath" t)
("" "textcomp" t) ("" "marvosym" t) ("" 
"wasysym" t) ("" "amssymb" t) "\\tolerance=1000")
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '

Re: [O] Using Emacs, Org-mode and R for Research Writing in Social Sciences

2014-05-12 Thread Suvayu Ali
Hi Vikas,

On Mon, May 12, 2014 at 02:57:19PM +0200, Vikas Rawal wrote:
> 
> I have put the draft for comments at: 
> https://github.com/vikasrawal/orgpaper/blob/master/orgpapers.org

Firstly a thank you for writing it.  I gave it a quick cursory glance,
seems nice and thorough, and very appropriate for your target
audience :).

> For whatever it is worth, here it is. Pointers to any errors as well
> as comments for improving it would be greatly appreciated. Also, I
> would be happy to contribute it to Worg, if people consider it useful.

Some comments: at places it seemed a bit too verbose, e.g. when you are
introducing some idea/technique.  I think it would be nice if you could
make it a bit more concise.  I also noticed a few things in the
formatting that looked LaTeX specific; e.g. \FloatBarrier after the
table on keybindings.  If you intend to include this in Worg, I think
you should remove these.  In fact you can explicitly target html.

That's it for now :).

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] org-ref code

2014-05-12 Thread Eric S Fraga
On Sunday, 11 May 2014 at 14:48, John Kitchin wrote:

[...]

> C-c ] should be bound by default to org-ref-insert-cite-link. It is defined
> in a hook function in line 104 of org-ref.org.

Yes.  It is.  

I don't use this binding.  I use evil mode and don't like chorded
commands.  I have org-ref-insert-cite-link bound to ", r" but that's
beside the point, in any case.

>> 1. C-u on it does not give me a choice of citation method
>
> If you type C-u M-x  org-ref-insert-cite-link
> do you get a choice?

No.  I get prompted for the expression to search for and then I get
prompted for an optional argument and the final text inserted in my org
buffer is \cite{}, not cite:

> I just tried this on a fresh pull and it does work for me. I am not sure
> why this wouldn't work for you.  Do you tangle the .el file from the .org
> file? I have this code somewhere else to build it when needed:

I do tangle and then eval-buffer just to make sure I have the right code
loaded.

>> 2. the link inserted "looks" like a link (it's blue) but there are
>>  actually no [[...]] characters surrounding it.
>>
> There are no [[...]]. The links work fine without them for me. Are they
> necessary for some reason? I can add them, but since they do not do
> anything but disappear in this case, I leave them out.  

Well, I obviously have something not quite configured properly in my
environment.  The cite: text is highlighted as a link in the org buffer
(as it should with org-highlight-links set) but is treated as simple
text when exported so that I simply get "cite:..." in the latex
output.  If I "C-c C-l" it and don't add a description, the org buffer
*looks* the same but the export works because org and/or the exporter
know that it's a link.

Is there some org variable I have not set that tells org to treat cite:
plain text as a link on export?  Obviously org already recognises it as
a link but the export doesn't...  org-link-protocols and org-link-types
look fine.

I am most puzzled... :(

By the way, in my use case, even if the above would work properly, it
would still definitely help if the [[...]] were inserted as I sometimes
use superscript indices and in those cases I do not want any whitespace
between the text and the citation that follows.  Anyway, this is
secondary.

thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-949-g751506



[O] Queestion concerning lists - was: [babel][PATCHES] ob-R patches for review

2014-05-12 Thread Rainer M Krug
Rainer M Krug  writes:

> Eric Schulte  writes:
>
>> Rainer M Krug  writes:
>>
>>> Bastien  writes:
>>>
 Hi Rainer,

 Rainer M Krug  writes:

> I'll look at it again tomorrow and let you know as I made some changes
> since then. Do you prefer one patch to several?

 Up to Eric's taste -- but in general I think a series of patches
 is better, it allows you to isolate and fix conflicts more easily.
>>>
>>
>> I agree, multiple patches make future maintenance easier.
>>
>
> OK - I'll do so.
>
> A little bit off-topic, is there a "git way" of splitting one patch into
> several patches, if it was a single commit?
>
 I missed some previous discussion in this thread.  Are these patches
 ready to be applied as is?

>>>
>>>
>>> IMO, the patches hard coded behaviors that would better be customizable
>>> and optional. 
>>>
>>> Rainer and I had some back and forth about this -- see the thread.
>>
>> With respect to these points, I'm inclined to agree with Charles in the
>> following.
>
> OK - see further comments below.
>
>>
>>> All you have to do is add this:
>>>
>>> (defvar org-babel-R-assign-elisp-function 'org-babel-R-assign-elisp
>>>   "Name or definition of function to handle `:var name=value'
>>> header args."
>>>   )
>>>
>>> and change one line in org-babel-variable-assignments:R from
>>>
>>> (org-babel-R-assign-elisp to
>>>
>>>(funcall org-babel-R-assign-elisp-function
>>>
>>> and the user can provide her own elisp assignment function.
>>>
>>> This gives users who want special behavior like creating something
>>> other than a data.frame the option of providing their own function.
>>
>> Would such a customization variable be difficult to add to your patches?
>
> I don't think so - I'll look into it.
>
>> If not would you mind submitting a version of the patches split into
>> multiple commits with as much of the hard-coded R code as feasible
>> placed into customizable variables along the lines of the
>> `org-babel-R-assign-elisp-function' variable suggested by Charles.  
>
> I am thinking of actually not providing the R code in org-variables, but
> to put them into R files and to source them. By doing this, the
> customization could be done in R, which will be much easier for R users
> then to customize emacs variables.
>
> These would be sourced and stored into an environment "org:functions",
> using the same approach as ESS is using to store functions into an
> environment "ESSR". I would then put the variables transfered into
> "org:variables". These environments would only exist in the search path,
> and not overwrite any user set objects in R.

I am working on it, but I have a question concerning strings and lists
in elisp.

In the function  org-babel-execute:R it says:

,
| (inside
|  (list (org-babel-expand-body:R body params graphics-file)))
`

I now want to convert "inside" to a comma separated string. I am doing
now the following:

,
| (replace-regexp-in-string "\n" ", " (format "%s" inside))
`

but this does not look elegant to me, as I am converting inside to a
string and then do a replace. There is the function mapconcat, but I
don't get it to work:

,
| (replace-regexp-in-string "\n" ", " (format "%s" inside))
| "( createOrgVariablesEnvironment(), plot(1))"
| 
| (mapconcat 'identity inside ", ")
| " createOrgVariablesEnvironment()
| plot(1)"
`

What am I missing?

Thanks,

Rainer

>
> As it needs to be sourced for each R process once, the right place would
> be in  org-babel-R-initiate-session - correct?
>
> What would be the best place to put these R files? 
>
>> One lesson I've certainly learned from the Org-mode mailing list is
>> that you can't anticipate all of the ways that your code will be used,
>> so up-front customizability generally pays off.
>
> OK - point taken - and I am definitely one of those users who thinks
> about unusual usages of certain features.
>
> Cheers,
>
> Rainer
>
>>
>> Thanks,
>> Eric
>>
>>>
>>> Thanks
>>>
>>> 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 :   +33 - (0)9 58 10 27 44

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

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgpuiLoTcs90g.pgp
Description: PGP signature


Re: [O] An org password manager

2014-05-12 Thread Colin Baxter

Dear Ramon,

Yes. The first URL gives the lisp code.

I could never get sensitive mode to turn on by default for files having
gpg or cpt extensions. Consequently, I just "M-X sensitive RET" for each
file. To remind me, I put "sensitive" at the beginning of the file. You
may have better luck.

Best wishes,

Colin.



> Dear Colin,
>
>
>
> On Sun, 11-05-2014, at 15:56, Colin Baxter  wrote:
>> Hi,
>>
>> You can ensure a gpg buffer doesn't leave any traces by using a
>> minor-mode called "sensitive" which disables backups and auto-save. The code 
>> is
>> available on the Internet, but I'll post it here if anyone is
>> interested.
>
> Thanks, I did not know about that, but I think google found it. Are you
> referring to
>
> http://anirudhsasikumar.net/blog/2005.01.21.html
>
> which was also mentioned in, say,
>
> http://stackoverflow.com/questions/482256/is-there-an-emacs-variable-to-turn-off-backup-of-files-with-a-specific-extension
>
>
> Best,
>
>
> R.
>
>
>>
>> Best wishes,
>>
>> Colin.
>>
>>
>>> Dear Jorge,
>>>
>>> Neat!! Thanks for providing the details.
>>>
>>> I've been using a somewhat similar approach with a lot less functionality
>>> for a few years, but as I reported in the org email list, something I find
>>> unsettling is that if an encrypted buffer is killed right when it is being
>>> opened (when you just typed the password ---sure, low probability, but not
>>> zero), part of the contents of the encrypted buffer are left, as plain
>>> text, in other buffer(s).
>>>
>>> I reported this here
>>>
>>> http://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00841.html
>>>
>>> and I still experience the problem (I just try it not to happen). Is
>>> this not affecting you at all? I'd have thought it would, since you are
>>> also using a timer to kill the buffer, and it could fire right after you
>>> enter the password.
>>>
>>>
>>> Best,
>>>
>>>
>>> R.
>>>
>>>
>>> On Sun, 11-05-2014, at 07:21, Jorge A. Alfaro-Murillo
>>>  wrote:
 Hi! I have been using org for managing passwords for a some time now. In
 case someone is interested, the code is in:
 https://bitbucket.org/alfaromurillo/org-passwords.el

 To consult the database, the code provides a function to open the Org
 file with the passwords in Read-Only mode, sets a timer after which the
 buffer is killed and provides functions for copying the password without
 it getting into the kill-ring. It also provides two types of functions
 for generating passwords: strings of random characters, and random words
 of the correcthorsebatterystaple-type. The README file in bitbucket has
 detailed information about the usage.

 If there is interest from the community this can also go to /contrib.

 Best,

 Jorge.

-- 
Colin Baxter
http://www.colin-baxter.com




Re: [O] [babel][PATCHES] ob-R patches for review

2014-05-12 Thread Eric Schulte
>> If not would you mind submitting a version of the patches split into
>> multiple commits with as much of the hard-coded R code as feasible
>> placed into customizable variables along the lines of the
>> `org-babel-R-assign-elisp-function' variable suggested by Charles.  
>
> I am thinking of actually not providing the R code in org-variables, but
> to put them into R files and to source them. By doing this, the
> customization could be done in R, which will be much easier for R users
> then to customize emacs variables.
>

I think this is a bad idea, such external R source files may be hard to
manage and load reliably across systems and it is not clear where they
should live in the Org-mode repository.  Additionally, if the variables
simply hold R code text, then users can easily initialize them from R
files locally with something like the following.

(setq org-babel-R-assign-elisp-function
  (with-temp-buffer
(insert-file-contents-literally "personal.R")
(buffer-string)))

I think this approach is much simpler.

Best,
Eric

>
> These would be sourced and stored into an environment "org:functions",
> using the same approach as ESS is using to store functions into an
> environment "ESSR". I would then put the variables transfered into
> "org:variables". These environments would only exist in the search path,
> and not overwrite any user set objects in R.
>
> As it needs to be sourced for each R process once, the right place would
> be in  org-babel-R-initiate-session - correct?
>
> What would be the best place to put these R files? 
>
>> One lesson I've certainly learned from the Org-mode mailing list is
>> that you can't anticipate all of the ways that your code will be used,
>> so up-front customizability generally pays off.
>
> OK - point taken - and I am definitely one of those users who thinks
> about unusual usages of certain features.
>
> Cheers,
>
> Rainer
>
>>
>> Thanks,
>> Eric
>>
>>>
>>> Thanks
>>>
>>> Rainer

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



Re: [O] Queestion concerning lists - was: [babel][PATCHES] ob-R patches for review

2014-05-12 Thread Eric Schulte
>
> I am working on it, but I have a question concerning strings and lists
> in elisp.
>
> In the function  org-babel-execute:R it says:
>
> ,
> | (inside
> |(list (org-babel-expand-body:R body params graphics-file)))
> `
>
> I now want to convert "inside" to a comma separated string. I am doing
> now the following:
>
> ,
> | (replace-regexp-in-string "\n" ", " (format "%s" inside))
> `
>
> but this does not look elegant to me, as I am converting inside to a
> string and then do a replace. There is the function mapconcat, but I
> don't get it to work:
>
> ,
> | (replace-regexp-in-string "\n" ", " (format "%s" inside))
> | "( createOrgVariablesEnvironment(), plot(1))"
> | 
> | (mapconcat 'identity inside ", ")
> | " createOrgVariablesEnvironment()
> | plot(1)"
> `
>
> What am I missing?
>

The following should work.

  (mapconcat #'identity inside ", ")

If that doesn't give the expected result, maybe share an example value
of inside, with the expected results.

Best,
Eric

>
> Thanks,
>
> Rainer
>
>>
>> As it needs to be sourced for each R process once, the right place would
>> be in  org-babel-R-initiate-session - correct?
>>
>> What would be the best place to put these R files? 
>>
>>> One lesson I've certainly learned from the Org-mode mailing list is
>>> that you can't anticipate all of the ways that your code will be used,
>>> so up-front customizability generally pays off.
>>
>> OK - point taken - and I am definitely one of those users who thinks
>> about unusual usages of certain features.
>>
>> Cheers,
>>
>> Rainer
>>
>>>
>>> Thanks,
>>> Eric
>>>

 Thanks

 Rainer

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



Re: [O] ob-lua.el

2014-05-12 Thread Eric Schulte
This looks good so far.

Does code execution work but it is untested, or has it not been
implemented?  Would you suggest adding this now or waiting for code
execution?  I don't see you listed on the contributors page, would you
be willing to do FSF copyright assignment?

http://orgmode.org/worg/org-contribute.html

Thanks!
Eric

die...@schoen.or.at writes:

> now with attachments, i hope
>
>
>
>> Original Message 
>>From: Dieter Schoen 
>>To: emacs-orgmode@gnu.org
>>Sent: Fri, May 9, 2014, 10:23 PM
>>Subject: Re: [O] ob-lua.el
>>
>>At Wed, 07 May 2014 00:46:03 +0200,
>>Bastien wrote:
>>> 
>>> Hi Dieter,
>>> 
>>> die...@schoen.or.at writes:
>>> 
>>> > for a project I need to tangle lua files (including parameters and
>>> > tables),
>>> > and there seems to be no ob-lua.el (yet).
>>> >
>>> > so I shamelessly copied ob-python.el and adapted it to my needs.
>>> > right now it can tangle lua, also with simple or table parameters.
>>> >
>>> > if anybody is interested, I can upload it.
>>> 
>>> Yes, please do!
>>> 
>>> > before that, it should maybe be completed, and also pass some generic
>>> > tangle test, I think.
>>> > I have shortly looked at testing/examples/ob-shell-test.org. Is a
>>> > test like this suitable?
>>> 
>>> I suggest to look at testing/lisp/test-ob-shell.el.
>>> 
>>
>>sorry for the delay, I had to fix some quoting..
>>
>>here is what i have already. it is not yet ERT tested, only manually.
>>ob-lua.el is capable to tangle code  which uses tables with one, two or many
>>columns.
>>i have not yet done any code executing tests.
>>
>>first, here is my test harness:
>>
>>#+NAME: simple-table
>>| simple one |
>>| two|
>>| three  |
>>
>>is converted into
>>
>>  sim={{"simple one"}, {"two"}, {"three"}}
>>
>>
>>#+NAME: assoc-table
>>| name| value |
>>|-+---|
>>| colour  | blue  |
>>| weather | fine  |
>>
>>this is converted into
>>
>>mapv={{"colour", "blue"}, {"weather", "fine"}}
>>
>>i copied this behaviour (an associative map) from ob-shell.el
>>
>>#+NAME: big-table
>>| name| value  | remark |
>>|-++|
>>| tool| emacs  | cool   |
>>| environment | debian | fair   |
>>
>>and finally,
>>
>>big={{"tool", "emacs", "cool"}, {"environment", "debian", "fair"}}
>>
>>
>><#part type="text/x-org" filename="/home/dieter/git/org/code-exporter.org" 
>>disposition=attachment>
>><#/part>
>>
>>and ob-lua.el
>>
>><#part type="application/emacs-lisp" 
>>filename="/home/dieter/.emacs.d/elpa/org-20140505/ob-lua.el" 
>>disposition=attachment>
>><#/part>
>>
>>as i am quite new to emacs/org, i will be thankful for any feedback.
>>
>>kind regards,
>>dieter
>
>
> ;;; ob-lua.el --- org-babel functions for lua evaluation
>
> ;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
>
> ;; Authors: Eric Schulte
> ;; Dan Davison
> ;; Keywords: literate programming, reproducible research
> ;; Homepage: http://orgmode.org
>
> ;; This file is part of GNU Emacs.
>
> ;; GNU Emacs is free software: you can redistribute it and/or modify
> ;; it under the terms of the GNU General Public License as published by
> ;; the Free Software Foundation, either version 3 of the License, or
> ;; (at your option) any later version.
>
> ;; GNU Emacs is distributed in the hope that it will be useful,
> ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
> ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> ;; GNU General Public License for more details.
>
> ;; You should have received a copy of the GNU General Public License
> ;; along with GNU Emacs.  If not, see .
>
> ;;; Commentary:
>
> ;; Org-Babel support for evaluating lua source code.
>
> ;;; Code:
> (require 'ob)
> (eval-when-compile (require 'cl))
>
> (declare-function org-remove-indentation "org" )
> (declare-function lua-shell "ext:lua-mode" (&optional argprompt))
> (declare-function lua-toggle-shells "ext:lua-mode" (arg))
> (declare-function run-lua "ext:lua" (cmd &optional dedicated show))
>
> (defvar org-babel-tangle-lang-exts)
> (add-to-list 'org-babel-tangle-lang-exts '("lua" . "lua"))
>
> (defvar org-babel-default-header-args:lua '())
>
> (defcustom org-babel-lua-command "lua"
>   "Name of the command for executing Lua code."
>   :version "24.4"
>   :package-version '(Org . "8.0")
>   :group 'org-babel
>   :type 'string)
>
> (defcustom org-babel-lua-mode
>   (if (or (featurep 'xemacs) (featurep 'lua-mode)) 'lua-mode 'lua)
>   "Preferred lua mode for use in running lua interactively.
> This will typically be either 'lua or 'lua-mode."
>   :group 'org-babel
>   :version "24.4"
>   :package-version '(Org . "8.0")
>   :type 'symbol)
>
> (defvar org-src-preserve-indentation)
>
> (defcustom org-babel-lua-hline-to "None"
>   "Replace hlines in incoming tables with this when translating to lua."
>   :group 'org-babel
>   :version "24.4"
>   :package-version '(Org . "8.0")
>   :type 'string)
>
> (defcustom org-babel-lua-None-to 'hline
>  

Re: [O] Bug: Cannot export this file as HTML. [8.2.6 (8.2.6-18-gaaae4a-elpa @ /home/kuanyui/.emacs.d/elpa/org-20140512/)]

2014-05-12 Thread kuanyui
I found the question, take an easy example:

* Title1
*** Title2
Test[fn:6]
* Footnotes
[fn:6]

If there's a footnote is empty (or just following a space or so), the
exporter will just return "org-trim: Wrong type argument: stringp, nil"
I think this is a bug because the exporter should told user "there're some
footnotes are empty" instead of an human-unreadable error message.

kuanyui 20140513 0014 GMT+8


Re: [O] Problems with including ledger files in org-babel

2014-05-12 Thread Adam Turoff
I've tried that, and that doesn't fix the problem.

I'm testing it now on another system, and this actually works (ledger.lgr
and the org file are in the same directory):

#+begin_src ledger :cmdline -f .ledger.lgr print
#+end_src

It seems like there's some issue with ledger not loading properly, and the
error appears to be eaten by org-babel.  Is there any way to debug what
org-babel is seeing here?

Also, I prefer using hledger over ledger. Is that a customizable option in
ob-ledger?

Thanks,

-- Adam


On Mon, May 12, 2014 at 7:03 AM, Eric S Fraga  wrote:

> On Monday, 12 May 2014 at 03:27, Adam Turoff wrote:
> > I'm trying to prepare a ledger report by including a ledger file with
> babel:
> >
> > #+begin_src ledger :cmdline print
> > !include ledger.lgr
> > #+end_src
>
> I would suggest you try specifying the full path to the ledger file,
> i.e. one starting with / (assuming you're using Linux, say).  Babel
> executes in another directory potentially and this could be the source
> of the problem.
>
> --
> : Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-949-g751506
>


Re: [O] org-ref code

2014-05-12 Thread Andreas Reuleaux
Eric S Fraga  writes:

> Is there some org variable I have not set that tells org to treat cite:
> plain text as a link on export?  Obviously org already recognises it as
> a link but the export doesn't...  org-link-protocols and org-link-types
> look fine.
>

Being just a org-ref beginner, I don't know if there is a more
straightforward solution but, I have configured:


  (org-add-link-type
   "cite"
   'org-ref-cite-onclick-minibuffer-menu
   ;; formatting
   (lambda (keyword desc format)
 (cond
  ((eq format 'html) (format "(%s)" path))
  ((eq format 'latex)
   (concat "\\cite{"
   (mapconcat (lambda (key) key) (org-ref-split-and-strip-string 
keyword) ",")
   "}")


and similarily for autocite and textcite (the citation types that I am
using), that works for me. Adapted (copied) from the org-add-link-type
for autocite given in the org-ref.org description.  Not sure if this
should just work out of the box (without configuration), but then, it's
not that much code.

-Andreas





Re: [O] org-ref code

2014-05-12 Thread John Kitchin
that should work out of the box, and that link is defined in org-ref as

(org-add-link-type
 "cite"
 'org-ref-cite-onclick-minibuffer-menu
 'org-ref-cite-link-format)

I am not sure why it would not work out of the box.



John

---
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



On Mon, May 12, 2014 at 1:20 PM, Andreas Reuleaux  wrote:

> Eric S Fraga  writes:
>
> > Is there some org variable I have not set that tells org to treat cite:
> > plain text as a link on export?  Obviously org already recognises it as
> > a link but the export doesn't...  org-link-protocols and org-link-types
> > look fine.
> >
>
> Being just a org-ref beginner, I don't know if there is a more
> straightforward solution but, I have configured:
>
>
>   (org-add-link-type
>"cite"
>'org-ref-cite-onclick-minibuffer-menu
>;; formatting
>(lambda (keyword desc format)
>  (cond
>   ((eq format 'html) (format "(%s)" path))
>   ((eq format 'latex)
>(concat "\\cite{"
>(mapconcat (lambda (key) key)
> (org-ref-split-and-strip-string keyword) ",")
>"}")
>
>
> and similarily for autocite and textcite (the citation types that I am
> using), that works for me. Adapted (copied) from the org-add-link-type
> for autocite given in the org-ref.org description.  Not sure if this
> should just work out of the box (without configuration), but then, it's
> not that much code.
>
> -Andreas
>
>
>
>


Re: [O] [babel][PATCHES] ob-R patches for review

2014-05-12 Thread Rainer M Krug
Eric Schulte  writes:

>>> If not would you mind submitting a version of the patches split into
>>> multiple commits with as much of the hard-coded R code as feasible
>>> placed into customizable variables along the lines of the
>>> `org-babel-R-assign-elisp-function' variable suggested by Charles.  
>>
>> I am thinking of actually not providing the R code in org-variables, but
>> to put them into R files and to source them. By doing this, the
>> customization could be done in R, which will be much easier for R users
>> then to customize emacs variables.
>>
>
> I think this is a bad idea, such external R source files may be hard to
> manage and load reliably across systems 

I see your points, but I am looking at ESS (which is loading .R files as
well into the ESSR environment) and whose loading mechanism I want
to piggy back the loading of .R for org. If I understand the variable
transfer from org to R correctly, it anyway only works on local R
sessions, which makes it even easier to do then ESS which also caters
for remote R sessions.
My idea is to have all R code in one directory and to let ESS load it
upon initialization of ESS (which is a dependency of running R from org
anyway, if I am not mistaken). I have a prototype working, and will keep
you posted. The complication would be that a newer version of ESS would
be needed.

The other option would be to just copy the code ESS uses into org, which
would make the process independent of changes in ESS. But I don't like
the duplication of code.

> and it is not clear where they should live in the Org-mode repository.

I would suggest in a etc/R. 

> Additionally, if the variables simply hold R code text, then users can
> easily initialize them from R files locally with something like the
> following.
>
> (setq org-babel-R-assign-elisp-function
>   (with-temp-buffer
> (insert-file-contents-literally "personal.R")
> (buffer-string)))
>
> I think this approach is much simpler.

True - but I like the simplicity of being able to customize the
behavior of org-babel-R by writing an R function without having to thin
about elisp. But maybe there is a way of doing both...

Thanks for your comments,

Rainer

>
> Best,
> Eric
>
>>
>> These would be sourced and stored into an environment "org:functions",
>> using the same approach as ESS is using to store functions into an
>> environment "ESSR". I would then put the variables transfered into
>> "org:variables". These environments would only exist in the search path,
>> and not overwrite any user set objects in R.
>>
>> As it needs to be sourced for each R process once, the right place would
>> be in  org-babel-R-initiate-session - correct?
>>
>> What would be the best place to put these R files? 
>>
>>> One lesson I've certainly learned from the Org-mode mailing list is
>>> that you can't anticipate all of the ways that your code will be used,
>>> so up-front customizability generally pays off.
>>
>> OK - point taken - and I am definitely one of those users who thinks
>> about unusual usages of certain features.
>>
>> Cheers,
>>
>> Rainer
>>
>>>
>>> Thanks,
>>> Eric
>>>

 Thanks

 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 :   +33 - (0)9 58 10 27 44

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

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgppKKjNhw58_.pgp
Description: PGP signature


Re: [O] New worg page: Publishing beamer slideshows and articles from one source

2014-05-12 Thread Suvayu Ali
Hi James,

On Sat, May 10, 2014 at 10:57:11AM +0800, James Harkins wrote:
> 
> http://orgmode.org/worg/exporters/beamer/beamer-dual-format.html

It is a great resource.  A couple of comments about formatting: the
first two footnotes might be better as links from the text.  I propose
the attached patch.  If you think this is fine, I'll push it.

BTW, the ignoreheading thing has been asked so many times, maybe I
should put it in an FAQ.  But then, the content is more appropriate for
org-hacks ... I'm undecided.  Any thoughts?

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.
>From 514178abdba0522ab4c44b6daa2cdbb80ddad9c5 Mon Sep 17 00:00:00 2001
From: Suvayu Ali 
Date: Mon, 12 May 2014 21:15:05 +0200
Subject: [PATCH] Minor formatting change

---
 exporters/beamer/beamer-dual-format.org | 10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/exporters/beamer/beamer-dual-format.org 
b/exporters/beamer/beamer-dual-format.org
index 3750035..e339088 100644
--- a/exporters/beamer/beamer-dual-format.org
+++ b/exporters/beamer/beamer-dual-format.org
@@ -495,8 +495,8 @@ Rather than create a document class to turn top-level 
headings into =\part=
 commands, I embedded the LaTeX code for it directly into the full-article 
 template. The trick is closing the environments for the previous sections. 
 This requires a top-level heading, which should not start a new section. I 
-found that =:B_ignoreheading:= did not work for this, but an export filter 
-by Suvayu Ali[fn:54e951f5] did exactly what I needed.
+found that =:B_ignoreheading:= did not work for this, but an 
[[http://stackoverflow.com/questions/10295177/is-there-an-equivalent-of-org-modes-b-ignoreheading-for-non-beamer-documents][export
 filter]]
+by Suvayu Ali did exactly what I needed.
 
 #+name: articleParts
 #+caption: Part of the full-article export document, with embedded LaTeX \part 
syntax.
@@ -535,7 +535,7 @@ are put into an =\mbox=, to suppress hyphenation.)
 Org's formatting markup is visual: asterisks for bold, slashes for
 italics and so on.
 
-I think export macros[fn:5c80275b] could support semantic markup that could 
export
+I think 
[[http://orgmode.org/manual/Macro-replacement.html#Macro-replacement][export 
macros]] could support semantic markup that could export
 to LaTeX or HTML equally well, but I didn't investigate that in this
 project. Here, I just embedded LaTeX commands directly into the org
 files: free standing for simple uses, and using export snippets[fn:448d1164] 
for
@@ -544,10 +544,6 @@ which LaTeX export treats specially).
 
 * Footnotes
 
-[fn:54e951f5] 
http://stackoverflow.com/questions/10295177/is-there-an-equivalent-of-org-modes-b-ignoreheading-for-non-beamer-documents
-
-[fn:5c80275b] 
http://orgmode.org/manual/Macro-replacement.html#Macro-replacement
-
 [fn:448d1164] Export snippets look like this:
 =@@backendname:text...@@=. They will export only to that backend. You
 can write several of them in a row for different backends:
-- 
1.9.0



Re: [O] Using Emacs, Org-mode and R for Research Writing in Social Sciences

2014-05-12 Thread Vikas Rawal
> 
>> For whatever it is worth, here it is. Pointers to any errors as well
>> as comments for improving it would be greatly appreciated. Also, I
>> would be happy to contribute it to Worg, if people consider it useful.
> 
> Some comments: at places it seemed a bit too verbose, e.g. when you are
> introducing some idea/technique.  I think it would be nice if you could
> make it a bit more concise.  

Did you miss “social sciences” in the title :)

Jokes apart, will try to look at the text and improve as much as I can. 
Specific suggestions welcome.

> I also noticed a few things in the
> formatting that looked LaTeX specific; e.g. \FloatBarrier after the
> table on keybindings.  If you intend to include this in Worg, I think
> you should remove these.  In fact you can explicitly target html.
> 

Thanks. \FloatBarrier gone. Also done a few other fixes.

Looking forward to further comments.

Best,

Vikas


Re: [O] Bug: Cannot export this file as HTML. [8.2.6 (8.2.6-18-gaaae4a-elpa @ /home/kuanyui/.emacs.d/elpa/org-20140512/)]

2014-05-12 Thread Nicolas Goaziou
Hello,

kuanyui  writes:

> I found the question, take an easy example:
>
> * Title1
> *** Title2
> Test[fn:6]
> * Footnotes
> [fn:6]
>
> If there's a footnote is empty (or just following a space or so), the
> exporter will just return "org-trim: Wrong type argument: stringp, nil"

This should be fixed. Thank you for reporting it.


Regards,

-- 
Nicolas Goaziou



Re: [O] Problems with including ledger files in org-babel

2014-05-12 Thread Samuel Wales
if ledger does not work, you can use sh.  i do.


On 5/12/14, Adam Turoff  wrote:
> It seems like there's some issue with ledger not loading properly, and the
> error appears to be eaten by org-babel.  Is there any way to debug what
> org-babel is seeing here?

c-c c-v c-v?

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  And
ANYBODY can get it.

Denmark: free Karina Hansen NOW.



Re: [O] Using Emacs, Org-mode and R for Research Writing in Social Sciences

2014-05-12 Thread Thomas S. Dye
Aloha Vikas,

Very nice!

Your document overlaps and updates the LaTeX export tutorial on Worg
that I wrote for the old exporter.  Perhaps it could be revised to
replace the old export tutorial?

Just a thought.

All the best,
Tom

Vikas Rawal  writes:

>> 
>>> For whatever it is worth, here it is. Pointers to any errors as well
>>> as comments for improving it would be greatly appreciated. Also, I
>>> would be happy to contribute it to Worg, if people consider it useful.
>> 
>> Some comments: at places it seemed a bit too verbose, e.g. when you are
>> introducing some idea/technique.  I think it would be nice if you could
>> make it a bit more concise.  
>
> Did you miss “social sciences” in the title :)
>
> Jokes apart, will try to look at the text and improve as much as I
> can. Specific suggestions welcome.
>
>> I also noticed a few things in the
>> formatting that looked LaTeX specific; e.g. \FloatBarrier after the
>> table on keybindings.  If you intend to include this in Worg, I think
>> you should remove these.  In fact you can explicitly target html.
>> 
>
> Thanks. \FloatBarrier gone. Also done a few other fixes.
>
> Looking forward to further comments.
>
> Best,
>
> Vikas
>

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



[O] [PATCH] Add author and title to exported PDF properties

2014-05-12 Thread Marcel van der Boom
* lisp/ox-latex.el (org-latex-template): add pdfauthor and pdftitle
(org-latex-hyperref-template): add placeholders for author and title
(org-latex-template): adjust default template with author and title

This adds author and title to the pdf properties of the exported PDF
file when using the LaTeX backend.
---
 lisp/ox-latex.el | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index cea21be..844f2cd 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -349,7 +349,7 @@ the toc:nil option, not to those generated with #+TOC 
keyword."
   :type 'string)
 
 (defcustom org-latex-hyperref-template
-  "\\hypersetup{\n pdfkeywords={%k},\n  pdfsubject={%d},\n  pdfcreator={%c}}\n"
+  "\\hypersetup{\n pdfkeywords={%k},\n  pdfsubject={%d},\n  pdfcreator={%c},\n 
pdfauthor={%a},\n pdftitle={%t}}"
   "Template for hyperref package options.
 
 Value is a format string, which can contain the following placeholders:
@@ -357,6 +357,8 @@ Value is a format string, which can contain the following 
placeholders:
   %k for KEYWORDS line
   %d for DESCRIPTION line
   %c for CREATOR line
+  %a for AUTHOR line
+  %t for TITLE line
 
 Set it to the empty string to ignore the command completely."
   :group 'org-export-latex
@@ -1216,6 +1218,8 @@ holding export options."
  (format-spec (plist-get info :latex-hyperref)
   (format-spec-make
?k (or (plist-get info :keywords) "")
+  ?a (or (first (plist-get info :author)) "")
+  ?t (or (first (plist-get info :title)) "")
?d (or (plist-get info :description)"")
?c (if (plist-get info :with-creator)
   (plist-get info :creator)
-- 
1.9.1




[O] How to specify birthdays?

2014-05-12 Thread Josef Wolf
Hello,

I am trying to use org-mode for birthdays. I have tried those two entries:

* Calendar
** Birthdays
*** Somebody
SCHEDULED: <1970-05-20 Mo +1y>
*** Somebody1
SCHEDULED:
 %%(org-anniversary 1970  5 20) Somebody1 is %d years old


The first entry is shown in the agenda for the current day as:


  Calendar:   Sched.358x:  Somebody

I find this a bit strange. I want a reminder a couple of days before the
event. But I don't want an everday reminder of how days have gone past the
last event.

The second entry doesn't appear at all in the agenda.

Any ideas what I am missing here?

-- 
Josef Wolf
j...@raven.inka.de



Re: [O] [babel][PATCHES] ob-R patches for review

2014-05-12 Thread Charles C. Berry

On Mon, 12 May 2014, Rainer M Krug wrote:


Eric Schulte  writes:


If not would you mind submitting a version of the patches split into
multiple commits with as much of the hard-coded R code as feasible
placed into customizable variables along the lines of the
`org-babel-R-assign-elisp-function' variable suggested by Charles.


I am thinking of actually not providing the R code in org-variables, but
to put them into R files and to source them. By doing this, the
customization could be done in R, which will be much easier for R users
then to customize emacs variables.



I think this is a bad idea, such external R source files may be hard to
manage and load reliably across systems


I see your points, but I am looking at ESS (which is loading .R files as
well into the ESSR environment) and whose loading mechanism I want
to piggy back the loading of .R for org. If I understand the variable
transfer from org to R correctly, it anyway only works on local R
sessions, which makes it even easier to do then ESS which also caters
for remote R sessions.
My idea is to have all R code in one directory and to let ESS load it
upon initialization of ESS (which is a dependency of running R from org
anyway, if I am not mistaken).


Not quite. You can run R src blocks without (require 'ess) if they require 
no session. (I do not claim that anyone actually runs R src blocks who 
lacks a working ESS installation, just saying...)




I have a prototype working, and will keep
you posted. The complication would be that a newer version of ESS would
be needed.



Maybe load the ESS and R files if

  (and (fboundp 'ess-version)
   (not (string<
 (ess-version)
 "ess-version: ")))

and fallback to the existing version of ob-R.el (or something like it) 
otherwise.



The other option would be to just copy the code ESS uses into org, which
would make the process independent of changes in ESS. But I don't like
the duplication of code.


and it is not clear where they should live in the Org-mode repository.


I would suggest in a etc/R.



IIUC, someone on ESS core will support your effort. So maybe you can have 
an etc/ESSR/R/org-mode.R file.


Since you will have a mix of elisp and R, it might make sense to have 
minimal callouts on the org-mode side to an elisp wrapper on the ESS side. 
Then you can maintain the trickier elisp on the ESS side, so changes in 
elisp that require changes in R or vice versa can be made in unison.



Additionally, if the variables simply hold R code text, then users can
easily initialize them from R files locally with something like the
following.

(setq org-babel-R-assign-elisp-function
  (with-temp-buffer
(insert-file-contents-literally "personal.R")
(buffer-string)))

I think this approach is much simpler.


True - but I like the simplicity of being able to customize the
behavior of org-babel-R by writing an R function without having to thin
about elisp. But maybe there is a way of doing both...



noweb will do it. Quote the chunk like this:

#+BEGIN_SRC emacs-lisp :noweb yes :tangle elisp-R.el
  (setq rlines "
<>")
#+END_SRC


HTH,

Chuck


Charles C. BerryDept of Family/Preventive Medicine
cberry at ucsd edu  UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, CA 92093-0901



Re: [O] How to specify birthdays?

2014-05-12 Thread Dominic Surano
Josef Wolf  raven.inka.de> writes:

> 
> Hello,
> 
> I am trying to use org-mode for birthdays. I have tried those two entries:
> 
> * Calendar
> ** Birthdays
> *** Somebody
> SCHEDULED: <1970-05-20 Mo +1y>
> *** Somebody1
> SCHEDULED:
>  %%(org-anniversary 1970  5 20) Somebody1 is %d years old
> 
> The first entry is shown in the agenda for the current day as:
> 
>   Calendar:   Sched.358x:  Somebody
> 
> I find this a bit strange. I want a reminder a couple of days before the
> event. But I don't want an everday reminder of how days have gone past the
> last event.
> 
> The second entry doesn't appear at all in the agenda.
> 
> Any ideas what I am missing here?
> 

Make it a deadline instead of a SCHEDULED item and set it to the current 
year with the +1y modifier. That way it will only come up a few days before 
it's due.

* Calendar
** Birthdays
*** Somebody
DEADLINE: <2014-05-12 Tue +1y>




Re: [O] How to specify birthdays?

2014-05-12 Thread Erik Iverson
Not a direct answer, but have you found the org-contacts package?

 https://julien.danjou.info/projects/emacs-packages#org-contacts

It supports the BIRTHDAY property. See the note at bottom of the link above
about how it integrates with the agenda.

Example:

** Dad
:PROPERTIES:
:BIRTHDAY: 1955-01-21
:END:



On Mon, May 12, 2014 at 4:42 PM, Josef Wolf  wrote:

> Hello,
>
> I am trying to use org-mode for birthdays. I have tried those two entries:
>
> * Calendar
> ** Birthdays
> *** Somebody
> SCHEDULED: <1970-05-20 Mo +1y>
> *** Somebody1
> SCHEDULED:
>  %%(org-anniversary 1970  5 20) Somebody1 is %d years old
>
>
> The first entry is shown in the agenda for the current day as:
>
>
>   Calendar:   Sched.358x:  Somebody
>
> I find this a bit strange. I want a reminder a couple of days before the
> event. But I don't want an everday reminder of how days have gone past the
> last event.
>
> The second entry doesn't appear at all in the agenda.
>
> Any ideas what I am missing here?
>
> --
> Josef Wolf
> j...@raven.inka.de
>
>


Re: [O] org-ref code

2014-05-12 Thread Andreas Reuleaux
John Kitchin  writes:

> that should work out of the box, and that link is defined in org-ref as
>
> (org-add-link-type
>  "cite"
>  'org-ref-cite-onclick-minibuffer-menu
>  'org-ref-cite-link-format)
>
> I am not sure why it would not work out of the box.
>

They *do* work out of the box, as I can see now.


-Andreas




Re: [O] Problems with including ledger files in org-babel

2014-05-12 Thread Adam Turoff
Thanks everyone.  I never saw C-c C-v C-v before, so that pointed me in the
right direction.

Most of the issue was with my inexperience debugging elisp.  The messages
buffer pointed me in the right direction; ledger wasn't emitting any output
because was throwing warning messages.  I traced it down to ledger
complaining about a missing newline after the !include line inside the src
block.

And the !include'd file needs to have the full path, as expected.

Thanks again,

-- Adam


On Mon, May 12, 2014 at 4:28 PM, Samuel Wales  wrote:

> if ledger does not work, you can use sh.  i do.
>
>
> On 5/12/14, Adam Turoff  wrote:
> > It seems like there's some issue with ledger not loading properly, and
> the
> > error appears to be eaten by org-babel.  Is there any way to debug what
> > org-babel is seeing here?
>
> c-c c-v c-v?
>
> --
> The Kafka Pandemic: http://thekafkapandemic.blogspot.com
>
> The disease DOES progress.  MANY people have died from it.  And
> ANYBODY can get it.
>
> Denmark: free Karina Hansen NOW.
>


Re: [O] How to specify birthdays?

2014-05-12 Thread Eric Abrahamsen
Dominic Surano  writes:

> Josef Wolf  raven.inka.de> writes:
>
>> 
>> Hello,
>> 
>> I am trying to use org-mode for birthdays. I have tried those two entries:
>> 
>> * Calendar
>> ** Birthdays
>> *** Somebody
>> SCHEDULED: <1970-05-20 Mo +1y>
>> *** Somebody1
>> SCHEDULED:
>>  %%(org-anniversary 1970  5 20) Somebody1 is %d years old
>> 
>> The first entry is shown in the agenda for the current day as:
>> 
>>   Calendar:   Sched.358x:  Somebody
>> 
>> I find this a bit strange. I want a reminder a couple of days before the
>> event. But I don't want an everday reminder of how days have gone past the
>> last event.
>> 
>> The second entry doesn't appear at all in the agenda.
>> 
>> Any ideas what I am missing here?
>> 
>
> Make it a deadline instead of a SCHEDULED item and set it to the current 
> year with the +1y modifier. That way it will only come up a few days before 
> it's due.
>
> * Calendar
> ** Birthdays
> *** Somebody
> DEADLINE: <2014-05-12 Tue +1y>

Deadlines and schedules are generally for things that require an action
on your part, and thus will continue to show up in the agenda as
un-acted-upon if you don't do anything. Usually, for things like
birthdays, you just use a plain timestamp (no scheduled or deadline),
and then you can just see it coming in the usual org agenda. I don't
think there's any other way to give a specific warning about an upcoming
timestamp, though...

Eric




Re: [O] org-ref code

2014-05-12 Thread John Kitchin
Here is a way you can add new citation formats to the reftex format:

;; get builtin formats
(setq formats (nth 2 (assoc 'org reftex-cite-format-builtin)))

;; add new format
(setf (nth 2 (assoc 'org reftex-cite-format-builtin))
  (append formats '((?W  . "textcite:%l")
(?z  . "newcite:%l"

This does not define the links, but it does add the formats to the reftex
menu.

I have figured out how to add new citation links without alot of cut and
pasted code. I do not use biblatex much though. What are the common
citation formats, and are they mostly written as \citation{label}?

John

---
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



On Mon, May 12, 2014 at 4:12 AM, Andreas Reuleaux  wrote:

> John Kitchin  writes:
>
>
> > C-c ] should be bound by default to org-ref-insert-cite-link. It is
> defined
> > in a hook function in line 104 of org-ref.org.
> >
> > I made a custom variable to store the key-binding, but I realized it
> > probably doesn't help, since the binding
> >
> >
> >>
> >> 1. C-u on it does not give me a choice of citation method
> >>
> >
> > If you type C-u M-x  org-ref-insert-cite-link
> >
> > do you get a choice?
> >
> > I just tried this on a fresh pull and it does work for me. I am not sure
> > why this wouldn't work for you.  Do you tangle the .el file from the .org
> > file? I have this code somewhere else to build it when needed:
>
>
> I can confirm that C-c ] and C-u C-c ]
> work fine for me.
>
> my setup if fairly simple (with org-ref.el tangled from org-ref.org)
>
>   (require 'org-ref)
>
>   (custom-set-variables
>'(org-ref-bibliography-notes "notes.org")
>'(org-ref-default-bibliography  (list "refs.bib"))
>;; '(org-ref-pdf-directory "...")
>;; '(org-ref-default-citation-link "...")
>;; '(org-ref-insert-cite-key "...")
>)
>
> looking forward to discover more of org-ref.
>
> FWIW, I was using textcite:... (with biblatex) as well, helped myself by
> just inserting a cite:... and then changing the link with C-c C-l from
> cite to textcite. But I really need read up on all those different
> citations commands once more, maybe textcite is not really necessary?
> Could I add it somehow to the list of choices available in "C-u C-c ]" ?
> (I realized there are citetext, citep*, citep as well, that I yet have
> to discover).
>
> By the way: the org-ref.org literate programming docs are fine
> for someone interested in the gory details / relatively experienced.
> Ist there a simpler document just describing its usage - that
> you would hand out to your chemistry students e. g. ?
>
> Somehting maybe explaining the differences from the other approaches
> that can be found e g in
>
>
> http://tincman.wordpress.com/2011/01/04/research-paper-management-with-emacs-org-mode-and-reftex/
>
>
> http://www-public.it-sudparis.eu/~berger_o/weblog/2012/03/23/how-to-manage-and-export-bibliographic-notesrefs-in-org-mode/
>
> Thanks for org-ref.
>
> -Andreas
>
>
>


[O] R source code, break long lines

2014-05-12 Thread Johannes Rainer
dear all,

I'm extensively using org-mode in combination with R source code blocks.
The only thing I miss is the possibility to break long lines of R code in
the exported pdf.
Is there a way to tell org, or the latex exporter, to have automatic line
breaks for long lines?

thanks in advance!

cheers, jo