Re: [O] Using different image format given the export backend

2013-07-01 Thread Vincent Beffara

Hello,

 #+CAPTION: Toto figure
 #+NAME: fig::toto
 #+ATTR_LATEX: :width 0.38\textwidth
 #+BEGIN_SRC emacs-lisp :exports results :results value raw
(case (and (boundp 'backend) backend)
  (nil )
  (latex [[file:./toto.pdf]]
  (html  [[file:./toto.png]]))
 #+END_SRC

I do it like this:

(defun vb-massage-includegraphics (str backend opts)
  (replace-regexp-in-string .png} .pdf} str))
(add-hook 'org-export-filter-final-output-functions
  'vb-massage-includegraphics)

And then, simply refer to the png file in the .org file. Then nothing
happens for the html output, but on latex export, the regexp matches the
'}' and includes the .pdf file instead.

That is extremely ugly, and makes plenty of assumptions, most of all
that the .pdf file exists. And it should probably test for the value of
'backend'. But for personal use, it is convenient ...

   /v

-- 
Vincent Beffara




Re: [O] Blank lines in date-trees

2013-06-27 Thread Vincent Beffara

Hi Bastien,

 Very (very!) minor question: when capturing into a date-tree, is it
 possible to have a blank line inserted before created day-headings?

 C-h v org-capture-templates RET

 [...]

  :empty-lines-before Set this to the number of lines the should be inserted
  before the new item.  Overrides :empty-lines for the
  number lines inserted before.

 Hope that helps.. and works :)

Thanks - but it doesn't ... More precisely, it does insert a blank line
before the new entry itself, but not before the higher-level month and
day entries that possibly need to be created. Like this:


a question raised in \citet*{BenArous}.
*** 2013-06-27 Thursday

 sldkfj : lskdjf

sldkf


Again, this is *really* minor!

-- 
Vincent Beffara




Re: [O] One more question on bibliographies in Org

2013-06-20 Thread Vincent Beffara

 The main question is: what would be a convenient way to store the
 references in the .org file, to allow for easy editing and exporting
 ?

 What I have done so far is to use some bibtex blocks, which tangle to
 an external bib files. It is sometime useful to have the bibliography
 divided in separate sections inside the org file.

That sounds good for purely LaTeX/PDF exports, thanks for the suggestion.

Now, how to do it for HTML ? Is it possible to choose the tangle format
/ destination depending on the current export backend ?

-- 
Vincent Beffara




[O] One more question on bibliographies in Org

2013-06-18 Thread Vincent Beffara

Hi,

Following the recent trend on the list, although this is not a question
about BibTeX as such, nor about the syntax to use for references within
the text, but rather about how to integrate references in an Org file to
be easily exportable. For now, a central database is not part of the
question, copy-and-paste is ok. The target would be mainly HTML and TeX
export. Here is a sketch:

For HTML: \cite{ABC09} would be mapped to a link to the bibliography,
something like a href=#ABC09[ABC09]/a (regardless of whether there
is such a reference). The bibliography itself would be part of the HTML
page, typically like footnotes right at the end, with some structure
kept (but styling would be done by ad-hoc CSS so nothing much needed
here).

For TeX: AMSRefs sounds good because it makes the .tex file
self-contained. \cite{ABC09} kept as it is, and the bibliography would
be a \begin{bibdiv}/\end{bibdiv} generated from the .org file.


The main question is: what would be a convenient way to store the
references in the .org file, to allow for easy editing and exporting ?

Idea 1: A new block type #+begin_biblio containing the data in whatever
form (but amsrefs makes sense, easily parsable for html export and
nothing to be done for tex export). While we're at it, maybe also
#+begin_bibentry if it helps cross-backend support.

Idea 2: #+begin_src amsrefs, and leverage babel for the output. But I'm
not sure if babel can act differently according to the export backend
being used?

Idea 3: A heading with tag :biblio:, which would be treated as a special
case at some point in the export, and containing one sub-heading per bib
entry, with properties storing the database like in org-bibtex (and
possibly unexported contents for notes). This gives access to structure
manipulation, refile, column view ... which would be awesome, but I'm
not sure how it would fit the export framework.


Which one would be best? Which one would be easiest to implement?

I'm willing to try a bit of coding, but the first step is the hardest
...

Cheers,

/vincent

-- 
Vincent Beffara




[O] Blank lines in date-trees

2013-06-06 Thread Vincent Beffara

Hi, 

Very (very!) minor question: when capturing into a date-tree, is it
possible to have a blank line inserted before created day-headings?

Thx, /v

-- 
Vincent Beffara




Re: [O] Error with \usepackage{amsmath} due to \iint already being defined

2013-05-24 Thread Vincent Beffara

Hi,

 I tracked down an error about \iint already being defined to a clash
 between wasysym and amsmath. I brought in amsmath, but it appears that
 wasysym is an Org LaTeX export default package.

Just put this in the LaTeX header before you load amsmath:

\usepackage{savesym}
\savesymbol{iint}
\savesymbol{iiint}

HTH,
/v

-- 
Vincent Beffara




Re: [O] I merged worg-new-exporter into worg.git master

2013-05-15 Thread Vincent Beffara

Hi,

 I merged worg-new-exporter into worg.git master, and updated
 the emacs.el file on the server -- many thanks again to those
 involved in this move.

Didn't you rather do the opposite? Or do I have the wrong source?

commit 362d3bcd63aa57e940269f5ec74fda52a76dd175
Merge: 2b36b92 f1a4042
Author: Bastien Guerry b...@altern.org
Date:   Tue May 14 11:47:45 2013 +0200

Merge branch 'master' into worg-new-exporter

-- 
Vincent




[O] Choosing image format according to export backend

2013-05-15 Thread Vincent Beffara
Dear list,

I would like to have the same org file export to both PDF (through
LaTeX) and HTML. The problem I have is images: for printing, PDF images
would be best but for display in a browser, it is much better to have a
PNG file rather than a link to the PDF. So what I need is for the
exporter to choose the image differently according to the backend.

I found this piece of code on stackoverflow:

#+begin_src emacs-lisp :exports results :results value raw
(case (and (boundp 'backend) backend)
  (nil )
  (latex [[file:traps.pdf]])
  (html [[file:traps.png]]))
#+end_src

That works, but I was not able to make it recognize captions and such
(except by pasting them in both options or otherwise modifying the lisp
code above). Plus the markup is a bit heavy. Is there a simpler way?

[One thing I thought about was to keep only one of them in the markup,
and modifying the output for the other backend. I kind of know how to
do that within LaTeX by redefining the \includegraphics command but it
feels ... well ... not elegant. Maybe using a hook during one of the
exports?]

Cheers,

-- 
Vincent




Re: [O] Choosing image format according to export backend

2013-05-15 Thread Vincent Beffara
 I would like to have the same org file export to both PDF (through
 LaTeX) and HTML. The problem I have is images: for printing, PDF images
 would be best but for display in a browser, it is much better to have a
 PNG file rather than a link to the PDF. So what I need is for the
 exporter to choose the image differently according to the backend.

... my entry for the dirtiest piece of code possible (but it works for
now):

(defun vb-massage-includegraphics (str backend opts)
  (replace-regexp-in-string .png} .pdf} str))
