Re: [O] org-publish error: "Stack overflow in regexp matcher"

2013-07-12 Thread Vikas Rawal
> > Oddly, it scans through all files including the static content. It
> > goes through all tar.gz files, pdf files, and what not. 
> >
> > My project specification is pasted below. Sitemap is supposed to be
> > made only with the project "indianstatistics-notes" and not with
> > "indianstatistics-static". But orgmode scans through the whole thing
> > anyway, and gives the above mentioned error.
> 
> I have pushed a fix for that. Could you confirm publishing now behaves
> as expected?

It does work, indeed.

Wow!

Vikas



Re: [O] [PATCH] Add "latex" option to ox-bibtex.el

2013-07-12 Thread feng shu
I want to add a option which can setting bib for html export and latex
export separately,
As it for the reason:
1. bibtex2html can't work well with complex bib style, so using a simple
style and making it
show correctly is reasonable choose,
2. bibtex2html can't find bib style in current dir, for example
(./file.sty) ,
3. the biblatex user.


In my opinion, the solution seemd more hacky than mine for a user,  It let
my org-mode file more unportable.

Could you share you opinion and reason about my approach:  Is the idea ,
separating with  a new option, hacky?  or my code hacky? .



On Fri, Jul 12, 2013 at 9:36 PM, Nicolas Goaziou wrote:

> > Really?  This problem can be resolved with hooks or filters?  Could you
> > give me more informations or a example?
>
> Perhaps something like the following (untested) should do the trick:
>
>   (defun my-bibliography-selector-hook (backend)
> (case backend
>   (latex
>(when (save-excursion
>(re-search-forward "^[ \t]*\\bibliography\\(?:style\\)?{"
> nil t))
>  (while (re-search-forward "^[ \t]*#+BIBLIOGRAPHY:.*$" nil t)
>(when (eq (org-element-type (save-match-data
> (org-element-at-point)))
>  'keyword)
>  (replace-match "")
>   (html
>(when (save-excursion
>(re-search-forward "^[ \t]*#+BIBLIOGRAPHY:.*$" nil t))
>  (while (re-search-forward "^[
> \t]*\\bibliography\\(?:style\\)?{.*$" nil t)
>(replace-match ""))
>
>   (add-hook 'org-export-before-parsing-hook 'my-bibliography-selector-hook)
>
>
> Regards,
>
> --
> Nicolas Goaziou
>


[O] collect info from org files in agenda when open?

2013-07-12 Thread Gregor Zattler
Dear org-mod users and developers,

I customized my org-agenda-files variable to contain 4 files.
But I wished I could automatically add org files to the agenda
simply by opening them.  Is it possible to automagically add
some files to the agenda iff they are visited or add the contents
of org-mode buffers?

Ciao, Gregor
-- 
 -... --- .-. . -.. ..--.. ...-.-



Re: [O] Help with babel and gnuplot

2013-07-12 Thread Paul Stansell
Hi Eric,

Thanks for your quick reply and helpful pointer!  I got it to work.

Paul


On 12 July 2013 20:05, Eric Schulte  wrote:
> You need to install gnuplot.el, which looks like it can be installed
> with ELPA.
>
> Cheers,
>
> Paul Stansell  writes:
>
>> Hello,
>>
>> I hesitate to ask this question as I feel I should be able to work it
>> out myself, but I don't seem to be able to.
>>
>> I'm trying to get gnuplot working via babel.
>>
>> I'm using Emacs 24.2.1 and I have Org-mode release_8.0.6-329-g0c233a
>> installed in ~/org-mode.
>>
>> I'm running
>>
>>  /usr/bin/emacs -Q -l minimal-org.el test.org
>>
>> where minimal-org.el contains just
>>
>>   (setq debug-on-error t
>> debug-on-signal nil
>> debug-on-quit nil)
>>
>>   (add-to-list 'load-path (expand-file-name "~/org-mode/lisp"))
>>
>>   (org-babel-do-load-languages
>> 'org-babel-load-languages
>> '((gnuplot . t)))
>>
>> and test.org contains just
>>
>>   #+begin_src gnuplot :results silent
>> plot x
>>   #+end_src
>>
>> When I press C-c C-c inside the source block I get
>>
>>   Debugger entered--Lisp error: (file-error "Cannot open load file" 
>> "gnuplot")
>> require(gnuplot)
>> org-babel-execute:gnuplot("plot x" ...
>> org-babel-execute-src-block(nil)
>> 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)
>>
>> I've been assuming it's a path issue, but
>> ~/org-mode/lisp/ob-gnuplot.elc is present and I have gnuplot installed
>> in /usr/bin/gnuplot.
>>
>> Any advice would be greatly appreciated.
>>
>> Kind regards,
>>
>> Paul
>>
>
> --
> Eric Schulte
> http://cs.unm.edu/~eschulte



Re: [O] Help with babel and gnuplot

2013-07-12 Thread Eric Schulte
You need to install gnuplot.el, which looks like it can be installed
with ELPA.

Cheers,

Paul Stansell  writes:

> Hello,
>
> I hesitate to ask this question as I feel I should be able to work it
> out myself, but I don't seem to be able to.
>
> I'm trying to get gnuplot working via babel.
>
> I'm using Emacs 24.2.1 and I have Org-mode release_8.0.6-329-g0c233a
> installed in ~/org-mode.
>
> I'm running
>
>  /usr/bin/emacs -Q -l minimal-org.el test.org
>
> where minimal-org.el contains just
>
>   (setq debug-on-error t
> debug-on-signal nil
> debug-on-quit nil)
>
>   (add-to-list 'load-path (expand-file-name "~/org-mode/lisp"))
>
>   (org-babel-do-load-languages
> 'org-babel-load-languages
> '((gnuplot . t)))
>
> and test.org contains just
>
>   #+begin_src gnuplot :results silent
> plot x
>   #+end_src
>
> When I press C-c C-c inside the source block I get
>
>   Debugger entered--Lisp error: (file-error "Cannot open load file" "gnuplot")
> require(gnuplot)
> org-babel-execute:gnuplot("plot x" ...
> org-babel-execute-src-block(nil)
> 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)
>
> I've been assuming it's a path issue, but
> ~/org-mode/lisp/ob-gnuplot.elc is present and I have gnuplot installed
> in /usr/bin/gnuplot.
>
> Any advice would be greatly appreciated.
>
> Kind regards,
>
> Paul
>

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



[O] Help with babel and gnuplot

2013-07-12 Thread Paul Stansell
Hello,

I hesitate to ask this question as I feel I should be able to work it
out myself, but I don't seem to be able to.

I'm trying to get gnuplot working via babel.

I'm using Emacs 24.2.1 and I have Org-mode release_8.0.6-329-g0c233a
installed in ~/org-mode.

I'm running

 /usr/bin/emacs -Q -l minimal-org.el test.org

where minimal-org.el contains just

  (setq debug-on-error t
debug-on-signal nil
debug-on-quit nil)

  (add-to-list 'load-path (expand-file-name "~/org-mode/lisp"))

  (org-babel-do-load-languages
'org-babel-load-languages
'((gnuplot . t)))

and test.org contains just

  #+begin_src gnuplot :results silent
plot x
  #+end_src

When I press C-c C-c inside the source block I get

  Debugger entered--Lisp error: (file-error "Cannot open load file" "gnuplot")
require(gnuplot)
org-babel-execute:gnuplot("plot x" ...
org-babel-execute-src-block(nil)
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)

I've been assuming it's a path issue, but
~/org-mode/lisp/ob-gnuplot.elc is present and I have gnuplot installed
in /usr/bin/gnuplot.

Any advice would be greatly appreciated.

Kind regards,

Paul



Re: [O] Several questions about beamer export

2013-07-12 Thread Nick Dokos
Darlan Cavalcante Moreira  writes:

> I don't think you can change the behavior of a link type to take into
> account somethink similar to graphicspath, but you can easily define
> custom link types: For instance, put this in your org-file
> #+LINK: fig file:my_figure_path/%s
>
> Then you will be able to You write a link such as 
>
> [[fig:some_figure.png]]
>
>
> ps: Remember to do "C-c C-c" in the #+LINK line after you insert it.

You know, at some point in the distant past, I think I knew this - but
it must have escaped some time ago and I never noticed.

Thanks! And just in time too: I'm preparing a presentation and I can use
this. That *might* be enough to imprint it in my memory - but I wouldn't
be too sure...

-- 
Nick




Re: [O] org-clock-idle-time

2013-07-12 Thread Nick Dokos
da...@adboyd.com (J. David Boyd) writes:

> Ivan Andrus  writes:
>
>> Do you have a stale .elc or somewhere?  Those are the bane of my existence.
>>
>> -Ivan
>>
>> On Jul 12, 2013, at 9:39 AM, J. David Boyd  wrote:
>>
>>> Nick Dokos  writes:
>>> 
 da...@adboyd.com (J. David Boyd) writes:
 
> A while back I set this to 5 minutes, and tried it for a while, and 
> decided I
> didn't like it, and set it back to never.
> 
> ...
> I've grepped all my .el and .org files, and can find no references to that
> variable anywhere.
> 
> However, it still fires off after 5 minutes.  I come back to my emacs 
> window
> to clock out of the current task and into another one, and I get prompted 
> to
> decide what to do with my idle time.
> 
> Any ideas where this setting is hiding?
> 

Is it org-resolve-clocks-if-idle that gets called? If so, how about
doing an edebug-defun on it? It'll stop when it next gets called and you
can poke around to see what's happening.

 
 Did you check your customize file?
 C-h v custom-file RET
>>> 
>>> Yes, thanks.  First place I looked.  It's custom.el on my system.
>>> 
>>> 
>
>
> Great idea, but, sadly, no...
>
>
>

-- 
Nick




Re: [O] Several questions about beamer export

2013-07-12 Thread Darlan Cavalcante Moreira

I don't think you can change the behavior of a link type to take into
account somethink similar to graphicspath, but you can easily define
custom link types: For instance, put this in your org-file
--8<---cut here---start->8---
#+LINK: fig file:my_figure_path/%s
--8<---cut here---end--->8---

Then you will be able to You write a link such as 

--8<---cut here---start->8---
[[fig:some_figure.png]]
--8<---cut here---end--->8---


ps: Remember to do "C-c C-c" in the #+LINK line after you insert it.

-- 
Darlan Cavalcante Moreira
darc...@gmail.com


ndo...@gmail.com writes:

> Julien Cubizolles  writes:
>
>> Nick Dokos  writes:
>>
>>> Julien Cubizolles  writes:
>>>
>>>
 * in LaTeX you can use \graphicspath to define the directories in which
   to look for picture files. Does org mode offer the same possibility ?

>>>
>>> No special mechanism afaik, but there is a general one.  Did you try
>>> adding something like
>>>
>>> #+LATEX_HEADER: \graphicspath{{images/}}
>>
>> I wasn't clear enough in my question. I would like the links in orgmode
>> made relative to a common root defined in the preamble.
>>
>
> Ah, OK - I misunderstood. AFAIK, the answer is "no".





Re: [O] org-clock-idle-time

2013-07-12 Thread J. David Boyd
Ivan Andrus  writes:

> Do you have a stale .elc or somewhere?  Those are the bane of my existence.
>
> -Ivan
>
> On Jul 12, 2013, at 9:39 AM, J. David Boyd  wrote:
>
>> Nick Dokos  writes:
>> 
>>> da...@adboyd.com (J. David Boyd) writes:
>>> 
 A while back I set this to 5 minutes, and tried it for a while, and 
 decided I
 didn't like it, and set it back to never.
 
 ...
 I've grepped all my .el and .org files, and can find no references to that
 variable anywhere.
 
 However, it still fires off after 5 minutes.  I come back to my emacs 
 window
 to clock out of the current task and into another one, and I get prompted 
 to
 decide what to do with my idle time.
 
 Any ideas where this setting is hiding?
 
>>> 
>>> Did you check your customize file?
>>> C-h v custom-file RET
>> 
>> Yes, thanks.  First place I looked.  It's custom.el on my system.
>> 
>> 


Great idea, but, sadly, no...




Re: [O] Help with new exporter

2013-07-12 Thread Nick Dokos
John Rakestraw  writes:

> On Fri, 12 Jul 2013, Nick Dokos wrote:
>> I hope you are ultimately successful in producing exams that look
>> exactly like you want them, using these mechanisms. But I have my
>> doubts
>> - you have won a battle, but the war is still raging afaict. OTOH, if
>> you prove me wrong, I would be delighted!
>
> Perhaps I'm misunderstanding something (if so, please leave me alone
> in my ignorance at least for a bit), but I'm thinking I've won this
> particular war -- at least, I'm now able to use the exam document
> class to produce an exam formatted to match my expectations.
>

Oh, I thought that was only the first step. At least, the experiments
I was doing last night were *much* less successful, so I projected my
problems onto you. In any case, I'm glad you can do that - and if
I ever need to produce exams, I know who to contact :-)
-- 
Nick




[O] habit-only agenda that doesn't remove tasks when done?

2013-07-12 Thread Christopher Allan Webber
Hello,

I'd like to have a habit-only agenda view, if possible, that looks a bit
like:


Morning habits
--

life:  TODO Shave   [   * *  ** !]  habit::morning:
rsi:   TODO morning stretches   [  **   ****   *!]  habit::morning:

Night habits


life:  TODO Exercise[   * *  ** !]  habit::night:


... and maybe an other category for cathing the rest.

I'd also like to have these habits not drop off the agenda view when I
move them to DONE if possible.  However, I'm getting the sense that this
isn't possible... it seems like the habit system works with
agendas-only, and there's no way to say "give me an agenda with only
these certain things on it".

Or, alternate option: is it possible to highlight a task with a certain
tag with a certain color?  Like, highlight tags with "morning" as blue,
or something?  I've looked at the way org-habit does it, it looks like
I'd have to do something like the following:

 - add a hook to org-agenda-finalize-hook
 - walk through the agenda and highlight the "morning" tasks manually

I could do that.

The reason for this is I have morning-specific tasks, and I always
narrow just to the morning tasks and then ignore the rest of the habits
for the day.  I'd like to get a view where I see both so I don't forget
to do the rest of the habits for the day.  Yes, I know that sounds
strange :)

There probably aren't easy answers to this, but if there are and I've
been missing them, I'd love to know! :)

 - Chris



Re: [O] org-clock-idle-time

2013-07-12 Thread Ivan Andrus
Do you have a stale .elc or somewhere?  Those are the bane of my existence.

-Ivan

On Jul 12, 2013, at 9:39 AM, J. David Boyd  wrote:

> Nick Dokos  writes:
> 
>> da...@adboyd.com (J. David Boyd) writes:
>> 
>>> A while back I set this to 5 minutes, and tried it for a while, and decided 
>>> I
>>> didn't like it, and set it back to never.
>>> 
>>> ...
>>> I've grepped all my .el and .org files, and can find no references to that
>>> variable anywhere.
>>> 
>>> However, it still fires off after 5 minutes.  I come back to my emacs window
>>> to clock out of the current task and into another one, and I get prompted to
>>> decide what to do with my idle time.
>>> 
>>> Any ideas where this setting is hiding?
>>> 
>> 
>> Did you check your customize file?
>> C-h v custom-file RET
> 
> Yes, thanks.  First place I looked.  It's custom.el on my system.
> 
> 




Re: [O] Help with new exporter

2013-07-12 Thread John Rakestraw

On Fri, 12 Jul 2013, Nick Dokos wrote:

You underestimate my pessimism :-) I had no doubt that you can get 
rid
of specific artifacts using specific filters like this - you could 
after
all, run a sed script on the latex output and get rid of this stuff - 
it

wouldn't be an org-only solution, but that's OK in my book.


Yes, I already had a sed script that would work -- just doggedly trying 
to do it all in one org step.



I hope you are ultimately successful in producing exams that look
exactly like you want them, using these mechanisms. But I have my 
doubts

- you have won a battle, but the war is still raging afaict. OTOH, if
you prove me wrong, I would be delighted!


Perhaps I'm misunderstanding something (if so, please leave me alone in 
my ignorance at least for a bit), but I'm thinking I've won this 
particular war -- at least, I'm now able to use the exam document class 
to produce an exam formatted to match my expectations.


--John

--
John Rakestraw



Re: [O] Help with new exporter

2013-07-12 Thread John Rakestraw

On 12.07.2013 11:27, Rasmus wrote:

 1. You'd want to check for the backend.
 2. To add a two tests use and and check that the correct document
class is being used with string-match.

Untested:

 (when (and ;; check that it's a LaTeX backend
(org-export-derived-backend-p backend 'latex)
(string-match "\\documentclass?[.*?]{exam}" (downcase 
string)))

   (replace-match "" nil nil headline))

Most document will fail the second test and those that don't are
probably the ones you want to target.

–Rasmus


Thanks for this.

--
John Rakestraw



Re: [O] org-clock-idle-time

2013-07-12 Thread J. David Boyd
Nick Dokos  writes:

> da...@adboyd.com (J. David Boyd) writes:
>
>> A while back I set this to 5 minutes, and tried it for a while, and decided I
>> didn't like it, and set it back to never.
>>
>> ...
>> I've grepped all my .el and .org files, and can find no references to that
>> variable anywhere.
>>
>> However, it still fires off after 5 minutes.  I come back to my emacs window
>> to clock out of the current task and into another one, and I get prompted to
>> decide what to do with my idle time.
>>
>> Any ideas where this setting is hiding?
>>
>
> Did you check your customize file?
> C-h v custom-file RET

Yes, thanks.  First place I looked.  It's custom.el on my system.




Re: [O] Help with new exporter

2013-07-12 Thread Nick Dokos
John Rakestraw  writes:

> Success!
>
> Thanks to all for your help. I really do appreciate your time.
>
> I cannot figure out why I'm getting the brackets that no one else is
> getting (Rasmus -- my problem is that they're there and I don't want
> them), but I now have a filter that will take them out:
>
>   (defun jr-org-delete-brackets-from-tex-file
> (text backend info)
> (replace-regexp-in-string "\\[\\]" "" text))
>
>   (add-to-list 'org-export-filter-final-output-functions
>'jr-org-delete-brackets-from-tex-file)
>
> Now to explore how to implement this only when I'm using the exam 
> document
> class, perhaps by using a derived backend. (It may be that it won't 
> cause
> any problems with other classes, but it seems sloppy to have it working
> all the time, no?)
>
> Thanks to Robert for the detailed and careful responses, to Charles for
> suggesting the filters, and to Rasmus for the example that helped me
> straighten me out at the end.
>
> And I can't resist an aside to Nick -- I've really appreciated both
> the tone and the content of your detailed contributions to this list
> over the years. I find it difficult to believe that you're more
> pessimistic than I am, but I take some odd pleasure in making
> something work that you thought wouldn't work. ;-)
>

You underestimate my pessimism :-) I had no doubt that you can get rid
of specific artifacts using specific filters like this - you could after
all, run a sed script on the latex output and get rid of this stuff - it
wouldn't be an org-only solution, but that's OK in my book.

I hope you are ultimately successful in producing exams that look
exactly like you want them, using these mechanisms. But I have my doubts
- you have won a battle, but the war is still raging afaict. OTOH, if
you prove me wrong, I would be delighted!

-- 
Nick




Re: [O] Help with new exporter

2013-07-12 Thread Rasmus
John Rakestraw  writes:

> I cannot figure out why I'm getting the brackets that no one else is
> getting (Rasmus -- my problem is that they're there and I don't want
> them), but I now have a filter that will take them out:

My apology. 


>   (defun jr-org-delete-brackets-from-tex-file
> (text backend info)
> (replace-regexp-in-string "\\[\\]" "" text))
>
>   (add-to-list 'org-export-filter-final-output-functions
>'jr-org-delete-brackets-from-tex-file)
>
> Now to explore how to implement this only when I'm using the exam 
> document
> class, perhaps by using a derived backend. (It may be that it won't 
> cause
> any problems with other classes, but it seems sloppy to have it working
> all the time, no?)

 1. You'd want to check for the backend.
 2. To add a two tests use and and check that the correct document
class is being used with string-match.  

Untested:
 
 (when (and ;; check that it's a LaTeX backend
(org-export-derived-backend-p backend 'latex)
(string-match "\\documentclass?[.*?]{exam}" (downcase string)))
   (replace-match "" nil nil headline))
 
Most document will fail the second test and those that don't are
probably the ones you want to target.

–Rasmus

-- 
A page of history is worth a volume of logic



Re: [O] Several questions about beamer export

2013-07-12 Thread Nick Dokos
Julien Cubizolles  writes:

> Nick Dokos  writes:
>
>> Julien Cubizolles  writes:
>>
>>
>>> * in LaTeX you can use \graphicspath to define the directories in which
>>>   to look for picture files. Does org mode offer the same possibility ?
>>>
>>
>> No special mechanism afaik, but there is a general one.  Did you try
>> adding something like
>>
>> #+LATEX_HEADER: \graphicspath{{images/}}
>
> I wasn't clear enough in my question. I would like the links in orgmode
> made relative to a common root defined in the preamble.
>

Ah, OK - I misunderstood. AFAIK, the answer is "no".

-- 
Nick




Re: [O] Several questions about beamer export

2013-07-12 Thread Julien Cubizolles
Nick Dokos  writes:

> Julien Cubizolles  writes:
>
>
>> * in LaTeX you can use \graphicspath to define the directories in which
>>   to look for picture files. Does org mode offer the same possibility ?
>>
>
> No special mechanism afaik, but there is a general one.  Did you try
> adding something like
>
> #+LATEX_HEADER: \graphicspath{{images/}}

I wasn't clear enough in my question. I would like the links in orgmode
made relative to a common root defined in the preamble.

Julien.




Re: [O] org-clock-idle-time

2013-07-12 Thread Nick Dokos
da...@adboyd.com (J. David Boyd) writes:

> A while back I set this to 5 minutes, and tried it for a while, and decided I
> didn't like it, and set it back to never.
>
> ...
> I've grepped all my .el and .org files, and can find no references to that
> variable anywhere.
>
> However, it still fires off after 5 minutes.  I come back to my emacs window
> to clock out of the current task and into another one, and I get prompted to
> decide what to do with my idle time.
>
> Any ideas where this setting is hiding?
>

Did you check your customize file?
C-h v custom-file RET

-- 
Nick




Re: [O] Help with new exporter

2013-07-12 Thread John Rakestraw

Success!

Thanks to all for your help. I really do appreciate your time.

I cannot figure out why I'm getting the brackets that no one else is
getting (Rasmus -- my problem is that they're there and I don't want
them), but I now have a filter that will take them out:

--8<---cut here---start->8---
 (defun jr-org-delete-brackets-from-tex-file
   (text backend info)
   (replace-regexp-in-string "\\[\\]" "" text))

 (add-to-list 'org-export-filter-final-output-functions
  'jr-org-delete-brackets-from-tex-file)
--8<---cut here---end--->8---

Now to explore how to implement this only when I'm using the exam 
document
class, perhaps by using a derived backend. (It may be that it won't 
cause

any problems with other classes, but it seems sloppy to have it working
all the time, no?)

Thanks to Robert for the detailed and careful responses, to Charles for
suggesting the filters, and to Rasmus for the example that helped me
straighten me out at the end.

And I can't resist an aside to Nick -- I've really appreciated both the
tone and the content of your detailed contributions to this list over 
the
years. I find it difficult to believe that you're more pessimistic than 
I
am, but I take some odd pleasure in making something work that you 
thought

wouldn't work. ;-)

--John

--
John Rakestraw



Re: [O] Help with new exporter

2013-07-12 Thread Nick Dokos
Rasmus  writes:

> Nick. Robert, 
>
> Disclaimer: I didn't follow this thread closely. . . 
>
> Nick Dokos  writes:
>
>>> (sorry, this should've gone to the list the first time)
>>>
>>> Hi John,
>>>
>>> sorry, I can't help you with the filters.
>>>
>>> On the other hand, I don't see any reason why you gt whose square brackets.
>>>
>>> I tried different versions of org-mode, and never got *empty* square
>>> brackets.
>>
>> That was my experience as well...
>
> If one desires empty squares why not use [\mbox{}]?  In LaTeX terms I
> think [\mbox{}] is equivalent or almost equivalent o [], and to Org
> they are different. . .
>

I think you misunderstood here: John Rakestraw seems to get empty sets
of square brackets in the latex file that he produces from his org file.
What Robert pointed out (and what I concurred with) was that when he
runs John's org file through the exporter, he does not get these empty
square brackets. The question is why John on one hand and Robert (and I)
on the other hand see such different behavior from the exporter.

> Otherwise add a (regexp) filter to
> org-export-filter-final-output-functions inserting the missing []s.
>
> Here's an example of a filer I use.  Notice that ox keeps everything
> in a string and in property lists (← just an indexed dictionary).
>
> #+BEGIN_SRC emacs-lisp
> (defun org-latex-filter-nobreaks-double-space (text backend info)
>   "Tries to export \"S1. S2\" as \"S1.~S2\",
>while letting \"S1.  S2\" be exported without tilde"
>   (when (org-export-derived-backend-p backend 'latex)
> (replace-regexp-in-string "\\(\\. \\)\\{1\\}\\([^ ]\\)" ".~\\2" text)))
>
> (add-to-list 'org-export-filter-final-output-functions
>  'org-latex-filter-nobreaks-double-space)
> #+END_SRC
>
> (This may not be a great example as one probably should implement it
>  at org-export-before-processing-hook and insert NO-BREAK SPACEs and
>  tell LaTeX how to handle these).
>
>> Rasmus's derived backend idea might work perhaps - I for one wouldn't
>> know how to implement it at this point. But trying to edit artifacts out
>> after the backend is more or less finished seems to me to be a fruitless
>> approach.
>
> I'm not claiming it's easy (Lisp can be pretty daunting, yes?), but
> it's definitely doable.
>

The "fruitless" label was *not* meant for your derived-backend idea: au
contraire.

John is trying to write filters to edit out all the artifacts that he is
getting. That's what I thought was the fruitless approach. The derived
backend approach seems to me to be the *only* (or at least the best)
one for mapping org files to the exam class.

I'm sure it is doable: knowing *how* to do it is another matter though -
and it's not so much the Lisp, it's figuring out how everything has to
go together, given the framework (and all the supporting infrastructure)
that Nicolas has provided. I can deal with the Lisp but I just don't
know enough about the new exporter framework to even do a trivial
backend at this point.

>  1. You start by thinking about how you want your layout to be.  This
> is particularly the case if you don't want to (mis)use the *s for
> everything.  For instance the Org file Robert posted had a lot of
> repeated things that might as well be handeled by the computer.
>  2. Then you write functions that translate the elements that you want
> to work differently into LaTeX code and put 'em into
> the :translate-alist.  All functions that you're not adding will
> come from the LaTeX class.
>
> Here's some documentations (somewhat heavy)
>
>  http://orgmode.org/manual/Adding-export-back_002dends.html
>  http://orgmode.org/worg/dev/org-export-reference.html
>
> and an not-so-enlightening example
>
>  http://orgmode.org/worg/exporters/filter-markup.html
>
>
> Further: I'm working on a section for the manual on ways of adding new
> backends, but alas I must spend my time on other activities at the
> moment. Of course, the present discussion of implementing an exam
> class is a much more interesting example than the cookbook I'm working
> on at the moment :)  
>

More tutorials is exactly what's needed, so thanks for the pointers
- and any future tutorials you provide as well :-)

> –Rasmus

-- 
Nick




Re: [O] Help with new exporter

2013-07-12 Thread Rasmus
Nick. Robert, 

Disclaimer: I didn't follow this thread closely. . . 

Nick Dokos  writes:

>> (sorry, this should've gone to the list the first time)
>>
>> Hi John,
>>
>> sorry, I can't help you with the filters.
>>
>> On the other hand, I don't see any reason why you gt whose square brackets.
>>
>> I tried different versions of org-mode, and never got *empty* square
>> brackets.
>
> That was my experience as well...

If one desires empty squares why not use [\mbox{}]?  In LaTeX terms I
think [\mbox{}] is equivalent or almost equivalent o [], and to Org
they are different. . .

Otherwise add a (regexp) filter to
org-export-filter-final-output-functions inserting the missing []s.

Here's an example of a filer I use.  Notice that ox keeps everything
in a string and in property lists (← just an indexed dictionary).

#+BEGIN_SRC emacs-lisp
(defun org-latex-filter-nobreaks-double-space (text backend info)
  "Tries to export \"S1. S2\" as \"S1.~S2\",
   while letting \"S1.  S2\" be exported without tilde"
  (when (org-export-derived-backend-p backend 'latex)
(replace-regexp-in-string "\\(\\. \\)\\{1\\}\\([^ ]\\)" ".~\\2" text)))

(add-to-list 'org-export-filter-final-output-functions
 'org-latex-filter-nobreaks-double-space)
#+END_SRC

(This may not be a great example as one probably should implement it
 at org-export-before-processing-hook and insert NO-BREAK SPACEs and
 tell LaTeX how to handle these).

> Rasmus's derived backend idea might work perhaps - I for one wouldn't
> know how to implement it at this point. But trying to edit artifacts out
> after the backend is more or less finished seems to me to be a fruitless
> approach.

I'm not claiming it's easy (Lisp can be pretty daunting, yes?), but
it's definitely doable.

 1. You start by thinking about how you want your layout to be.  This
is particularly the case if you don't want to (mis)use the *s for
everything.  For instance the Org file Robert posted had a lot of
repeated things that might as well be handeled by the computer.
 2. Then you write functions that translate the elements that you want
to work differently into LaTeX code and put 'em into
the :translate-alist.  All functions that you're not adding will
come from the LaTeX class.

Here's some documentations (somewhat heavy)

 http://orgmode.org/manual/Adding-export-back_002dends.html
 http://orgmode.org/worg/dev/org-export-reference.html

and an not-so-enlightening example

 http://orgmode.org/worg/exporters/filter-markup.html


Further: I'm working on a section for the manual on ways of adding new
backends, but alas I must spend my time on other activities at the
moment. Of course, the present discussion of implementing an exam
class is a much more interesting example than the cookbook I'm working
on at the moment :)  

–Rasmus

-- 
Send from my Emacs




[O] End of file during parsing; org-element-paragraph-separate void

2013-07-12 Thread Boyan Penkov
Hello all,

I'm writing to report a problem with org-plus-contrib (version 20130712) 
installing on my system.  I'm running emacs 24.3 from http://emacsformacosx.com/

Selecting org-plus-contrib from M-x package-list-packages and running the 
install yields the following output


Contacting host: elpa.gnu.org:80
Saving file /Users/boyanpenkov/.emacs.d/elpa/archives/gnu/archive-contents...
Wrote /Users/boyanpenkov/.emacs.d/elpa/archives/gnu/archive-contents
Saving file /Users/boyanpenkov/.emacs.d/elpa/archives/org/archive-contents...
Wrote /Users/boyanpenkov/.emacs.d/elpa/archives/org/archive-contents
Mark saved where search started
Contacting host: orgmode.org:80
Parsing tar file...done
Extracting org-plus-contrib-20130712/README_ELPA
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/README_ELPA
Extracting org-plus-contrib-20130712/COPYING
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/COPYING
Extracting org-plus-contrib-20130712/ob-C.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-C.el
Extracting org-plus-contrib-20130712/ob-R.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-R.el
Extracting org-plus-contrib-20130712/ob-asymptote.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-asymptote.el
Extracting org-plus-contrib-20130712/ob-awk.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-awk.el
Extracting org-plus-contrib-20130712/ob-calc.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-calc.el
Extracting org-plus-contrib-20130712/ob-clojure.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-clojure.el
Extracting org-plus-contrib-20130712/ob-comint.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-comint.el
Extracting org-plus-contrib-20130712/ob-core.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-core.el
Extracting org-plus-contrib-20130712/ob-css.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-css.el
Extracting org-plus-contrib-20130712/ob-ditaa.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-ditaa.el
Extracting org-plus-contrib-20130712/ob-dot.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-dot.el
Extracting org-plus-contrib-20130712/ob-emacs-lisp.el
Wrote 
/Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-emacs-lisp.el
Extracting org-plus-contrib-20130712/ob-eukleides.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-eukleides.el
Extracting org-plus-contrib-20130712/ob-eval.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-eval.el
Extracting org-plus-contrib-20130712/ob-exp.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-exp.el
Extracting org-plus-contrib-20130712/ob-fomus.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-fomus.el
Extracting org-plus-contrib-20130712/ob-fortran.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-fortran.el
Extracting org-plus-contrib-20130712/ob-gnuplot.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-gnuplot.el
Extracting org-plus-contrib-20130712/ob-haskell.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-haskell.el
Extracting org-plus-contrib-20130712/ob-io.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-io.el
Extracting org-plus-contrib-20130712/ob-java.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-java.el
Extracting org-plus-contrib-20130712/ob-js.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-js.el
Extracting org-plus-contrib-20130712/ob-julia.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-julia.el
Extracting org-plus-contrib-20130712/ob-keys.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-keys.el
Extracting org-plus-contrib-20130712/ob-latex.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-latex.el
Extracting org-plus-contrib-20130712/ob-ledger.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-ledger.el
Extracting org-plus-contrib-20130712/ob-lilypond.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-lilypond.el
Extracting org-plus-contrib-20130712/ob-lisp.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-lisp.el
Extracting org-plus-contrib-20130712/ob-lob.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-lob.el
Extracting org-plus-contrib-20130712/ob-makefile.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-makefile.el
Extracting org-plus-contrib-20130712/ob-mathomatic.el
Wrote 
/Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob-mathomatic.el
Extracting org-plus-contrib-20130712/ob-matlab.el
Wrote /Users/boyanpenkov/.emacs.d/elpa/org-plus-contrib-20130712/ob

Re: [O] Sitemap for google?

2013-07-12 Thread Rick Frankel

On 2013-07-05 19:34, Vikas Rawal wrote:

When I publish my website, orgmode gives me the sitemap as an html.
Google requires sitemap as an xml, rss or text file
(https://support.google.com/webmasters/answer/183668).

Any suggestions on how to get orgmode to create a google-compatible
sitemap?



Have you looked at http://ergoemacs.org/emacs/make_sitemap.html? It 
might be a place to start...


rick



[O] org-clock-idle-time

2013-07-12 Thread J. David Boyd

A while back I set this to 5 minutes, and tried it for a while, and decided I
didn't like it, and set it back to never.

It turns out that many times I clock into a task in Emacs, but a lot of the
work I am doing is not in emacs, so the idle timer was annoying me.

Turned it off, if I look at it with customize-apropos org-clock-idle-time, it
says it is set to never.

I've grepped all my .el and .org files, and can find no references to that
variable anywhere.

However, it still fires off after 5 minutes.  I come back to my emacs window
to clock out of the current task and into another one, and I get prompted to
decide what to do with my idle time.

Any ideas where this setting is hiding?

Thanks,

Dave




Re: [O] Help with new exporter

2013-07-12 Thread Nick Dokos
Robert Klein  writes:

> (sorry, this should've gone to the list the first time)
>
> Hi John,
>
> sorry, I can't help you with the filters.
>
> On the other hand, I don't see any reason why you gt whose square brackets.
>
> I tried different versions of org-mode, and never got *empty* square
> brackets.

That was my experience as well...

>
> E.g. I tried with org-mode 8.0.5 release installed in ~/org-8.0.5  (I
> did a "make" and "make autoloads" in this directory) and used the
> exam.org file as attached and the attached exam.el for configuration.
>
> I started emacs with from the directory exam.org and exam.el are, using
> the following command:
>
> emacs -Q -l exam.el exam.org
>
> Exporting to LaTeX file results in the attached exam.tex.
>
> I tried emacs version 23.1 and 24.2.
>
> (For sure, my latex installation doesn't like the \NoKey and
> \NumberOfVersions ...)
>

... and here too.

>
> You could try, if you get can get the same results I do and then work
> through your emacs configuration.
>
> I've got no other idea at the moment.
>

I may be too pessimistic but it seems to me that the exam class just
does not map to the latex export model cleanly (to be honest, the fact
that it worked in some fashion with the old exporter boggles my mind - I
would not have expected it to, which goes to show that I may be too
pessimistic :-) ).

Rasmus's derived backend idea might work perhaps - I for one wouldn't
know how to implement it at this point. But trying to edit artifacts out
after the backend is more or less finished seems to me to be a fruitless
approach.

Nick





Re: [O] [PATCH] Add "latex" option to ox-bibtex.el

2013-07-12 Thread Nicolas Goaziou
> Really?  This problem can be resolved with hooks or filters?  Could you
> give me more informations or a example?

Perhaps something like the following (untested) should do the trick:

  (defun my-bibliography-selector-hook (backend)
(case backend
  (latex
   (when (save-excursion
   (re-search-forward "^[ \t]*\\bibliography\\(?:style\\)?{" nil t))
 (while (re-search-forward "^[ \t]*#+BIBLIOGRAPHY:.*$" nil t)
   (when (eq (org-element-type (save-match-data (org-element-at-point)))
 'keyword)
 (replace-match "")
  (html
   (when (save-excursion
   (re-search-forward "^[ \t]*#+BIBLIOGRAPHY:.*$" nil t))
 (while (re-search-forward "^[ \t]*\\bibliography\\(?:style\\)?{.*$" 
nil t)
   (replace-match ""))

  (add-hook 'org-export-before-parsing-hook 'my-bibliography-selector-hook)


Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Add "latex" option to ox-bibtex.el

2013-07-12 Thread feng shu
Really?  This problem can be resolved with hooks or filters?  Could you
give me more informations or a example?


-- Forwarded message --
From: Nicolas Goaziou 
Date: Fri, Jul 12, 2013 at 6:36 PM
Subject: Re: [PATCH] Add "latex" option to ox-bibtex.el
To: feng shu 
Cc: "emacs-orgmode@gnu.org" 


Hello,

feng shu  writes:

> From 34d1af7f1b0ecb38000f7a19ad17f3d7bfdf26fa Mon Sep 17 00:00:00 2001
> From: Feng Shu 
> Date: Fri, 12 Jul 2013 15:14:56 +0800
> Subject: [PATCH] Add "latex" optional option to ox-bibtex
>
> * ox-bibtex.el (org-latex-keyword, org-bibtex-get-arguments):
> Add `:latex' properties.
>
> If "latex" option is set to `nil', when export to latex,
> "ox-bibtex"  will not insert bibliography commands in output file.
> you should insert the commands manually, for example:
>
> \#+BIBLIOGRAPHY: foo plain option:-d latex:nil
> \bibliographystyle{otherbibstyle}
> \bibliography{foo}
>
> or:
>
> \#+BIBLIOGRAPHY: foo plain option:-d latex:nil
> \printbibliography

Thanks for your patch.

Though, it seems a bit hackish. Can't you achive the same with hooks or
filters?




Regards,

--
Nicolas Goaziou


Re: [O] org-publish error: "Stack overflow in regexp matcher"

2013-07-12 Thread Nicolas Goaziou
Hello,

Vikas Rawal  writes:

> When I try to publish my site built with org-mode, it scans through
> all files to create the sitemap, and hangs up with error: "Stack
> overflow in regexp matcher". 
>
> Oddly, it scans through all files including the static content. It
> goes through all tar.gz files, pdf files, and what not. 
>
> My project specification is pasted below. Sitemap is supposed to be
> made only with the project "indianstatistics-notes" and not with
> "indianstatistics-static". But orgmode scans through the whole thing
> anyway, and gives the above mentioned error.

I have pushed a fix for that. Could you confirm publishing now behaves
as expected?

Thank you for the detailed report.


Regards,

-- 
Nicolas Goaziou



Re: [O] Help with new exporter

2013-07-12 Thread Robert Klein
(sorry, this should've gone to the list the first time)

Hi John,

sorry, I can't help you with the filters.

On the other hand, I don't see any reason why you gt whose square brackets.

I tried different versions of org-mode, and never got *empty* square
brackets.

E.g. I tried with org-mode 8.0.5 release installed in ~/org-8.0.5  (I
did a "make" and "make autoloads" in this directory) and used the
exam.org file as attached and the attached exam.el for configuration.

I started emacs with from the directory exam.org and exam.el are, using
the following command:

emacs -Q -l exam.el exam.org

Exporting to LaTeX file results in the attached exam.tex.

I tried emacs version 23.1 and 24.2.

(For sure, my latex installation doesn't like the \NoKey and
\NumberOfVersions ...)


You could try, if you get can get the same results I do and then work
through your emacs configuration.

I've got no other idea at the moment.

Best regards
Robert



On 07/12/2013 01:05 AM, John Rakestraw wrote:
> Hi, list --
> 
> I understand the value of working on this myself -- what better way to
> learn? -- but after a few hours of reading the docs and scouring the
> list, I've reached the point of seeking at least a hint for where to go.
> (There's much more information higher in this thread, but I'm trying to
> focus rather narrowly on the problem here to keep the email relatively
> short.)
> 
> I'm trying to export to a pdf, using Phil Hirschhorn's exam.cls. The
> document class definition I have (thanks, Robert!) gets me almost to
> where I need to be. However, it leaves me with square brackets at
> several points in the tex file. I need to delete those brackets.
> 
> That is, I need to change "\begin[]{questions}" to "{\begin{questions}".
> 
> Following Charles's advice, I'm trying to define and use a filter.
> However, I know little enough about LaTeX and lisp that I can't figure
> out why what I have isn't working. At the risk of making it very clear I
> know even less than nothing, here's what I've worked up:
> 
> --8<---cut here---start->8---
>   (defun jr-org-delete-brackets-from-tex-file
>  (text backend info)
>  (while (re-search-forward "\\[]" nil t)
>  (replace-match ""))
>  text)
> 
>(add-to-list 'org-export-filter-final-output-functions
>  'jr-org-delete-brackets-from-tex-file)
> --8<---cut here---end--->8---
> 
> This doesn't work.
> 
> Can someone at least give me a hint on what I need to do differently?
> 
> Thanks very much.
> 


-- 
Robert Klein - Max Planck-Institut für Polymerforschung
Ackermannweg 10
55128 Mainz



(setq load-path (cons "~/org-8.0.5/lisp" load-path))
(require 'org)
(require 'ox)

(setq org-latex-classes
  '(("exam"
 "\\documentclass[12pt]{exam}
% BEGIN exam Defaults
[NO-DEFAULT-PACKAGES]
[PACKAGES]

\\usepackage{palatino}
\\extrawidth{.5in}
\\extraheadheight{-.75in}
\\extrafootheight[-3in]{-.75in}
\\pagestyle{headandfoot}
\\NoKey
\\NumberOfVersions{1}
\\renewcommand\\thequestion{\\Roman{question}}
\\renewcommand\\thepartno{\\arabic{partno}}
\\renewcommand\\partlabel{\\thepartno.}

% END exam Defaults
"
 ("\\begin{questions} %% %s" "\\end{questions}")
 ("\\question %% %s" . "\\question* %% %s")
 ("\\begin{parts} %% %s" "\\end{parts}")
 ("\\part %% %s" . "\\part* %% %s"




exam.org
Description: Lotus Organizer
\documentclass[10pt]{exam}
% BEGIN exam Defaults

\usepackage{palatino}
\extrawidth{.5in}
\extraheadheight{-.75in}
\extrafootheight[-3in]{-.75in}
\pagestyle{headandfoot}
\NoKey
\NumberOfVersions{1}
\renewcommand\thequestion{\Roman{question}}
\renewcommand\thepartno{\arabic{partno}}
\renewcommand\partlabel{\thepartno.}

% END exam Defaults


\extrawidth{.5in}
\extraheadheight[.3in]{-.75in}
\extrafootheight{-.25in}
\raggedright
\author{Robert Klein}
\date{\today}
\title{}
\begin{document}

\renewcommand\thequestion{\Roman{question}}
\renewcommand\thepartno{\arabic{partno}}
\renewcommand\partlabel{\thepartno.}
\firstpageheader{Name:\enspace\makebox[3in]{\hrulefill}\\Exam 1\\}{}{Theo 001 -- Rakestraw\\February 14, 2013\\}
\begin{coverpages}
this is just some text
\end{coverpages}

\begin{questions} % Meaningless header
\label{sec-1}
\question % 
\label{sec-1-1}
\textbf{Identification of Terms}. Identify/define and give the significance
of \textbf{six} of the following. If you identify/define more than six
without indicating clearly which six you want me to grade, I will
grade your first six answers (18 points).
\begin{parts} % Terms
\label{sec-1-1-1}
\part % 
\label{sec-1-1-1-1}
term 1
\vspace*{\fill}

\part % 
\label{sec-1-1-1-2}
term 2
\vspace*{\fill}

\part % 
\label{sec-1-1-1-3}
term 3
\vspace*{\fill}

\part % 
\label{sec-1-1-1-4}
term 4
\vspace*{\fill}

\part % 
\label{sec-1-1-1-5}
term 5
\vspace*{\fill}

\part % 
\label{sec-1-1-1-6}
term 6
\vspace*{\fill}

\part % 
\label{sec-1-1-1-7}
term 7
\vspace*{\fill}

\part % 
\label{sec-1-1-1-8}

Re: [O] [Patch] ob-ditaa.el for Cygwin

2013-07-12 Thread Jambunathan K

Have your tried setting the *Windows* environment variable $HOME via
Windows system settings to d:/cygwin/home/yujie?

Yujie Wen  writes:

> Hi,
>
> ob-ditaa.el calls Java VM to generate pictures. Unfortunately, Cygwin
> doesn't have native Java VM. In order to call the Windows native Java
> VM properly, all Cygwin paths pointing to ditaa.jar, the temporary
> input file and the output picture file must be changed to Windows
> native paths, for example, /home/yujie/ditaa.jar to
> d:/cygwin/home/yujie/ditaa.jar.
>
> Here is a patch that detect whether current Emacs is of Cygwin version
> and, if so, add `cygpath -w ` to wrap all related pathes.
>
> Regards,
> Yujie



[O] [PATCH] org-contacts: Update contacts cache if it contains markers with no buffer

2013-07-12 Thread Øyvind Stegard
Hi list,

In contrib/lisp/org-contacts.el:

The function `org-contacts-db-need-update-p' does two checks to
determine if the contacts cache should be updated:
1. If the variable `org-contacts-last-update' is nil.
2. If modification time of any file containing contacts is more recent than
   timestamp recorded in `org-contacts-last-update'.

There is another case where an update is required: when marker objects
contained in the contact cache `org-contacts-db' suddenly point to no
buffer. If a buffer containing contacts is killed, but underlying file
is not modified, org-contacts will not detect this, and cached markers
that pointed to the now killed buffer will become dead (have no buffer
associated with them). This seems to cause problems at least in
`org-contacts-anniversaries', which if used as diary sexp in an agenda
file, will cause "Bad sexp" errors.

I have not done any thorough analysis of `org-contacts-anniversaries'
itself, but it seems to work OK whenever the markers in
`org-contacts-db' are OK. And it looks like the markers are used in that
code.

To reproduce:
1. Load up org-contacts and do a query with "M-x org-contacts".
2. Kill at least one org-buffer containing a contact with BIRTHDAY
   property set (but do not save underlying file).
3. Make sure to use %%(org-contacts-anniversaries) in some agenda file.
4. Opening agenda should produce a "Bad sexp" error.


I've attached a patch (against git master) which I am currently using.
It will cause org-contacts to re-load if a marker is found in cache that
points to no buffer. This looked to me like the quickest approach for
fixing it without getting to know org-contacts.el better.


Regards,

Øyvind
-- 
< Øyvind Stegard
 < http://stegard.net/

>From e8d5f9ab71f75e5f5087d47e2e86115584db4a03 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=98yvind=20Stegard?= 
Date: Fri, 12 Jul 2013 12:17:12 +0200
Subject: [PATCH] org-contacts: Ensure contacts cache is updated if it contains
 markers with no buffer

* contrib/lisp/org-contacts.el (org-contacts-db-need-update-p):
Check if org-contacts-db cache contains markers with no buffer as well, when
determining if cache should be updated from files.

The function `org-contacts-db-need-update-p' does two checks to determine if the
contacts cache should be updated:
1. If the variable `org-contacts-last-update' is nil.
2. If modification time of any file containing contacts is more recent than
   timestamp recorded in `org-contacts-last-update'.

There is another case where an update is required: when marker objects contained
in the contact cache `org-contacts-db' suddenly point to no buffer. If a buffer
containing contacts is killed, but underlying file is not modified, org-contacts
will not detect this, and cached markers that pointed to the now killed buffer
will become "dead" (e.g. have no buffer associated with them). This seems to cause
problems for instance in `org-contacts-anniversaries', which if used as diary
sexp in agenda file, will cause "Bad sexp" errors.
---
 contrib/lisp/org-contacts.el | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 71f7bf4..a220993 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -224,7 +224,20 @@ A regexp matching strings of whitespace, `,' and `;'.")
   (org-find-if (lambda (file)
 		 (or (time-less-p org-contacts-last-update
   (elt (file-attributes file) 5
-		   (org-contacts-files
+		   (org-contacts-files))
+  (org-contacts-db-has-dead-markers-p org-contacts-db)))
+
+(defun org-contacts-db-has-dead-markers-p (org-contacts-db)
+  "Returns t if at least one dead marker is found in
+ORG-CONTACTS-DB. A dead marker in this case is a marker pointing
+to dead or no buffer."
+;; Scan contacts list looking for dead markers, and return t at first found.
+(catch 'dead-marker-found
+  (while org-contacts-db
+(unless (marker-buffer (nth 1 (car org-contacts-db)))
+  (throw 'dead-marker-found t))
+(setq org-contacts-db (cdr org-contacts-db)))
+  nil))
 
 (defun org-contacts-db ()
   "Return the latest Org Contacts Database."
-- 
1.8.1.2



Re: [O] [bug] latex export ascii encoding

2013-07-12 Thread Nicolas Goaziou
Hello,

Jan-Mark Batke  writes:

> exporting latex causes some trouble here.
>
> - exporting utf-8 ascii does work
> - exporting latin-1 ascii does not work,
>   - the file format is set correctly (1 in mode-line displayed)
>   - inputenc option is set to latin1
>   - content is corrupted, e.g. üöä becomes üöä

I cannot reproduce the problem. Could you post an ECM for that?


Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Add "latex" option to ox-bibtex.el

2013-07-12 Thread Nicolas Goaziou
Hello,

feng shu  writes:

> From 34d1af7f1b0ecb38000f7a19ad17f3d7bfdf26fa Mon Sep 17 00:00:00 2001
> From: Feng Shu 
> Date: Fri, 12 Jul 2013 15:14:56 +0800
> Subject: [PATCH] Add "latex" optional option to ox-bibtex
>
> * ox-bibtex.el (org-latex-keyword, org-bibtex-get-arguments):
> Add `:latex' properties.
>
> If "latex" option is set to `nil', when export to latex,
> "ox-bibtex"  will not insert bibliography commands in output file.
> you should insert the commands manually, for example:
>
> \#+BIBLIOGRAPHY: foo plain option:-d latex:nil
> \bibliographystyle{otherbibstyle}
> \bibliography{foo}
>
> or:
>
> \#+BIBLIOGRAPHY: foo plain option:-d latex:nil
> \printbibliography

Thanks for your patch.

Though, it seems a bit hackish. Can't you achive the same with hooks or
filters?


Regards,

-- 
Nicolas Goaziou



[O] How to trigger the clockcheck in an agenda view.

2013-07-12 Thread Rainer Stengele
Hi,

I want to start an aganda view over a week and immediately check the 
consistency of clock entries:


See manual for agenda dispacther:

v c
Show overlapping clock entries, clocking gaps, and other clocking problems 
in the current agenda range. You can then visit clocking lines and fix them 
manually. See the
variable org-agenda-clock-consistency-checks for information on how to 
customize the definition of what constituted a clocking problem. To return to 
normal agenda display, press l
to exit Logbook mode.


I can't seem to find a way to trigger the clockcheck in the agenda view options.

At the moment I have::

..
("Aw"
 "agenda + no todos - this week - log-mode - ARCHIVE included - clock 
report"
 agenda ""
 (
  (org-agenda-sorting-strategy '(time-up priority-down))
  (org-agenda-span 'week)
  (org-agenda-start-with-log-mode t)
  (org-agenda-archives-mode t)
  (org-agenda-start-with-clockreport-mode t)
  ))
..

Do I miss the variable to be set?

Thanks,
Rainer




[O] [PATCH] Add "latex" option to ox-bibtex.el

2013-07-12 Thread feng shu



0001-Add-latex-optional-option-to-ox-bibtex.patch
Description: Binary data


Re: [O] Several questions about beamer export

2013-07-12 Thread Nicolas Goaziou
Hello,

Nick Dokos  writes:

> While we are talking about cosmetic whitespace issues, let me also point
> out that the default beamer class in ox-beamer contains unnecessary
> indentation. Clearly, it's there to make the lisp code look prettier but
> it makes the resulting latex code uglier. Should anybody care? Eh, I
> don't know... I certainly don't feel strongly about it either way.

This should be fixed. Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] Several questions about beamer export

2013-07-12 Thread Nicolas Goaziou
Hello,

Julien Cubizolles  writes:

> * What's the difference between BEAMER_ENV and BEAMER_env ?

Properties are case insensitive. Therefore there is none.

> * What is the best way to generate 
>  \only<2-3>{Some text of picture} without creating a new heading ?

You can use export snippets:

  @@beamer:\only<2-3>{@@Some text of picture@@beamer:}@@

and for more readability, you can wrap this in a macro:

  #+MACRO: only @@beamer:\only$1{@@$2@@beamer:}@@

Your example becomes:

  {{{only(<2-3>,Some text of picture)}}}
>
> * Is there a shortcut/easy template to ATTR_BEAMER ? I know I could use
>   a yas snippet but maybe there is already something in place.
>
> * in LaTeX you can use \graphicspath to define the directories in which
>   to look for picture files. Does org mode offer the same possibility ?
>
> * All the headers I add end up on the same line when I define them like
>   in the following (even with an empty line).

Not all the headers are concerned. There's only a missing newline
character between the last "header" and the first "header_extra". This
should now be fixed. Thanks for reporting it.


Regards,

-- 
Nicolas Goaziou



Re: [O] Several questions about beamer export

2013-07-12 Thread Nick Dokos
Julien Cubizolles  writes:

> Nick Dokos  writes:
>
>> Julien Cubizolles  writes:
>>
>>> ...
>>> * All the headers I add end up on the same line when I define them like
>>>   in the following (even with an empty line).
>>>
>>>  #+LATEX_HEADER_EXTRA: \institute{My Institure}
>>>   
>>>  #+LATEX_HEADER:\usepackage{mypackage}
>>>
>>>  The LaTeX file produced is not very readable. How can I produce
>>>  linebreaks between different LATEX_HEADER entries ?
>>>
>>
>> You need to modify the code to get them: that's probably an omission
>> (ngz will probably respond in much more detail than I can). They are
>> only cosmetic of course, but if you have to have them, you can try
>> adding them in org-beamer-template around line 880:
>>
>> (concat (plist-get info :latex-header)
>> "\n"  
>> (plist-get info :latex-header-extra)
>> "\n"
>> (plist-get info :beamer-header-extra)
>> "\n")))
>
> Let's make it an improvement suggestion then: getting \usepackage{} and
> \date{} commands mixed in the LaTeX file isn't very nice.
>
>> The problem with this is that the newlines are added even if the
>> various items are empty, so you may end up with more newlines than
>> are necessary.
>
> I'd personally prefer having empty lines instead of everything on the
> same line.
>

While we are talking about cosmetic whitespace issues, let me also point
out that the default beamer class in ox-beamer contains unnecessary
indentation. Clearly, it's there to make the lisp code look prettier but
it makes the resulting latex code uglier. Should anybody care? Eh, I
don't know... I certainly don't feel strongly about it either way.

-- 
Nick




Re: [O] Several questions about beamer export

2013-07-12 Thread Nick Dokos
Julien Cubizolles  writes:


> * in LaTeX you can use \graphicspath to define the directories in which
>   to look for picture files. Does org mode offer the same possibility ?
>

No special mechanism afaik, but there is a general one.  Did you try
adding something like

#+LATEX_HEADER: \graphicspath{{images/}}

to your org file? Whatever you specify as a LATEX_HEADER ends up in the
preamble.

-- 
Nick