Re: [O] babel srcname? Calling Library of Babel code?

2015-10-05 Thread Thomas S . Dye
Aloha Lawrence,

Lawrence Bottorff  writes:

> Not really getting how to call code "meta-style" from other points -- in my
> file, in other files, in my "library of babel" file? I've tracked down bits
> and pieces here and there, but I'm missing the big picture.
>
> For example, this:
>
> #+srcname: python2_env
> #+begin_src emacs-lisp
>   (setq org-babel-python-command "python")
>   (set-face-background 'modeline "#4477aa")
> #+end_src
>
> #+srcname: python3_env
> #+begin_src emacs-lisp
>   (setq org-babel-python-command "python3")
>   (set-face-background 'modeline "#771944")
> #+end_src
>
> Why is #+srcname being used and not just #+name? I assume these blocks will
> be called later? I'm also assuming that #+call plays a role, but this page
>  has no examples and
> confused me.

During development of Babel, source code blocks were originally named
using #+srcname:.  Later, as other elements gained the ability to be
named, it was decided to use a more generic identifier, #+name:.

The #+call: syntax is confusing to me, too.  I usually put :var
arguments in the  part, non-:var arguments that change what
the code block does in , and non-:var arguments
that affect how the buffer is changed in the .

>
> This example
>  again
> uses #+srcname:
>
> . . .
> * Opening
>> #+srcname: opening
>> #+begin_src org
>> Dear Org mode users,
>> #+end_src
> . . .
> * Closing
>> #+srcname: closing
>> #+begin_src org
>>   Yours Truly
>> #+end_src
> . . .
> and then
>
> . . .
> \setupdocument{
>> to = {%
>>   <>},
> . . .
>> opening = {<>},
>> closing = {<>}
>> }
>
> I'm guessing the opening and closing are being called. But again, why
> srcname and not just name? And what if my blocks had been defined somewhere
> outside of this file?

The <> form is noweb reference syntax.  Your example expands the
source code block.  You can get the results of the source code block
with <>, which I think is what this example might intend.

If the blocks are defined outside of the file, then where they are
defined is a library of Babel.  You'll need to explicitly load them with
the org-babel-lob-ingest function.  You can have as many libraries of
Babel as you want.

hth,
Tom

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



[O] babel srcname? Calling Library of Babel code?

2015-10-05 Thread Lawrence Bottorff
Not really getting how to call code "meta-style" from other points -- in my
file, in other files, in my "library of babel" file? I've tracked down bits
and pieces here and there, but I'm missing the big picture.

For example, this:

#+srcname: python2_env
#+begin_src emacs-lisp
  (setq org-babel-python-command "python")
  (set-face-background 'modeline "#4477aa")
#+end_src

#+srcname: python3_env
#+begin_src emacs-lisp
  (setq org-babel-python-command "python3")
  (set-face-background 'modeline "#771944")
#+end_src

Why is #+srcname being used and not just #+name? I assume these blocks will
be called later? I'm also assuming that #+call plays a role, but this page
 has no examples and
confused me.

This example
 again
uses #+srcname:

. . .
* Opening
> #+srcname: opening
> #+begin_src org
> Dear Org mode users,
> #+end_src
. . .
* Closing
> #+srcname: closing
> #+begin_src org
>   Yours Truly
> #+end_src
. . .
and then

. . .
\setupdocument{
> to = {%
>   <>},
. . .
> opening = {<>},
> closing = {<>}
> }

I'm guessing the opening and closing are being called. But again, why
srcname and not just name? And what if my blocks had been defined somewhere
outside of this file?

LB


Re: [O] Website down?

2015-10-05 Thread Bastien
Kaushal Modi  writes:

> Yes, it's down for me since morning.

It's now back up.  I just restarted the nginx process.

I've setup a regular check to avoid this in the future.

Thanks for reporting it!

-- 
 Bastien



Re: [O] Website down?

2015-10-05 Thread Kaushal Modi
Yes, it's down for me since morning.


--
Kaushal Modi

On Mon, Oct 5, 2015 at 10:40 PM, Puneeth Chaganti 
wrote:

>
>
>


[O] Website down?

2015-10-05 Thread Puneeth Chaganti




[O] Org-mode Babel does not show syntax highlight when open with another mode

2015-10-05 Thread stardiviner

I try to configure Org-mode to open ruby source code block with `enh-ruby-mode`.

configuration as following:

#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'enh-ruby-mode
  (add-to-list 'org-src-lang-modes '("ruby" . enh-ruby)))
#+END_SRC

This will open code block in `enh-ruby-mode` when you edit with [C-c '].

You can see the syntax highlighting failed result screenshot at here:

http://emacs.stackexchange.com/questions/17042/org-mode-babel-failed-syntax-highlight-after-change-org-src-lang-modes

I hope to keep the syntax highlight, (If can use enh-ruby-mode syntax highlight
will be better).




[O] Org-mode Babel does not show syntax highlight when open with another mode

2015-10-05 Thread stardiviner

I try to configure Org-mode to open ruby source code block with `enh-ruby-mode`.

configuration as following:

#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'enh-ruby-mode
  (add-to-list 'org-src-lang-modes '("ruby" . enh-ruby)))
#+END_SRC

This will open code block in `enh-ruby-mode` when you edit with [C-c '].

You can see the syntax highlighting failed result screenshot at here:

http://emacs.stackexchange.com/questions/17042/org-mode-babel-failed-syntax-highlight-after-change-org-src-lang-modes

I hope to keep the syntax highlight, (If can use enh-ruby-mode syntax highlight
will be better).



Re: [O] anyone syncing orgmode calendar with google cal, and if so how?

2015-10-05 Thread James Richardson

Fabrice Popineau writes:

> I have build a merge of elisp code from 2 people (org-gcal and
> google-calendar) and enhanced it a little bit.
> I can sync both ways from Emacs.
> The code is ugly, so I won't publish it. But if anybody wants to clean it
> up and make it more solid, I'll send it.
>

I would like to see the code, perhaps we can make something usable.

-- 
James



Re: [O] anyone syncing orgmode calendar with google cal, and if so how?

2015-10-05 Thread Fabrice Popineau
I have build a merge of elisp code from 2 people (org-gcal and
google-calendar) and enhanced it a little bit.
I can sync both ways from Emacs.
The code is ugly, so I won't publish it. But if anybody wants to clean it
up and make it more solid, I'll send it.

Fabrice

2015-10-05 19:45 GMT+02:00 Rainer M Krug :

> Eric S Fraga  writes:
>
> > On Monday,  5 Oct 2015 at 09:46, Xebar Saram wrote:
> >> Hi all
> >>
> >> i was wondering if anyone was syncing orgmode calendar with google cal,
> and
> >> if so how? i tried this
> >
> > I sync org with Google's calendar using MobileOrg on my phone as the
> > intermediary.  Generally works quite well.  I would be using MobileOrg
> > regardless so calendar synchronisation is a very nice bonus.
>
> Interesting - Android or iOS? if iOS - I would like to know how you do
> it.
>
> 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 :   +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
>



-- 
Fabrice Popineau
-
SUPELEC
Département Informatique
3, rue Joliot Curie
91192 Gif/Yvette Cedex
Tel direct : +33 (0) 169851950
Standard : +33 (0) 169851212
--


Re: [O] anyone syncing orgmode calendar with google cal, and if so how?

2015-10-05 Thread Rainer M Krug
Eric S Fraga  writes:

> On Monday,  5 Oct 2015 at 09:46, Xebar Saram wrote:
>> Hi all
>>
>> i was wondering if anyone was syncing orgmode calendar with google cal, and
>> if so how? i tried this
>
> I sync org with Google's calendar using MobileOrg on my phone as the
> intermediary.  Generally works quite well.  I would be using MobileOrg
> regardless so calendar synchronisation is a very nice bonus.

Interesting - Android or iOS? if iOS - I would like to know how you do
it.

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 :   +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


signature.asc
Description: PGP signature


[O] Bug? Improper interaction with python variable _ ?

2015-10-05 Thread Brian Beckman
Please see the gist below for a self-explaining example
copied here for convenience.  Emacs 24.5.1 with org-mode
8 something (not sure how to get it to report its exact
version)... a very late version, I am sure.  Verified with
no init.el, that is, with emacs -Q

https://gist.github.com/rebcabin/37f800da658f4b23ceaa

#+TITLE: Org-Babel Bug?
#+AUTHOR: Brian Beckman
#+EMAIL: bc.beck...@gmail.com

#+BEGIN_SRC emacs-lisp :exports results :results none
  (setq org-confirm-babel-evaluate nil)
  (org-babel-map-src-blocks nil (org-babel-remove-result))
#+end_src

* Mystery Number 1

The first line of the first block must be blank, or we must =C-c C-c= the block
two times. But we want to eval the entire file /via/ =C-c C-v C-b=, and we found
that the first line must be empty.

If you =C-c C-v C-b= this entire file, the python session buffer, named
=*bug-org-babel*=, contains an error message that suggests the variable =_= is
implicated in an error.

We expect the value of this first block to be 999.  Make sure that the python
session is clear by typing =quit()=, then evaluate this entire file by
=C-c C-v C-b=.

#+NAME: probe
#+BEGIN_SRC python :session bug-org-babel :exports both :results value

  999
#+END_SRC

#+RESULTS: probe
: 999

* Mystery Number 2

Now, we set the value of the variable =_= to something arbitray. In a real
scenario, this variable may be set casually in a loop or some other context. The
variable =_= is often recommended for /ad-hoc/ use, as in "don't care."

#+NAME: second-probe
#+BEGIN_SRC python :session bug-org-babel :exports both :results value
  _ = 42
  _
#+END_SRC

#+RESULTS: second-probe
: 42

But now, all blocks with =:results value= return the value of =_=. We broke
org-babel!

#+NAME: third-probe
#+BEGIN_SRC python :session bug-org-babel :exports both :results value
  999
#+END_SRC

#+RESULTS: third-probe
: 42


Re: [O] Bug? Improper interaction with python variable _ ?

2015-10-05 Thread Brian Beckman
Correction: The first elisp-block should contain another command

Here is the corrected org-mode file, top-to-bottom

#+TITLE: Org-Babel Bug?
#+AUTHOR: Brian Beckman
#+EMAIL: bc.beck...@gmail.com

#+BEGIN_SRC emacs-lisp :exports results :results none
  (org-babel-do-load-languages
'org-babel-load-languages '((python . t)))
  (setq org-confirm-babel-evaluate nil)
  (org-babel-map-src-blocks nil (org-babel-remove-result))
#+end_src

* Mystery Number 1

The first line of the first block must be blank, or we must =C-c C-c= the
block
two times. But we want to eval the entire file /via/ =C-c C-v C-b=, and we
found
that the first line must be empty.

If you =C-c C-v C-b= this entire file, the python session buffer, named
=*bug-org-babel*=, contains an error message that suggests the variable =_=
is
implicated in an error.

We expect the value of this first block to be 999.  Make sure that the
python
session is clear by typing =quit()=, then evaluate this entire file by
=C-c C-v C-b=.

#+NAME: probe
#+BEGIN_SRC python :session bug-org-babel :exports both :results value

  999
#+END_SRC

#+RESULTS: probe
: 999

* Mystery Number 2

Now, we set the value of the variable =_= to something arbitray. In a real
scenario, this variable may be set casually in a loop or some other
context. The
variable =_= is often recommended for /ad-hoc/ use, as in "don't care."

#+NAME: second-probe
#+BEGIN_SRC python :session bug-org-babel :exports both :results value
  _ = 42
  _
#+END_SRC

#+RESULTS: second-probe
: 42

But now, all blocks with =:results value= return the value of =_=. We broke
org-babel!

#+NAME: third-probe
#+BEGIN_SRC python :session bug-org-babel :exports both :results value
  999
#+END_SRC

#+RESULTS: third-probe
: 42




On Sun, Oct 4, 2015 at 10:12 PM, Brian Beckman  wrote:

> Please see the gist below for a self-explaining example
> copied here for convenience.  Emacs 24.5.1 with org-mode
> 8 something (not sure how to get it to report its exact
> version)... a very late version, I am sure.  Verified with
> no init.el, that is, with emacs -Q
>
> https://gist.github.com/rebcabin/37f800da658f4b23ceaa
>
> #+TITLE: Org-Babel Bug?
> #+AUTHOR: Brian Beckman
> #+EMAIL: bc.beck...@gmail.com
>
> #+BEGIN_SRC emacs-lisp :exports results :results none
>   (setq org-confirm-babel-evaluate nil)
>   (org-babel-map-src-blocks nil (org-babel-remove-result))
> #+end_src
>
> * Mystery Number 1
>
> The first line of the first block must be blank, or we must =C-c C-c= the 
> block
> two times. But we want to eval the entire file /via/ =C-c C-v C-b=, and we 
> found
> that the first line must be empty.
>
> If you =C-c C-v C-b= this entire file, the python session buffer, named
> =*bug-org-babel*=, contains an error message that suggests the variable =_= is
> implicated in an error.
>
> We expect the value of this first block to be 999.  Make sure that the python
> session is clear by typing =quit()=, then evaluate this entire file by
> =C-c C-v C-b=.
>
> #+NAME: probe
> #+BEGIN_SRC python :session bug-org-babel :exports both :results value
>
>   999
> #+END_SRC
>
> #+RESULTS: probe
> : 999
>
> * Mystery Number 2
>
> Now, we set the value of the variable =_= to something arbitray. In a real
> scenario, this variable may be set casually in a loop or some other context. 
> The
> variable =_= is often recommended for /ad-hoc/ use, as in "don't care."
>
> #+NAME: second-probe
> #+BEGIN_SRC python :session bug-org-babel :exports both :results value
>   _ = 42
>   _
> #+END_SRC
>
> #+RESULTS: second-probe
> : 42
>
> But now, all blocks with =:results value= return the value of =_=. We broke
> org-babel!
>
> #+NAME: third-probe
> #+BEGIN_SRC python :session bug-org-babel :exports both :results value
>   999
> #+END_SRC
>
> #+RESULTS: third-probe
> : 42
>
>
>


Re: [O] anyone syncing orgmode calendar with google cal, and if so how?

2015-10-05 Thread Eric S Fraga
On Monday,  5 Oct 2015 at 09:46, Xebar Saram wrote:
> Hi all
>
> i was wondering if anyone was syncing orgmode calendar with google cal, and
> if so how? i tried this

I sync org with Google's calendar using MobileOrg on my phone as the
intermediary.  Generally works quite well.  I would be using MobileOrg
regardless so calendar synchronisation is a very nice bonus.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.5.1, Org release_8.3.1-203-g4ca3d3



Re: [O] anyone syncing orgmode calendar with google cal, and if so how?

2015-10-05 Thread Jorge A. Alfaro-Murillo

Xebar Saram writes:

i was wondering if anyone was syncing orgmode calendar with 
google cal, and if so how? i tried this 

https://github.com/myuhe/org-gcal.el/issues 

which gave errors all the time and thus stopped being usable 


im looking for a robust solution. any ideas?


I export the agenda using org-icalendar-combine-agenda-files. If 
you have access to a server, it is enough to point 
org-icalendar-combined-agenda-file to the right location in your 
server and then adding the ics file location in google calendar 
(Other calendars/Add by URL). You can automate this with a timer:


#+BEGIN_SRC emacs-lisp
 (org-icalendar-combined-agenda-file 
 "~/public_html/calendar.ics")
 (run-with-idle-timer (* 60 60) t 
 'org-icalendar-combine-agenda-files) 
#+END_SRC


If you do not have access to a server, you could use github 
(https://pages.github.com/) or bitbucket 
(https://confluence.atlassian.com/bitbucket/publishing-a-website-on-bitbucket-221449776.html) 
to create a website for your account. Then you can point 
org-icalendar-combined-agenda-file to the repo of your website and 
commit and push every time that you export the agenda to the ics 
file. In this case change org-icalendar-combined-agenda-file 
accordingly.


#+BEGIN_SRC emacs-lisp
 (org-icalendar-combined-agenda-file 
 "/path/to/personal/website/repo/calendar.ics")

#+END_SRC

If you do not like timers, you can also automate the process 
creating an sh file:


#+BEGIN_EXAMPLE
 #!/bin/bash
 emacsclient -a '' -e "(org-icalendar-combine-agenda-files nil)"
 cd /path/to/personal/website/repo
 git add calendar.ics
 git commit -m "Update calendar"
 git push
#+END_EXAMPLE

And then using a cronjob.

Best,

--
Jorge.




[O] To compile or not compile - that is the question

2015-10-05 Thread Rainer M Krug
Hi

I compiled org before, but would now prefer to use it uncompiled
(different emacs versions, debugging).

What are the speed implications of
not compiling orgmode? I am using tangling a lot - would not be
compiling a recognizable slowdown?

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


signature.asc
Description: PGP signature


Re: [O] Repeating timestamp with interval N times

2015-10-05 Thread Rasmus
Hi Stephen,

Stephen Eglen  writes:

>> My understanding is that you would like to extend Org’s "datey" syntax to
>> allow provide an end in this statement,
>> 
>> <2015-10-08 Thu 11:00-12:00 8+1w>
>> 
>> What is the syntax you have got in mind?
>
> I wrote a suggestion above, e.g. "8+1w" would mean that the +1w (every week)
> repeater was constrained to a maximum of 8 times.

So you did.  Sorry.

Perhaps it's too discrete.  Perhaps "+1W/8" or something.

I haven't looked much at org-clock.el.  Perhaps you can take a look a look
and make an assertion of whether it's feasible.

Rasmus

-- 
Send from my Emacs




Re: [O] [PATCH] Reverse capture finalize and refile, hack buffer killing.

2015-10-05 Thread Jan Seeger
Hello!

That might be because I copy-pasted the patch into an email. Sorry for the 
delay!

I attached the patch.

Regards,
Jan

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 67dc319..b1cda3d 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -792,7 +792,10 @@ already gone.  Any prefix argument will be passed to the 
refile command."
  "Refiling from a capture buffer makes only sense for `entry'-type 
templates"))
   (let ((pos (point))
(base (buffer-base-buffer (current-buffer)))
-   (org-refile-for-capture t))
+   (org-refile-for-capture t)
+   (kill-buffer (org-capture-get :kill-buffer 'local)))
+(org-capture-put :kill-buffer nil)
+(org-capture-finalize)
 (save-window-excursion
   (with-current-buffer (or base (current-buffer))
(save-excursion
@@ -800,7 +803,7 @@ already gone.  Any prefix argument will be passed to the 
refile command."
(widen)
(goto-char pos)
(call-interactively 'org-refile)
-(org-capture-finalize)))
+(when kill-buffer (kill-buffer base
 
 (defun org-capture-kill ()
   "Abort the current capture process."


Re: [O] :EXPORT tags in property drawer not recognised in org 8.3

2015-10-05 Thread Zhihao Ding
Thanks Rasmus. After some exploration I realised that I can't have empty
lines or comment lines (by #) between :PROPERTIES: and :END: - I used to
have blocks of :EXPORT_ for different things. Once I remove those I get the
right export as before. This is fixed for me now.

Thanks,
Zhihao

On 29 September 2015 at 21:54, Rasmus  wrote:

> Hi Zhihao,
>
> Zhihao Ding  writes:
>
> > Dear Org experts,
> >
> > I am having some problems with exporting in org 8.3.1. I've been using
> > :PROPERTIES to control export of a heading, e.g.
> >
> > :PROPERTIES:
> > :EXPORT_LaTeX_HEADER+: \usepackage{array}
> > :EXPORT_LaTeX_HEADER+: \usepackage{tikz}
> > :EXPORT_LATEX_HEADER+: \usepackage{geometry}
> > :EXPORT_TITLE: title
> > :EXPORT_FILE_NAME: file.pdf
> > :END:
> >
> > However I realised that they are not correctly recognised in the latex
> > output. Any advice?
>
>
> Could you be more specific about what is wrong? In a quick test I got the
> requested packages and title.
>
> Could you try 8.3.2 or master to see if the problem persists.
>
> Thanks,
> Rasmus
>
> --
> ツ
>
>
>


-- 
Regards,
Zhihao Ding


Re: [O] Repeating timestamp with interval N times

2015-10-05 Thread Stephen Eglen

hi Rasmus, thanks!

> In the past I used org-class, which might be what you refer to below.
> Example:
> 
> %%(org-class 2014 9 26 2014 12 15 3 'holidays) office hour 9:30-10:30

Thank you, I had not seen that.


> 
> My understanding is that you would like to extend Org’s "datey" syntax to
> allow provide an end in this statement,
> 
> <2015-10-08 Thu 11:00-12:00 8+1w>
> 
> What is the syntax you have got in mind?

I wrote a suggestion above, e.g. "8+1w" would mean that the +1w (every week)
repeater was constrained to a maximum of 8 times.


Stephen


[O] bug#21344: 25.0.50; ORG (melpa unstable): when export to html #+BEGIN_CENTER blocks don't work

2015-10-05 Thread Bastien
j_l_domen...@yahoo.com writes:

>   In latest ORG from melpa unstable, when exporting to HTML, the 
> #+BEGIN_CENTER
>   blocks doesn't work as expected.
>
> It seems to be an incorrect class name in the div's block that is
> generated.

Closing this as it has been fixed upstream.

Thanks,

-- 
 Bastien