(add-hook 'org-export-filter-final-output-functions
  'vb-massage-includegraphics)

Am I on the right track? Meaning, after adding a test on the backend,
possibly a file existence check and so on. Or am I missing a simpler
way?

Cheers,

-- 
Vincent




Re: [O] OT: Annotating PDF Org

2013-05-06 Thread Vincent Beffara

 Given the emacs and Org oriented nature of this group, I'd like to
 know if anyone has found a good Orgish (ie: portable, text, etc) to
 annotate PDFs?

 Features would be items like highlighting blocks, adding notes
 (margins or sticky notes), and saving to either a sidecar file in a
 text format (ala Org) or directly appending the PDF.

Not portable probably, but Skim (a very nice PDF viewer for Mac OS X)
supports notes in an xml file next to the PDF, and something like this
would make sense in a more general setting. Maybe using the same spec to
be compatible?

(Skim can then reexport everything as a single PDF file if needed, but a
nice use-case for what you suggest would be something like personal
org-mode reading notes on an article for which keeping them separate
would make more sense.)

  /v

-- 
Vincent Beffara




Re: [O] css link colors for Worg are difficult to spot

2013-04-03 Thread Vincent Beffara
  Even if that's not great, something *better* would be nice already.
  The difficult part is to stick to the colors of the Unicorn while
  making the link more readable
 
 Surely you mean the colors of the Ostrich? (It's April 3, and the
 ostrich is still up on the main Orgmode page.)

The angry unicorn is still in worg though ...




Re: [O] Org as a static site generator

2013-04-01 Thread Vincent Beffara
Hi,

I am using o-blog for that, it is pretty great. One Org file for everything, 
and it actually splits it into one page per marked headline. You can use one of 
the headlines as a template for the nav section of the page, shared across all 
pages. (As you can tell from the name, it is intended as a blogging tool, but 
you don't have to use it that way ...)

The default template might not be to your taste (I don't like it at all, 
personally, so I made my own essentially from scratch) but you can customize it 
easily enough. And it might actually be close to what you are looking for.

Page: http://perso.ens-lyon.fr/vincent.beffara/
Source: https://www.dropbox.com/sh/kdu6myi2ov7y78e/3Ljz5Eipq9
 Thing of a typical HTML5 template having a header, nav, footer,
 and article. I'd like Org to include the different exported files into
 the article section, and the rest to remain the same. The nav would
 contain a global navigation menu, also highlighting the current active
 section (though CSS, no JS please).

I never quite managed to do that ... but it should definitely be doable.

/v



Re: [O] Org as a static site generator

2013-04-01 Thread Vincent Beffara
   Thing of a typical HTML5 template having a header, nav, footer,
   and article. I'd like Org to include the different exported files into
   the article section, and the rest to remain the same. The nav would
   contain a global navigation menu, also highlighting the current active
   section (though CSS, no JS please).
  
  I never quite managed to do that ... but it should definitely be doable.
 
 It's really simple to do. You just have to include some 'id' in the
 body which indicates to which section it belongs to.

Yes, I mean, I know which html you need for that, simply within o-blog you need 
to manage between relative paths, absolute paths, canonical paths and so on in 
the template, to match the right section,  - mainly it should be a matter of 
let-ing the right variable to the right value at the right point in the 
template and catching it when generating the toc, but I never took the time to 
get it right ...
 I've also just found this, which uses Org only as a markup tool and
 Jekyll to generate the site:
 
 http://orgmode.org/worg/org-tutorials/org-jekyll.html
I had a look at the too, but it felt just a little bit too convoluted compared 
to managing everything from Org. Besides, it seems to lose fontification of 
code snippets and the like?

/v



Re: [O] org-caldav will cease to work with Google Calendar

2013-03-19 Thread Vincent Beffara
Hi list, 
 Agreed. Now to look for a replacement ...

For what it's worth: org-caldav works very well with iCloud, but finding the 
correct server settings is a bit non-trivial - which is certainly deliberate of 
Apple. Apple's support for CalDAV is not likely to go away soon AFAICT, so it 
might serve ...

Cheers,

/v



Re: [O] org-caldav will cease to work with Google Calendar

2013-03-16 Thread Vincent Beffara
Hi,
 Supporting the Google Calendar API in org-caldav wouldn't be hard. It's
 actually a very clean, RESTful service; much better than CalDAV, in
 fact. Just what you would expect from Google.
 
 However, this is not a technical issue. This is also why I said that
 anyone who wants to implement support for the Google Calendar API in
 org-caldav should fork it; I won't accept pull requests which implement
 that.

Actually I had a look at the API. It is indeed very clean, but there _is_ a 
technical issue, namely they limit access to a certain number of connections 
per day, and this is accounted per application rather than per user. Right now 
it is 10.000 a day, but just listing all events in a single calendar involves 
paging: for 200 or so events, I had to connect 7 times, and this counts as 7 
connections.

I have no idea how many org users would actually sync with google using their 
proprietary API (given there is support), but reaching the limit would be very 
quick, and very problematic. [Admittedly it is not a technical issue on their 
side, but it would be on ours, somehow.]
 If Google decides to discontinue a well established, IETF-standardized
 API in favor of a proprietary one for which there exist no free server
 implementations, I will not support that. I think the best solution for
 anyone using Google Calendar is to migrate away from that service.

Agreed. Now to look for a replacement ... 

/v

PS: In the mean time, for those who sync only from org to gcal, the option of 
exporting an ics file and hosting it somewhere for google to subscribe to is 
still available, but it is far from being as good.



Re: [O] org-caldav will cease to work with Google Calendar

2013-03-15 Thread Vincent Beffara
Hi, 

First Reader, then this ... that was a bad press release :-( OTOH there is 
already some support for google APIs via the g-client package. One drawback of 
the package is that it doesn't work very well, at least on my machine many 
commands fail. Another one is that it seems not to have moved a lot for years.

But it _can_ list my calendars, meaning that it can authenticate and have some 
sort of interaction with google's servers. Maybe interfacing with that would 
not be too hard? 

One repo here: https://github.com/jaalto/emacs-epackage--g-client (it is also 
in el-get).

/v

-- 
Vincent Beffara


On Thursday, March 14, 2013 at 17:19 , David Engster wrote:

 Google has announced today that they will shut down their CalDAV API in
 September, since hey, everybody's using their own protocol anyway.
 org-caldav will then cease to work with Google calendar. I won't work on
 supporting the Google calendaring API until there's a free server
 implementation for it, which can be self-hosted. If someone else would
 like to work on that, please create a fork under a different name.
 
 -David 





Re: [O] org-caldav can't find org-prepare-agenda-buffers

2013-03-13 Thread Vincent Beffara
Hi,

Agreed ... I believe the only problem will occur when one of a multiply 
occurring event is edited / deleted on the cal side. I have nothing more 
constructive to propose than just don't do that ... My use-case is just as a 
way to push org changes to cal and nothing more, and for bidirectional people 
who would create events on cal and sync, not much bad would happen I believe. 
But you're right, conflict resolution (which is what that would be) will be a 
problem. Would have to manage reference counts etc, for little benefit. Who is 
using multiply occurring events anyway?

Attached is what I am proposing: absent multiply occurring events, the org and 
cal IDs are the same (which is as it was except for the missing 1 in a regexp). 
For the second occurrence, the TS2- prefix is conserved, and so on - but it is 
trimmed when fed to org-id etc. As you say, it is not correct and will lead to 
problems down the road, but I really wanted all occurrences to appear in iCal 
;-)

Cheers,

/v 
 I appreciate your work, of course, but let me add a word of warning. I
 think if you give up the one-to-one correspondence that one Org event
 has exactly *one* event in the remote calendar, you are entering a world
 of pain.
 
 Remember that there are three things: new items, changed items and
 deleted items. Since these can happen on both sides, you have to figure
 out six different cases which must be handled properly. As you've
 already experienced, the changes on the calendar side are more
 difficult. What happens if you delete one of the events that stems from
 one Org entry? You would first have to figure out which timestamp
 created it, but how? Timestamps don't have UIDs, only the full entry has
 one. So you would have to somehow add this information to the event
 database which gets stored to disk. You might get this to work, but I
 have a gut feeling that you'll loose robustness. For example, the Google
 calendar CalDAV interface is pretty slow and not very reliable, so a
 robust resume functionality is essential.
 
 Also, I deliberately shoved conflict handling at the side for the
 moment, but this is a feature which will have to be added one day, and
 will complicate things much more.
 
 -David 



org-caldav-multi.patch
Description: Binary data


Re: [O] org-caldav can't find org-prepare-agenda-buffers

2013-03-12 Thread Vincent Beffara
Hi, 

Yes, I had the very same problem, I had to restart org-caldav from scratch a 
few times (org-caldav-delete-everything, wait a bit for caches to empty, and 
then eventually it worked).

In the meantime I also tweaked the way org-caldav manages UIDs to exploit the 
fact that multiply occurring events are now exported multiple times in 
ox-icalendar, everything works out well if only org-ical is used. One thing 
remaining, on ical-org sync, there is an issue that makes the next sync erase 
the event on ical and upload it again, under another id (and with the info not 
generated by org-caldav missing, of course). I think I know how to fix it, just 
need to find some time ...

I will send what works to the list. (In the meantime, David, don't pull my 
second pull request, it is not right.) 

/v

-- 
Vincent Beffara


On Tuesday, March 12, 2013 at 07:21 , Julien Cubizolles wrote:

 Vincent Beffara vbeff...@ens-lyon.fr (mailto:vbeff...@ens-lyon.fr) writes:
 
  ... sorry for replying to myself like this - here is a patch that seems to 
  work: 
 
 I'm still running into problems even with this patch, but I'm not very
 sure where they lie. Basically I get some messages about duplicate
 entries, no org-caldav-results buffer pops up and a subsequent run of
 org-caldav-sync informs me that the last sync was aborted. 
 
 For now, I'm back with org-7.9.4: sync works without problem from
 org-google and google-org. I'll be willing to test any changes updates
 to org or org-caldav though.
 
 Julien. 





Re: [O] org-caldav can't find org-prepare-agenda-buffers

2013-03-07 Thread Vincent Beffara
Hi, 

Same here. But the error is not in org-caldav, because it is triggered like 
this:

(org-icalendar--combine-files nil ~/Desktop/ECM.org)

where ~/Desktop/ECM.org is a file with nothing but one headline.

/v 

-- 
Vincent Beffara


On Thursday, March 7, 2013 at 10:13 , Julien Cubizolles wrote:

 David Engster d...@randomsample.de (mailto:d...@randomsample.de) writes:
 
  Thanks. I've now pushed a further fix which should hopefully make things
  work with the new exporter. Julien, please let me know if it works.
 
 
 
 Sorry, it doesn't. 
 
 I get the following when running org-caldav with the latest org-mode and
 org-caldav from git.
 
 --8---cut here---start-8---
 byte-code: Wrong type argument: number-or-marker-p, nil
 --8---cut here---end---8---
 
 Let me know what additional information you need to debug it, a
 backtrace...






Re: [O] org-caldav can't find org-prepare-agenda-buffers

2013-03-07 Thread Vincent Beffara
Here is an ECM.el file, run with emacs -Q triggers the crash: 

(custom-set-variables
'(org-icalendar-store-UID t)
)
(setq-default debug-on-error t)
(add-to-list 'load-path ~/.emacs.d/el-get/org-mode/lisp)
(require 'ox-icalendar)
(org-icalendar--combine-files nil ~/Desktop/ECM.org)


without org-icalendar-store-UID it works fine. Not sure the option is needed 
anymore, but at least the crash can be reproduced. BTW my org-mode is at commit 
516f0df.

HTH,

/v

-- 
Vincent Beffara


On Thursday, March 7, 2013 at 11:54 , Nicolas Goaziou wrote:

 Hello,
 
 Vincent Beffara vbeff...@ens-lyon.fr (mailto:vbeff...@ens-lyon.fr) writes:
 
  Same here. But the error is not in org-caldav, because it is triggered like 
  this:
  
  (org-icalendar--combine-files nil ~/Desktop/ECM.org (http://ECM.org))
  
  where ~/Desktop/ECM.org (http://ECM.org) is a file with nothing but one 
  headline.
 
 I cannot reproduce it. Maybe a larger backtrace would help.
 
 
 Regards,
 
 -- 
 Nicolas Goaziou






Re: [O] org-caldav can't find org-prepare-agenda-buffers

2013-03-07 Thread Vincent Beffara
It doesn't crash anymore, thanks!

OTOH when I ran org-caldav, it removed everything from the online calendar, and 
it won't put anything back there ... 

-- 
Vincent Beffara


On Thursday, March 7, 2013 at 13:56 , Nicolas Goaziou wrote:

 Vincent Beffara vbeff...@ens-lyon.fr (mailto:vbeff...@ens-lyon.fr) writes:
 
  Here is an ECM.el file, run with emacs -Q triggers the crash: 
  
  (custom-set-variables
  '(org-icalendar-store-UID t)
  )
  (setq-default debug-on-error t)
  (add-to-list 'load-path ~/.emacs.d/el-get/org-mode/lisp)
  (require 'ox-icalendar)
  (org-icalendar--combine-files nil ~/Desktop/ECM.org (http://ECM.org))
  
  
  without org-icalendar-store-UID it works fine. Not sure the option is
  needed anymore, but at least the crash can be reproduced. BTW my
  org-mode is at commit 516f0df.
 
 
 
 The problem should be fixed in master. Could anyone confirm it?
 
 Thank you for reporting this problem.
 
 
 Regards,
 
 -- 
 Nicolas Goaziou






Re: [O] org-caldav can't find org-prepare-agenda-buffers

2013-03-07 Thread Vincent Beffara
 OTOH when I ran org-caldav, it removed everything from the online calendar, 
 and it won't put anything back there ...

Mmmkay, something weird is happening. I create a headline with a date, and call 
org-caldav. An UID is created, and the file looks like this:

*** Gayet, Damien : Une majoration de l'espérance des nombres de Betti
:PROPERTIES:
:ID: BD783419-0D10-4B88-8540-730ACF03B42E
:END:

2013-03-06 Wed 14:00  

So far so good. But on trying to sync, I get the error that Could not find UID 
TS1-BD783419-0D10-4B88-8540-730ACF03B42E. (Which is the UID in the generated 
ICS file.) So now, iCalendar export works, all that remains is fixing the sync 
code in org-caldav ...

/v
  
  
 --  
 Vincent Beffara
  
  
 On Thursday, March 7, 2013 at 13:56 , Nicolas Goaziou wrote:
  
  Vincent Beffara vbeff...@ens-lyon.fr (mailto:vbeff...@ens-lyon.fr) writes:
   
   Here is an ECM.el file, run with emacs -Q triggers the crash:  

   (custom-set-variables
   '(org-icalendar-store-UID t)
   )
   (setq-default debug-on-error t)
   (add-to-list 'load-path ~/.emacs.d/el-get/org-mode/lisp)
   (require 'ox-icalendar)
   (org-icalendar--combine-files nil ~/Desktop/ECM.org (http://ECM.org))


   without org-icalendar-store-UID it works fine. Not sure the option is
   needed anymore, but at least the crash can be reproduced. BTW my
   org-mode is at commit 516f0df.
   
   
   
   
   
  The problem should be fixed in master. Could anyone confirm it?
   
  Thank you for reporting this problem.
   
   
  Regards,
   
  --  
  Nicolas Goaziou
  






Re: [O] org-caldav can't find org-prepare-agenda-buffers

2013-03-07 Thread Vincent Beffara
... sorry for replying to myself like this - here is a patch that seems to 
work:  

diff --git a/org-caldav.el b/org-caldav.el
index 0383366..14cca8f 100644
--- a/org-caldav.el
+++ b/org-caldav.el
@@ -786,7 +786,7 @@ is no UID to rewrite. Returns the UID.
((re-search-forward ^UID:\\(orgsexp-[0-9]+\\) nil t)
;; This is a sexp entry, so do nothing.
(match-string 1))
- ((re-search-forward ^UID:\\(\\s-*\\)\\([A-Z][A-Z]-\\)?\\(.+\\)\\s-*$
+ ((re-search-forward ^UID:\\(\\s-*\\)\\([A-Z][A-Z][0-9]?-\\)?\\(.+\\)\\s-*$
nil t)
(when (match-string 1)
(replace-match  nil nil nil 1))



I made a pull request to org-caldav, hoping I got it right!

/v  

--  
Vincent Beffara


On Thursday, March 7, 2013 at 14:31 , Vincent Beffara wrote:

  OTOH when I ran org-caldav, it removed everything from the online calendar, 
  and it won't put anything back there ...
  
  
  
 Mmmkay, something weird is happening. I create a headline with a date, and 
 call org-caldav. An UID is created, and the file looks like this:
  
 *** Gayet, Damien : Une majoration de l'espérance des nombres de Betti
 :PROPERTIES:
 :ID: BD783419-0D10-4B88-8540-730ACF03B42E
 :END:
  
 2013-03-06 Wed 14:00  
  
 So far so good. But on trying to sync, I get the error that Could not find 
 UID TS1-BD783419-0D10-4B88-8540-730ACF03B42E. (Which is the UID in the 
 generated ICS file.) So now, iCalendar export works, all that remains is 
 fixing the sync code in org-caldav ...
  
 /v
   
   
  --  
  Vincent Beffara
   
   
  On Thursday, March 7, 2013 at 13:56 , Nicolas Goaziou wrote:
   
   Vincent Beffara vbeff...@ens-lyon.fr (mailto:vbeff...@ens-lyon.fr) 
   writes:

Here is an ECM.el file, run with emacs -Q triggers the crash:  
 
(custom-set-variables
'(org-icalendar-store-UID t)
)
(setq-default debug-on-error t)
(add-to-list 'load-path ~/.emacs.d/el-get/org-mode/lisp)
(require 'ox-icalendar)
(org-icalendar--combine-files nil ~/Desktop/ECM.org (http://ECM.org))
 
 
without org-icalendar-store-UID it works fine. Not sure the option is
needed anymore, but at least the crash can be reproduced. BTW my
org-mode is at commit 516f0df.







   The problem should be fixed in master. Could anyone confirm it?

   Thank you for reporting this problem.


   Regards,

   --  
   Nicolas Goaziou
   
  






Re: [O] Bug: New HTML exporter incorrect attributes

2013-02-25 Thread Vincent Beffara
 #+ATTR_HTML: :options width=\400px\
 
 This is heavier but will be consistent with other back-ends. Otherwise,
 there is also:
 
 #+ATTR_HTML: :width 400px
 
 But this requires to have a list of all properties supported.
How about both? I.e. a short-list of common options (class, title, id for links 
typically) plus a generic options as a back up to put whatever is not in the 
short-list ?

/v, big fan of the ugliest solutions imaginable
 If we take
 that route, here is a suggested list of such properties for a tag:
 
 - rel
 - target
 - type
 - accesskey
 - class
 - style
 - title
 
 and for img
 
 - alt
 - height
 - width
 
 What do you think about it?
 
  The HTML exporter should produce valid HTML regardless of the input.
 
 We cannot remove the ability to shoot oneself in the foot. The HTML
 back-end cannot be responsible for undefined syntax. Think about:
 
 @@html:foo@@
 
  The Org manual describes ATTR_HTML as a feature that applies to the
  following image or link. It makes no mention of restrictions to
  following content in the paragraph, and neither does it say it will
  apply to all following images or links. The manual could be amended to
  say that ATTR_HTML applies to just the next image or link. To fit the
  current situation, it might say, In cases where ATTR_HTML is applied to
  an image in a paragraph, following links will not be made invalid. But
  why would anyone be expecting invalid HTML in the first place?
  
  Incidentally, I always thought that simply using another HTML_ATTR would
  handle multiple images or links in the old exporter. In other words,
  this:
  
  #+ATTR_HTML: width=10 alt= [Cool thing] 
  [[file:cool_thing.jpg]]
  This is a paragraph about cool things.
  #+ATTR_HTML: class=bar
  Cool thing found here [[http://example.com/][example.com]].
  
  Would become this:
  
  p
  img src=cool_thing.jpg width=10 alt= [Cool thing] /This is a 
  paragraph about cool things. Cool thing found here a
  href=http://example.com/; class=barexample.com (http://example.com)/a.
  /p
  
  I don't remember using that in the old exporter, but I thought it would
  work.
  
  It almost works in the new exporter, but it begins a new paragraph
  before the second #+ATTR_HTML. I'm not sure this is the intended
  behavior, though, because it isn't formatted like other new
  paragraphs.
 
 
 
 This is the intended behaviour. Affiliated keywords can only exist at
 the beginning of the element they refer to. So, in the previous example,
 you start two paragraphs.
 
  Alternatively, having ATTR_HTML (or something more general) apply to the
  next thing, and having that work within paragraphs, is another
  possibility. However, this may not fit within the limitations of the
  new parser. Plus it's kind of ugly.
 
 
 
 The parser won't support it. It goes against the definition of an
 affiliated keyword. Moreover, it's merely a hack (what about links in
 tables?). And it's ugly, indeed.
 
  Until there is a proper solution, however, could we please modify the
  exporter to apply ATTR_HTML to only the next image or link? I am very
  sure that was the spirit of the old exporter, and it would be nice if I
  could maintain my documents in Org without resorting to (even more)
  hacks.
 
 
 
 Done.
 
 
 Regards,
 
 -- 
 Nicolas Goaziou






Re: [O] Problem with org-html-format-latex

2013-02-12 Thread Vincent Beffara
Hi, 
  (let ((cache-relpath ) (cache-dir ) bfn)
 
 Mhh... okay. Now should be good.

Yep, thanks! 
 Thanks for your patience.

No thanks needed, nor patience either for that matter, you and the other devs 
are the ones who should be thanked ...

/v
 
 -- 
 Bastien






Re: [O] Problem with org-html-format-latex

2013-02-11 Thread Vincent Beffara
  so simply testing
  on the value of processing-type would work better, maybe?
 
 Yes, should be okay now, let me know!

Nope, exactly the same. cache-relpath and cache-dir are not allowed to be nil. 
Meaning that if processing-type is 'mathjax they should be set to _some_ string 
anyway (the contents will be ignored eventually, but far down the line 
unfortunately ...) Something like instead of your 'let' line works:

(let ((cache-relpath ) (cache-dir ) bfn)

/v





Re: [O] LaTeX export: Theorem with an author

2013-02-11 Thread Vincent Beffara
Hi, 
  #+begin_theorem :options [Him]
  slkdfj
  #+end_theorem
 
 This isn't future-proof. If, for example, we need to add options for the
 HTML back-end, there will be a syntax conflict. The rule is the
 following:
 
 - If the toggle are global, allow them on the block opening string
 (i.e. src-block and code toggles)
 
 - For back-end specific value, use attributes.
Fair enough. Although as Andreas said, something backend-agnostic to specify 
meta-data could still make sense at some point, which each backend could choose 
to implement as reasonable or ignore. You're right that setting LaTeX to add 
[Author] is probably not one of those cases.

Cheers,

/v
 
 
 Regards,
 
 -- 
 Nicolas Goaziou






Re: [O] LaTeX export: Theorem with an author

2013-02-10 Thread Vincent Beffara
Hi,
 There's no right way at the moment: I forgot to implement this.
 
 Anyway, since this feature was LaTeX only, what do you think about the
 following syntax (which doesn't work yet):
 
 #+attr_latex: :options [Newton]
 #+begin_theorem
 Blah.
 #+end_theorem
 
 It is heavier but it seems more consistent to me.
It does seem more consistent with things like fig captions and so on - thanks 
for implementing! A little bit more verbose but that's fine ... and I agree 
that the previous #+begin_theorem Somebody felt a bit vague. How about a 
middle ground like this ?

#+begin_theorem :options [Him]
slkdfj
#+end_theorem
 
 
 Regards,
 
 -- 
 Nicolas Goaziou






Re: [O] Problem with org-html-format-latex

2013-02-10 Thread Vincent Beffara
 thanks for reporting this and for the patch, I've push 
 a slightly different fix. Please test and let me know.

Sounds good to me, thanks!

/v 
 
 Best,
 
 -- 
 Bastien






Re: [O] Problem with org-html-format-latex

2013-02-10 Thread Vincent Beffara
  thanks for reporting this and for the patch, I've push 
  a slightly different fix. Please test and let me know.
 
 Sounds good to me, thanks!

... well it did sound good to me, but it still fails. Put this in *scratch*,

(org-html-format-latex x 'mathjax)

and C-x C-e. Within org-format-latex, file-name-nondirectory is still called on 
the first argument (prefix) which your patch sets to nil. The error occurs one 
layer deeper in the tree but still does. My patch kind of fixed that by 
accident, but it should be safe at least in the case of mathjax which AFAICT 
will never create files anywhere - so simply testing on the value of 
processing-type would work better, maybe?

/v
 
 /v 
  
  Best,
  
  -- 
  Bastien
 






Re: [O] New exporter, beamer confusion

2013-02-07 Thread Vincent Beffara
Hi, 
 LaTeX class is never unspecified because `beamer' back-end is
 a derivative of `latex', and, as such, `org-latex-default-class' will be
 used. `beamer' could specify its own default class, but that class would
 still need to be defined in `org-latex-classes'.

Sure, it should be in the default list. What is the drawback?
 '(beamer
 \\documentclass[presentation]{beamer}
 \[DEFAULT-PACKAGES]
 \[PACKAGES]
 \[EXTRA]
 (\\section{%s} . \\section*{%s})
 (\\subsection{%s} . \\subsection*{%s})
 (\\subsubsection{%s} . \\subsubsection*{%s}))

Looks reasonable. 
  Plain latex export is more problematic because several options are
  reasonable, but I can't see beamer export with an article class ...
 
 But it exists, and is documented in the Beamer User Guide. See section
 21.2. Creating Handouts Using the Article Mode.

Yes, I know that, but the thing is, from a given org-file, I would expect 
beamer export to make the slides and 'plain' latex export to create the 
handout. Maybe it is difficult to achieve but it feels like the most useable 
setup. Is it at all doable?

/v





Re: [O] Problem with org-html-format-latex

2013-02-07 Thread Vincent Beffara
Hi again, 
 A bug occurs with org-html-format-latex (in ox-html.el) when called from a 
 non-file buffer. In the context of o-blog, it gets called as 
 (org-html-format-latex $x$ 'mathjax) but still tries to bind some ltxpng 
 related support. This ends up calling file-name-sans-extension to the output 
 of (file-name-nondirectory (buffer-file-name)) which is nil ...

Cleaner patch uses ignore-errors, that's simpler...

/v

0001-Fix-the-non-file-buffer-bug.patch
Description: Binary data


[O] Problem with org-html-format-latex

2013-02-07 Thread Vincent Beffara
Hi, 

Trying out the new exporter and hoping to have it work with o-blog ...

A bug occurs with org-html-format-latex (in ox-html.el) when called from a 
non-file buffer. In the context of o-blog, it gets called as 
(org-html-format-latex $x$ 'mathjax) but still tries to bind some ltxpng 
related support. This ends up calling file-name-sans-extension to the output of 
(file-name-nondirectory (buffer-file-name)) which is nil ...

Crashing in such a case makes sense for ltxpng but not for mathjax.

This makes it work:

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index f4fc27b..03e09aa 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1994,8 +1994,8 @@ CONTENTS is nil. INFO is a plist holding contextual 
information.
(defun org-html-format-latex (latex-frag processing-type)
(let* ((cache-relpath
(concat ltxpng/ (file-name-sans-extension
- (file-name-nondirectory (buffer-file-name)
- (cache-dir (file-name-directory (buffer-file-name )))
+ (file-name-nondirectory (or (buffer-file-name) )
+ (cache-dir (file-name-directory (or (buffer-file-name) )))
(display-msg Creating LaTeX Image...))

(with-temp-buffer



but feels like the wrong solution, probably cache-relpath and cache-dir should 
be set to nil in such a case ...

Regards,

/v 

-- 
Vincent Beffara





[O] LaTeX export: Theorem with an author

2013-02-07 Thread Vincent Beffara
Hi, 

How to generate latex code for a theorem with an author, like this:

\begin{theorem}[Newton]
Blah.
\end{theorem}

With the old exporter, you could do this:

#+BEGIN_theorem Newton
Blah.
#+END_theorem

(possibly with brackets, not sure) but now the rest of the #+BEGIN_ line is 
ignored ... This works:

#+BEGIN_theorem
[Newton]
Blah.
#+END_theorem

but it is more by accident than anything else. What would be the right way?

Thanks,

/v 

-- 
Vincent Beffara





[O] Archiving workflow suggestion?

2013-02-06 Thread Vincent Beffara
Dear list, 

I am using org-mode to track various tasks, organized chronologically, like 
this:

* 2013
** January
*** Task 1
*** Task 2
** February
*** Task 3

Once a task is completed I want to archive it, but I find it convenient to keep 
it within the same file for further reference. Optimally, using the archive 
sibling feature to save display space. So far so good, everything if fine. Once 
all tasks in a month are completed, I want to archive the month itself (so that 
the CONTENTS view is as clean as possible).

But using the default methods builds an archive-within-an-archive situation. I 
realize it's not exactly a big deal (and the correct default behavior), but I 
would like to unarchive the children of a newly archived month automatically 
to make later traversal easier.

Any suggestion how to do that? Or hints at a better workflow to achieve the 
same thing?

Thanks,

/v

-- 
Vincent Beffara





[O] Bug in org-agenda.el (Was: Bad time display in agenda view)

2013-01-15 Thread Vincent Beffara
Ha, I got it ! 

When displaying the end time of an interval in agenda view, org-agenda 
transforms the initial time stamp to minutes, adds the default length to that 
and maps back to a time stamp using org-minutes-to-clocksum-string. The problem 
being that this functions checks org-time-clocksum-use-effort-durations and if 
set to t, uses that in the formatting. Meaning that 8:00 is displayed as 1d 
0:00 instead, and 17:30 as 2d 1:30 and so on.

I am afraid to change the code, so I just customized 
org-time-clocksum-use-effort-durations to nil and everything works for now. But 
presumably this should be fixed by letting it be nil while formatting the end 
timestamp, somewhere near line 6404 of org-agenda.el ? 

HTH,

Cheers,

/vincent

-- 
Vincent Beffara


On Monday, January 14, 2013 at 11:50 , Vincent Beffara wrote:

 Hi, 
 
 Updated org today (release_7.9.3d-823-gd06fa4), and the times displayed in 
 agenda-view for events of default duration look as if the duration was chosen 
 to be 17 hours: I get this,
 
 Talks: 14:30-1d 7:30sdf : lskdfjlskdjf
 Talks: 17:30-18:30 sdfsdfs : sdf
 
 
 (Here the second one has a timestamp like ... 17:30-18:30 and the first one 
 like ... 14:30.) Everything works out when pushed using org-caldav, so I 
 believe this is just hapening during display. What is happening ?
 
 BTW, my org-agenda-default-appointment-duration is set to 60.
 
 Best,
 
 -- 
 Vincent Beffara






Re: [O] org-caldav: New version with proper two-way sync

2013-01-15 Thread Vincent Beffara
Hi,  

Works great for me, thanks! One thing that changed (but it was kind of a glitch 
anyway, even if a nice one to have): events with several timestamps now appear 
only once rather than one per timestamp. Not sure if this is due to org-caldav 
or to recent evolutions in the org-ics export. Anyway, not a big deal.

One thing hinted at in the docs, but I couldn't figure out how to do it: how do 
you use an authinfo file? Mine seems to be ignored totally ...

Best,

/vincent  

--  
Vincent Beffara


On Monday, January 14, 2013 at 23:29 , Rasmus wrote:

 David Engster d...@randomsample.de (mailto:d...@randomsample.de) writes:
  
  I just pushed a pretty big update to org-caldav.  
  [...]
  The short story: org-caldav now does proper two-way syncing.  
  
  
  
 Wow, that's amazing. I'm looking forward to trying this, although I
 switched to an Org-only calendar now. But it would be great with
 smart phones, I guess!
  
 –Rasmus
  
 --  
 Don't panic!!!






[O] Bad time display agenda view

2013-01-14 Thread Vincent Beffara
Hi, 

Updated org today (release_7.9.3d-823-gd06fa4), and the times displayed in 
agenda-view for events of default duration look as if the duration was chosen 
to be 17 hours: I get this,

Talks: 14:30-1d 7:30sdf : lskdfjlskdjf
Talks: 17:30-18:30 sdfsdfs : sdf


(Here the second one has a timestamp like ... 17:30-18:30 and the first one 
like ... 14:30.) Everything works out when pushed using org-caldav, so I 
believe this is just hapening during display. What is happening ?

BTW, my org-agenda-default-appointment-duration is set to 60.

Best,

-- 
Vincent Beffara





Re: [O] S-TAB cycling opening archive subtrees

2012-12-17 Thread Vincent Beffara
Argh, I can't reproduce it either actually. Probably a consequence of updating 
org-mode and not restarting emacs (so still a bug but a very minor one ...)

Sorry for the noise!

/v 

-- 
Vincent Beffara


On Saturday, December 15, 2012 at 09:32 , Bastien wrote:

 Hi Vincent,
 
 Vincent Beffara vbeffara...@gmail.com (mailto:vbeffara...@gmail.com) writes:
 
  When cycling visibility of a subtree using TAB, subtrees with the :ARCHIVE:
  tag are not opened, and that is a very good thing. But when I cycle a
  buffer globally using S-TAB, their contents are shown, which feels like the
  wrong thing to do ...
 
 
 
 I cannot reproduce this.
 
 With this file and emacs -Q:
 
 * Heading 1
 Test1
 * Heading 2
 Test2
 * Heading (archived) :ARCHIVE:
 Is it shown
 
 S-TAB first folds all headings then it does not reopen the last one.
 
 Is there a way I can reproduce this problem?
 
 Thanks,
 
 -- 
 Bastien






[O] S-TAB cycling opening archive subtrees

2012-12-14 Thread Vincent Beffara
Hi, 

When cycling visibility of a subtree using TAB, subtrees with the :ARCHIVE: tag 
are not opened, and that is a very good thing. But when I cycle a buffer 
globally using S-TAB, their contents are shown, which feels like the wrong 
thing to do ... same if I do C-u TAB instead. C-u S-TAB does the right 
thing, which is cycling globally without opening archived subtrees.

Is that normal? If so, how do I set things up so that S-TAB does what I expect?

Thanks,

/vincent

PS: Using release_7.9.2-722-g2dbd84 on emacs 24.2.1 

-- 
Vincent Beffara





Re: [O] Bug: hl-line obscures org-habit tracking in agenda [7.8.11]

2012-12-10 Thread Vincent Beffara
Hi, 

Same thing here except with TODO keywords, the font is configured to be 
black-on-red and hl-line lays on top of that, giving a black-on-darkgrey. 
Looking at docs about how emacs determines the face at a given location, they 
speak about a stack of specifications but nothing about the ordering of that 
stack - certainly org should be above hl-line ? Any way to change that ? (Maybe 
hl-line uses an overlay, in which case it seems to be hopeless ...)

/v 

-- 
Vincent Beffara


On Thursday, November 29, 2012 at 14:38 , Boyan Penkov wrote:

 Hello,
 
 I'm using org-habit to track habits in the agenda view, displaying the
 consistency graph. I'm also using hl-line to highlight the line the
 cursor is on.
 
 When the habit line is highlighted, the line highlight obscures the
 consistency graph. It seems behavior should be opposite -- i.e: the
 consistency graph should lie atop the highlight bar, such that the
 graph is visible when the line is highlighted.
 
 Thanks!
 
 Emacs : GNU Emacs 24.2.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
 of 2012-08-27 on bob.porkrind.org (http://bob.porkrind.org)
 Package: Org-mode version 7.8.11
 
 current state:
 ==
 (setq
 org-export-preprocess-before-selecting-backend-code-hook 
 '(org-beamer-select-beamer-code)
 org-tab-first-hook '(org-hide-block-toggle-maybe 
 org-src-native-tab-command-maybe
 org-babel-hide-result-toggle-maybe)
 org-speed-command-hook '(org-speed-command-default-hook 
 org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-agenda-start-on-weekday nil
 org-export-preprocess-before-normalizing-links-hook 
 '(org-remove-file-link-modifiers)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc 
 org-beamer-auto-fragile-frames
 org-beamer-place-default-actions-for-lists)
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-agenda-skip-scheduled-if-done t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
 org-src-mode-configure-edit-buffer)
 org-tags-column 80
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[nil \300\301\302\303\304$\207
 [org-add-hook change-major-mode-hook org-show-block-all append local] 5]
 #[nil \300\301\302\303\304$\207
 [org-add-hook change-major-mode-hook org-babel-show-result-all append local] 
 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point 
 org-babel-execute-safely-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
 org-cycle-show-empty-lines
 org-optimize-window-after-visibility-change)
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-export-blocks '((src org-babel-exp-src-block nil) (export-comment 
 org-export-blocks-format-comment t)
 (ditaa org-export-blocks-format-ditaa nil) (dot org-export-blocks-format-dot 
 nil))
 org-agenda-tags-column 93
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-export-interblocks '((src org-babel-exp-non-block-elements))
 org-modules '(org-bbdb org-bibtex org-docview org-gnus org-info org-jsinfo 
 org-habit org-irc org-mew
 org-mhe org-rmail org-vm org-wl org-w3m)
 org-agenda-ndays 9
 org-deadline-warning-days 0
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-habit-graph-column 75
 org-agenda-files '(~/Vazhno/Logs/ToDo/todo.org (http://todo.org))
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )
 
 --
 Boyan Penkov


attachment: Screen Shot 2012-12-10 at 13.40.34.png

Re: [O] [ANN] e-icalendar back-end

2012-11-05 Thread Vincent Beffara
Hi, 

I tried it, nothing gets exported at all ... Is there anything I'm missing ?

/v

-- 
Vincent Beffara


On Saturday, November 3, 2012 at 24:48 , Nicolas Goaziou wrote:

 Hello,
 
 I've just pushed a new (and probably very buggy) iCalendar back-end for
 org-export.el.
 
 To install it:
 
 (require 'org-e-icalendar)
 
 It should then be available under `org-export-dispatch' menu.
 
 There's also a function to write current agenda view to a calendar, but
 it isn't hooked into `org-agenda-write' yet. For now, you can test it,
 from an agenda buffer, with:
 
 M-: (org-e-icalendar-export-current-agenda) 
 
 
 Feedback is welcome.
 
 
 Regards,
 
 -- 
 Nicolas Goaziou






[O] Export of multiply occurring events

2012-10-31 Thread Vincent Beffara
Hi, 

The iCalendar export module is a fantastic way to share an org-mode calendar, 
but there is one thing I am not able to make it do. It will export a single 
event, or a periodically occurring event with a time stamp like ... +1w.

What to do if some item is occurring exactly twice ? Say it is a two-part 
conference, or something like that. Putting two timestamps makes it appear 
twice in the org agenda, but only the later one gets exported.

I could always create sub-events for each occurrence, but then the text will 
not be exported, or will have to be duplicated, which feels sub-optimal.

Is there something I didn't think of ?

Thanks,

/vincent 

-- 
Vincent Beffara





[O] Exporting to HTML without IDs

2012-10-26 Thread Vincent Beffara
Hi, 

I want to manage my web page using org-mode, and to have a navigation bar also 
encoded in org. The problem is that the org-to-html conversion function adds 
IDs to all headers, and the same ids occur on the nav bar and the main content. 
Things link sec-1, outline-2 and so on. The words 'sec' and 'outline' seem to 
be hardcoded. Of course this makes html validators a bit nervous ...

Is there a simple way to either remove those ids, or make them start at say 
1001 for one part?

[In case it matters, I am using o-blog and org-mode 7.9.2 with mostly default 
configuration.] 

Thanks!

/v

-- 
Vincent Beffara





Re: [O] Exporting to HTML without IDs

2012-10-26 Thread Vincent Beffara
Hi, 
 Maybe adding CUSTOM-ID in your navigation bar would solve the problem.
 
 You don't say whether you use the old (current) or the new (in the to-be
 Org 8) HTML exporter??

Don't know, meaning probably the old one ... a CUSTOM-ID property is ignored, 
but it sounds like what I am looking for.

Right now I fixed it by using (replace-gegexp-in-string id=\ id=\nav- 
navbar) in the template, but that implies having a template in the first place, 
which is not always the case.

/v



[O] publish one org-file as many html files

2012-10-16 Thread Vincent Beffara
Dear list, 

Is there a way to publish a huge org file, typically containing a single 
date-tree, into one html file per day / per leaf of the tree ? That would be a 
neat tool to blog using org-mode (org-capture a post into the tree, export, 
you're done).

Cheers,

/vincent

-- 
Vincent Beffara





Re: [O] Publishing one org-file as many html files

2012-10-16 Thread Vincent Beffara
Hi, 

This looks very promising! Quite a bit more sophisticated than what I had in 
mind though, and it is not immediately clear how to customize it, but I will 
look into it. Thanks for the link !

/v 

-- 
Vincent Beffara


On Tuesday, October 16, 2012 at 18:35 , Christopher Witte wrote:

 o-blog should be able to do that, see:
 http://renard.github.com/o-blog/tips/2012/01/07_creating-a-blog.html
 
 On 16 October 2012 18:23, Vincent Beffara vbeffara...@gmail.com 
 (mailto:vbeffara...@gmail.com) wrote:
  Dear list,
  
  Is there a way to publish a huge org file, typically containing a single 
  date-tree, into one html file per day / per leaf of the tree ? That would 
  be a neat tool to blog using org-mode (org-capture a post into the tree, 
  export, you're done).
  
  Cheers,
  
  /vincent
  
  --
  Vincent Beffara
 






Re: [O] Create preamble from an .org file ?

2012-03-28 Thread Vincent Beffara

Hi,


How do I do that? Maybe a dedicated .org file for the navigation bar is
not the right way to do, is there a better one?


Since you only need to export your preamble in HTML once, I'd rather use
`org-export-html-preamble' and set it to the HTML string you want.


Thanks for the tip. In terms of time spent to build a web page, that 
would have been the wise thing to do. However, I wanted something more 
modular, say being able to add a few pages without having to tweak the 
variable each time, and so on.


So in the mean time I cobbled something together, which works for me and 
feels a bit more flexible if I want to modify the navigation bar in the 
page:


(defun my-org-publish-org-to-html (plist filename pubdir)
  (org-pop-to-buffer-same-window
(find-file ~/Boulot/org/web/preamble.org))
(let* ((preamble (org-export-as-html 3 nil nil 'string t))
   (plist (plist-put plist :html-preamble preamble)))
  (org-publish-org-to-html plist filename pubdir)))

(Everything is hard-coded, it should use the :base-directory and test 
whether :html-preamble is equal to 'file or something, and it does not 
feel optimal at all, if only because it exports the preamble once for 
every file - that's more like a proof-of-concept ...)


The file .../preamble.org contains a few links and contact info, and the 
line to #+INCLUDE: the sitemap. Works reasonably well :-) and it could 
be something that others would find useful.


Thanks again,

Cheers,

/vincent





[O] Create preamble from an .org file ?

2012-03-27 Thread Vincent Beffara

Hi,

To manage my personal website I would like to use the publish function 
of org-mode. For the contents of pages, there is no problem, and the 
auto-sitemap feature is promising. however, I would like to have some 
common contents to all the individual pages, and they would best fit in 
the preamble part. Essentially, I would have a preamble.org file 
containing this:



#+IMPORT: sitemap.org

* A few links
  - link 1
  - link 2

* Contact info
  - address
  - email


and the contents of the preamble would be an html version of that (of 
course without all the head section and so on). Optimally, of course, 
preamble.org should not be linked from the site map.


How do I do that? Maybe a dedicated .org file for the navigation bar is 
not the right way to do, is there a better one?


Thanks,

/vincent




[O] Exported html structure

2012-02-27 Thread Vincent Beffara

Hi,

I would like to use jQuery to make the html exported by Org (un)foldable 
by clicking around, mimicking what tabbing does within emacs [except, I 
would like it if folding-and-unfolding-again kept open subtree as they 
were, which is a bit different from what org-mode does and is the root 
of my worry ...]. The structure of the HTML exported by Org is not 
optimal for that. Assume my org file looks like this,


* Header 1
Some contents
** Header 1.1
Contents 1.1
** Header 1.2
Contents 1.2

The HTML output looks like that (some details omitted):

div class=outline-2
  h2Header 1/h2
  div class=outline-text-2Some contents/div
  div class=outline-3
h3Header 1.1/h3
div class=outline-text-3Contents 1.1/div
  /div
  div class=outline-3
h3Header 1.2/h3
div class=outline-text-3Contents 1.2/div
  /div
/div

There is a wrapper around each subtree, but within it things are a 
little too linear for what I want to do: it would be very useful to have 
a div containing the contents of each subtree, everything except the 
title, in addition to what there already is (so that one could hide it, 
unfold it on click to show the headers below, and so on). Something like 
this maybe:


div class=outline-2
  h2Header 1/h2
  div class=contents-2
div class=outline-text-2Some contents/div
div class=outline-3
  h3Header 1.1/h3
  div class=outline-text-3Contents 1.1/div
/div
div class=outline-3
  h3Header 1.2/h3
  div class=outline-text-3Contents 1.2/div
/div
  /div
/div

Is that doable ? If so, how can I do it ? Is that a good idea ?

I _can_ exploit jQuery with the current structure to hide/show all the 
children of a div.outline-2 that are not an h2, and that is my backup 
plan. I can also probably add the div I want by manipulating the DOM in 
jQuery but it sounds very sub-optimal. So I wanted to ask here for 
advice first ... What do you think ?


Thanks for your help !

/vincent




[Orgmode] Re: Coding systems in Babel

2010-12-07 Thread Vincent Beffara

Hello,

 So, the instance of python spawned by C-c C-c receives the text as
 latin-1 encoded. Somewhere a conversion from UTF8 to latin-1
 happens. But I don't want that, I want everything to stay in UTF8 from
 the beginning to the end. I guess I have two questions:

 At what point in the process is the convertion performed ?

 How do I prevent it / how do I specify UTF8 as the exchange format
 between Org-Babel and outside processes spawned by C-c C-c ?

Mmmmkay, answering to myself (you never know, maybe it will be useful to
someone else later ...): the answer to that is in the general
interprocess comunication in Emacs. I ended up doing this:

--8---cut here---start-8---
(setq default-process-coding-system '(utf-8-unix . utf-8-unix))
--8---cut here---end---8---

and everything works fine now.

Having to set this by hand is a bit counter-intuitive though - would it
make sense to have babel set =coding-system-for-read= and
=coding-system-for-write= when running a subprocess ? From what I
understand, =shell-command-on-region= does that automatically but
=org-babel-eval= uses a temporary buffer which loses the encoding choice
for the .org file buffer.

Sorry for the noise, and thanks to all for this excellent tool ! I am
getting addicted to org and babel by the minute ...

Cheers,

/v


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


[Orgmode] Coding systems in Babel

2010-12-06 Thread Vincent Beffara

Hi, it's me again, still trying to make sense of the interaction between
Org, Babel and coding systems. I have, in a UTF8-encoded .org file, this
code block:

--8---cut here---start-8---
#+tblname: toto
| é |

#+begin_src python :var t=toto :preamble # -*- coding: latin1 -*-
babel = unicode (t[0][0],latin1)
local = unicode (é,latin1)
return [len(babel), len(local)]
#+end_src
--8---cut here---end---8---

Evaluating the block with C-c C-c leads to this:

--8---cut here---start-8---
#+results:
| 1 | 1 |
--8---cut here---end---8---

So, the instance of python spawned by C-c C-c receives the text as
latin-1 encoded. Somewhere a conversion from UTF8 to latin-1
happens. But I don't want that, I want everything to stay in UTF8 from
the beginning to the end. I guess I have two questions:

At what point in the process is the convertion performed ?

How do I prevent it / how do I specify UTF8 as the exchange format
between Org-Babel and outside processes spawned by C-c C-c ?

The whole point is to make executed code-blocks and tangled source code
behave the same way - in that particular case, tangling leads to a
UTF8-encoded file, which is what I expected to happen.

Thanks for your help!

   /vincent


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


[Orgmode] Re: Babel, Python and UTF-8

2010-12-03 Thread Vincent Beffara

Hi,

preamble sounds fine (and it would be excellent to allow for a code
block as a preamble, instead of a string in the header or as an
alternative, because preambles once they are allowed tend to grow
uncontrollably ;-)

 The :shebang header argument is only used for tangling, not during
 evaluation, however if you ever needed to tangle python code blocks with
 non-ASCII encodings this would be the appropriate solution.

 Sorry, reading this after the other post...

 But, does it still make sense to make that distinction:

 - some sort of preamble only for tangling?
 - a preamble for evaluation (and tangling)?

One naive question : why is the code path different for tangling and
evaluation ? One would think that a natural way for evaluation would be
to tangle the current block (plus included noweb stuff etc) into a
temporary file and eval that file ... and that would enable shebang for
evaluation as well. There must be something I am missing here.

   /v


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


[Orgmode] Re: Babel, Python and UTF-8

2010-12-03 Thread Vincent Beffara

Hi,

 (and it would be excellent to allow for a code block as a preamble,
 instead of a string in the header or as an alternative, because
 preambles once they are allowed tend to grow uncontrollably ;-)

 This is currently possible using the `sbe' function.  Arbitrary emacs
 lisp can be placed inside of header arguments, and the `sbe' take the
 name of a code block and returns its result.

Very cool ! That does all I want, thanks for the info. For multi-line it
is a bit heavy to write, with lots of \n and preamble .= lskjd, but I
can live with that. Unless there is a way already to write something
like this ?

--8---cut here---start-8---
#+source: my-preamble
#+begin_src python :return preamble
  # -*- coding: utf-8 -*-
  import os,sys,whatever
#+end_src

#+begin_src python :preamble (org-babel-get-and-expand-source-code-body 
my-preamble) :return s
  s = é
#+end_src
--8---cut here---end---8---

There is org-babel-get-src-block-info but it looks at the block around
(point), not by name ... so I guess it would not be too hard to write
the extraction method, but it might be somewhere in the code already.

 One naive question : why is the code path different for tangling and
 evaluation ? One would think that a natural way for evaluation would be
 to tangle the current block (plus included noweb stuff etc) into a
 temporary file and eval that file ... and that would enable shebang for
 evaluation as well. There must be something I am missing here.

 Tangling works for *any* programming language, even those which have yet
 to be created and have no explicit Emacs or Org-mode support, this is
 because on tangling the code block is simply treated as text.

As far as I understood from testing, tangling does adapt to the language
(at least to implement :var in a suitable way), so I was under the
impression that evaluating could be implemented as some kind of wrapping
around the tangled output - and obviously the wrapping would have to be
language-specific even if for the most part the tanglong is not.

I am just discovering all of this, sorry if I have horrible
misconceptions about the thing ...

Regards,

/v


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


[Orgmode] Re: Babel, Python and UTF-8

2010-12-02 Thread Vincent Beffara

 #+begin_src python
 # -*- coding: utf-8 -*-
 s = é
 #+end_src

 I'm not sure to understand your problem. In fact, the problem is not
 about inserting a prefix to the block, it's about the coding system
 itself, I guess.

 Your é in your Org buffer, how is it encoded?  Is your Org buffer an
 UTF-8 one, or a Latin-1?

Doesn't really matter, in fact ... Whenever a python file contains a
non-ascii character (utf-8 or latin-1) it insists on finding an
indication of the encoding within the file. If latin-1, it finds \xe9,
if utf-8, it finds \xc3, but in both cases it raises this:

# SyntaxError: Non-ASCII character '\xe9' in file /Users/vincent/toto.py
# on line 1, but no encoding declared; see
# http://www.python.org/peps/pep-0263.html for details

That's even if the character in question lies within a string. That
makes a lot of sense in terms of portability, but it makes on-the-fly
evaluation a bit more complicated.

 In the second, you want an ISO Latin 1 block of text to be tangled or
 executed as UTF-8. Is this right?

No, I want everything in utf-8, there is no converting to do anywhere,
just telling python that it is utf-8.

 Isn't such a prefix already available through the shebang option:
 can't it be multiline?  Anyway, I don't think it's the problem here...

Hmm, didn't know about :shebang, but it seems to be ignored (at least
for python) because this works without a syntax error:

--8---cut here---start-8---
#+begin_src python :shebang sldfkj
return 1
#+end_src
--8---cut here---end---8---

Anyway, :prefix cannot hurt I guess ...

/v


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


[Orgmode] Re: Babel, Python and UTF-8

2010-12-02 Thread Vincent Beffara

Hi,

 I've just pushed up a new prefix header argument. 

Fantastic ! It works exactly as needed. Thanks a lot !

 This header argument only has meaning for python code blocks (since it
 is tied into evaluation each language would have to handle it
 separately).

That's fine, most cases can probably be handled using something like
prefix anyway. It is just Python insisting to find the coding
instruction in the first 2 lines that causes trouble, so a specific
implementation makes sense.

Thanks again,

   /v


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


[Orgmode] Babel, Python and UTF-8

2010-12-01 Thread Vincent Beffara

Hi,

I am discovering org-mode and org-babel, and wanted to try it out with
python code blocks. My use case would involve text processing, encoded
as UTF-8. Usually a python file has to contain a line to that effect,
saying sth like   # -*- coding: utf-8 -*-(without which an error is
raised).

Is there a way to manage that during org-babel block evaluation ?

Thanks for your help !

   /v


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


[Orgmode] Re: Babel, Python and UTF-8

2010-12-01 Thread Vincent Beffara

Hi,

 I would suggest just trying it out first and seeing if you get an error
 without such a line.

Well, I do, that's why I'm asking ;-)

 Also, you could try adding the line to the beginning of your code
 block.

I tried like this :

--8---cut here---start-8---
#+begin_src python
# -*- coding: utf-8 -*-
s = é
#+end_src
--8---cut here---end---8---

The error message tells me that the error happens on line 4, hence the
coding line ends up on line 3, and python only takes it into account if
it is one of the first two ... so it almost works, but it doesn't.

 If there is definitely a problem please reply to this thread and we
 could easily add a header argument for this case, possibly named
 :prefix which could be used to specify such a code-block-prefix for
 code evaluation.  This header argument could then be set globally or on
 the file, heading, or code block level.

That would be fantastic ! (And possibly useful in other cases as well
...)

Thanks,

/vincent


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