Re: [O] [new exporter] how can I export drawers?

2013-05-02 Thread Carsten Dominik

On 1.5.2013, at 14:28, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 Thomas S. Dye t...@tsdye.com writes:
 
 Hi Eric,
 
 I haven't been following closely, so I'm just checking that you're aware
 of a new variable org-export-allow-bind-keywords, which could play a
 role in the behavior you are seeing.
 
 Thanks Tom.  I am indeed aware of this variable.  And it usually
 works.  For some reason, some times the bindings are ignored but not in
 any consistent manner.  I am going to keep trying to see if I can come
 up with an example that is reproducible but so far no luck!
 
 I should add that, generally, the new exporter is excellent.
 
 My problem has been that I have so many documents on the go (from slides
 to papers, memos, minutes and notes) that the conversion process from
 old to new exporter is causing me a bit of stress.  Typically, when I
 re-visit a document that was prepared with the old exporter, it's
 because I need it *now* and I rush into making the changes that are
 needed for the new exporter... :( Obviously, I need to use org more
 effectively for my time management ;-)

Hi Eric,

I can see that this must be painful, so you are one of the
people who suffer from this more that others.  On the other
hand, this also makes you an asset for Org-mode, because
you keep testing the exporter in many different ways.

I hope that you can stay patient and keep reporting problems
- by the end of this you will have your complete environment
working and the exporter will have gotten better.

Thanks!

- Carsten

 
 Anyway, I have just submitted a paper for publication, written entirely
 in org (+babel), including all the data processing, figure generation,
 etc.  Org is a brilliant tool all around!
 
 Thanks again,
 eric
 
 -- 
 : Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
 : in Emacs 24.3.50.1 and Org release_8.0.1-60-gcb6284
 
 




Re: [O] [Bug] org-startup-with-inline-images

2013-05-02 Thread Daimrod
Rick Frankel r...@rickster.com writes:

 On 01.05.2013 13:28, Daimrod wrote:
 Thanks for the report, I've attached a patch that fixes this problem
 (in
 both `org-display-inline-images' and `org-preview-latex-fragment').
 However I don't know if it is the right approach or if I should try
 to
 narrow this to lower-level functions.

 I know that `clear-image-cache' raise this error but I haven't tried
 to
 see if it the only one. Should I try to look more at it and add a
 `org-clear-image-cache' which will check if a graphic display is
 available or is the current solution fine?

 Looks good. No, I tried narrowing it down myself and it breaks in amy
 other places in org-display-inline-images if you don't simply cond out
 the entire function.

Fixed in master, thanks again for your report!

Regards,

-- 
Daimrod/Greg


pgpTI5qaAOJNF.pgp
Description: PGP signature


Re: [O] section subtitle in latex export

2013-05-02 Thread Rasmus
Aaron Ecay aarone...@gmail.com writes:

 Try the patch attached to this email.  It simply avoids
 inserting the alternate heading whenever it is identical to the
 standard
 one.

Sounds good to me.  Aesthetically, the insertion of \section[·]{·} has
bothered me. . .

–Rasmus

-- 
⠠⠵




Re: [O] selecting columns to export

2013-05-02 Thread Greg Minshall


Sebastien,

 Put a partial echo code block (one where you select in the var header
 argument which columns interest you), and output the results of that
 code block?

thanks!  below is the final result of your suggestion.  (my table was
long, so i had to use longtable; i also used a landscape documentclass
variant in order to hold more columns for printing.)

cheers, Greg

#+LATEX_CLASS_OPTIONS: [letter, landscape]

** the main table :noexport:

#+name: full-table :exports none
| a| b  | c 
|  d | e |  f | g |  h | i |  j | k |  l |  
   m |  n | o |  p | q | r | s |  t |u | v 
|w |x |y | z   |
|--++---++---++---++---++---++---++---++---+---+---++--+---+--+--+--+-|
your data here
|--++---++---++---++---++---++---++---++---+---+---++--+---+--+--+--+-|...

** the partial table, suitable for printing

# uncommented, the following produces a table! (search for src_ in the manual)
# src_emacs-lisp[:var tbl=full-table[,0:5]]{tbl}

#+name: fubar
#+begin_src emacs-lisp :var x=full-table[,0:5] :results silent :exports none
x
#+end_src

#+call: fubar()

# named results, and the importance of w.r.t. attr_latex, courtesy of
# http://lists.gnu.org/archive/html/emacs-orgmode/2012-08/msg00864.html
# http://lists.gnu.org/archive/html/emacs-orgmode/2012-08/msg00868.html

#+ATTR_LATEX: :environment longtable :align l|l|r|r|r|r
#+RESULTS: fubar()




Re: [O] Rationale for *text* - \alert{text} for Beamer export?

2013-05-02 Thread Nicolas Goaziou
Hello,

James Harkins jamshar...@gmail.com writes:

 That would assume that you can customize the string org uses for
 *bold*, which you can't at present... so maybe my hack has some use
 after all.

This has already been discussed, and there's a solution provided at:

  http://orgmode.org/worg/exporters/beamer/ox-beamer.html

No need to add another customize for that. Thank you for your patch,
though.


Regards,

-- 
Nicolas Goaziou



Re: [O] section subtitle in latex export

2013-05-02 Thread Nicolas Goaziou
Hello,

Masataro Asai guicho2.71...@gmail.com writes:

 Reply to myself:

 I edebugged the ox-latex and studied what's happening.
 Who wrote this code?

Obviously, not you.

 you shouldn't do things like this... The code is overwriting the
 defcustom'ed sectioning format, no one knows.

Doing what? Would you mind giving an example of that overwriting thing?

 the best answer for this problem would be changing the structure of
 org-latex-classes

Really?

 but I dont want to do that right now. so I just gave an option for
 alternative-heading.

Why would you want to remove every optional title? That would break
things like tags:not-in-toc and ALT_TITLE properties.


Regards,

-- 
Nicolas Goaziou



Re: [O] section subtitle in latex export

2013-05-02 Thread Nicolas Goaziou
Hello,

Aaron Ecay aarone...@gmail.com writes:

 (Nicolas, I’m waiting to see if you have any thoughts before pushing
 this patch to the org repo.)

That's good. Please push it into maint branch.


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug in structmode++?

2013-05-02 Thread Igor Sosa Mayor
I don't want to be annoying... but am I really alone with this problem?

Am Wed, May 01, 2013 at 05:03:51PM +0200, Igor Sosa Mayor wrote:
 Hi,
 
 Orgstruct minor mode is working with the mail-mode a little strange.
 
 If I write a simple list where every item is smaller than a line, I can
 use M-RET and a new item is inserted as expected.
 
 But if the item goes over one line, the second line is not indented and
 moreover M-RET does not work anymore.
 
 org-version: 8.0.2; emacs: 24.3.1
 
 thanks in advance
 
 -- 
 :: Igor Sosa Mayor :: joseleopoldo1...@gmail.com ::
 :: GnuPG: 0x1C1E2890   :: http://www.gnupg.org/  ::
 :: jabberid: rogorido  ::::



Re: [O] Bug in structmode++?

2013-05-02 Thread Nicolas Goaziou
Hello,

Igor Sosa Mayor joseleopoldo1...@gmail.com writes:

 I don't want to be annoying... but am I really alone with this
 problem?

No, I can confirm this.


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug in structmode++?

2013-05-02 Thread Igor Sosa Mayor
Am Thu, May 02, 2013 at 10:33:42AM +0200, Nicolas Goaziou wrote:

 No, I can confirm this.

Thanks Nicolas. At least, I dont feel alone anymore... Is there any
chance this getting fixed somehow? I used to use it very often in my
emails and I miss it.

-- 
:: Igor Sosa Mayor :: joseleopoldo1...@gmail.com ::
:: GnuPG: 0x1C1E2890   :: http://www.gnupg.org/  ::
:: jabberid: rogorido  ::::



[O] [PATCH v2] ox: Cache locations of fuzzy links

2013-05-02 Thread Lawrence Mitchell
* ox.el (org-export-resolve-fuzzy-link): Look for fuzzy link in a
  cache before trying to resolve it in the parse tree.

When a document contains a large number of identical fuzzy links, it
doesn't make sense to continually search for them.  Instead, cache the
locations in the position independent case.
---
 lisp/ox.el | 42 +-
 1 file changed, 29 insertions(+), 13 deletions(-)

Changes since v1:

- Pull initialisation of link-cache into let
- Don't use cons cells for keys, just use the path
  - lift found check to top-level let since it's now common

Nicolas Goaziou wrote:
 Hello,

 Lawrence Mitchell we...@gmx.li writes:

 * ox.el (org-export-resolve-fuzzy-link): Look for fuzzy link in a
   cache before trying to resolve it in the parse tree.

 Thanks for your patch. A few comments follow.

[...]

 Minor nitpick: I'd rather have this included in the (let ...), like:

   (let (...
 (link-cache
  (or (plist-get info :fuzzy-link-cache)
  (plist-get (setq info (plist-put info :fuzzy-link-cache
   (make-hash-table :test 'eq)))
 :fuzzy-link-cache)

I've made this change.  Barring the eq test.

Remember, paths are strings and two strings are only eq or eql if
they are actually the same string (in memory).  In particular:

(let ((p foo)) (eq (substring p 1) (substring p 1))) = nil
(let ((p foo)) (eql (substring p 1) (substring p 1))) = nil
(let ((p foo)) (equal (substring p 1) (substring p 1))) = t

Hence, we must use equal or string-equal as a test in the hash
table.  But string-equal isn't a predefined test, hence equal.

[...]

 I don't get why you need to use such a key. Simply use the link as key
 and `eq' as the test.

I was worried that I'd have the same key pointing to two
different places, but I see now that those worries were
unfounded, since if we didn't see it in the path case the
first time we never will.  I've simplified the key to just look
for the path.

diff --git a/lisp/ox.el b/lisp/ox.el
index 88b4122..6aa8617 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -3976,27 +3976,43 @@ significant.
 ;; Split PATH at white spaces so matches are space
 ;; insensitive.
 (path (org-split-string
-   (if match-title-p (substring raw-path 1) raw-path
+   (if match-title-p (substring raw-path 1) raw-path)))
+;; Cache for locations of fuzzy links that are not position dependent
+(link-cache
+ (or (plist-get info :fuzzy-link-cache)
+ (plist-get (setq info (plist-put info :fuzzy-link-cache
+  (make-hash-table :test 'equal)))
+:fuzzy-link-cache)))
+(found-in-cache (gethash path link-cache 'fuzzy-link-not-found)))
 (cond
  ;; First try to find a matching path unless user specified
  ;; he was looking for a headline (path starts with a *
  ;; character).
  ((and (not match-title-p)
-  (org-element-map (plist-get info :parse-tree) 'target
-(lambda (blob)
-  (and (equal (org-split-string (org-element-property :value blob))
-  path)
-   blob))
-info t)))
+  (or (not (eq found-in-cache 'fuzzy-link-not-found))
+  (puthash path
+   (org-element-map (plist-get info :parse-tree) 'target
+ (lambda (blob)
+   (and (equal (org-split-string
+(org-element-property :value blob))
+   path)
+blob))
+ info t)
+   link-cache
  ;; Then try to find an element with a matching #+NAME: path
  ;; affiliated keyword.
  ((and (not match-title-p)
-  (org-element-map (plist-get info :parse-tree)
-  org-element-all-elements
-(lambda (el)
-  (let ((name (org-element-property :name el)))
-(when (and name (equal (org-split-string name) path)) el)))
-info 'first-match)))
+  (or (not (eq found-in-cache 'fuzzy-link-not-found))
+  (puthash path
+   (org-element-map (plist-get info :parse-tree)
+   org-element-all-elements
+ (lambda (el)
+   (let ((name (org-element-property :name el)))
+ (when (and name
+(equal (org-split-string name) path))
+   el)))
+ info 'first-match)
+   link-cache
  ;; Last case: link either points to a headline or to nothingness.
  ;; Try to find the source, with priority given to headlines with
  ;; the closest common ancestor.  If such 

Re: [O] ocaml babel no longer works?

2013-05-02 Thread Alan Schmitt
Hello,

I'm resurrecting this old thread as I've made some progress but I
still have questions.

Eric Schulte writes:

 The suggestion: instead of appending 'org-babel-ocaml-eoe;;' to the
 code, how simply put ';;' (which will make sure everything is flushed)
 then detect the toplevel is done by seeing the string '# ' at the
 beginning of the line? Would there be an issue with the fact that this
 line does not have a newline? If so, an alternative suggestion would be
 to use the longer ';; org-babel-ocaml-eoe;;' which makes sure the
 phrase in the input won't interact with the marker.


 You can customize the `org-babel-ocaml-eoe-output' and
 `org-babel-ocaml-eoe-indicator' variables so that they match the above.
 If this proves generally useful then I'd be happy to admit this change
 to the core.

I did this very tiny change and it makes interacting with the top-level
much nicer as one can forget putting ';;'. Here is a tiny diff, which I
can commit if you agree with the change. (As I've added other changes
while writing this email, I attach a proper patch as well for all the
changes.)

,
| diff --git a/lisp/ob-ocaml.el b/lisp/ob-ocaml.el
| index 6a83908..e5ad447 100644
| --- a/lisp/ob-ocaml.el
| +++ b/lisp/ob-ocaml.el
| @@ -63,7 +63,7 @@
|   (session org-babel-ocaml-eoe-output t full-body)
| (insert
|  (concat
| - (org-babel-chomp 
full-body)\norg-babel-ocaml-eoe-indicator))
| + (org-babel-chomp 
full-body);;\norg-babel-ocaml-eoe-indicator))
| (tuareg-interactive-send-input)))
|  (clean
|   (car (let ((re (regexp-quote org-babel-ocaml-eoe-output)) out)
`

 The second feature request: I want to use this for my ocaml lab classes
 (I'm thinking of giving them an org file they have to complete by
 writing the caml code). Could it be possible to have an option for the
 full output of the compiler (and not just the result) to be printed? I
 see it does it when it does not recognize the type of the output. So I
 guess such an option would be applied to either
 org-babel-ocaml-parse-output or the place where it's called.

 I would think adding a :results verbatim header argument would
 suffice, but perhaps this is not the case.

Unfortunately this does not seem to work. I've finally managed to
understand how the code work, and here is a patch to solve this. The
idea is that we do not trim the type information if verbatim is
specified.

,
| @@ -74,10 +74,13 @@
|  (progn (setq out t) nil
|(mapcar #'org-babel-trim (reverse 
raw
|  (org-babel-reassemble-table
| - (let ((raw (org-babel-trim clean)))
| -   (org-babel-result-cond (cdr (assoc :result-params params))
| -;; strip type information from output
| -(if (string-match = \\(.+\\)$ raw) (match-string 1 raw) raw)
| + (let ((raw (org-babel-trim clean))
| +  (result-params (cdr (assoc :result-params params
| +   (org-babel-result-cond result-params
| +;; strip type information from output unless verbatim is specified
| +(if (and (not (member verbatim result-params))
| + (string-match = \\(.+\\)$ raw))
| +(match-string 1 raw) raw)
|  (org-babel-ocaml-parse-output raw)))
|   (org-babel-pick-name
|(cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
`

Finally I found a bug with `org-babel-ocaml-parse-output': if the type
returned by the toplevel was something like int - int = fun, then
the matching against int would be triggered, and the conversion of
fun to an integer would result in 0. To solve this, I made the
regexp more precise as the value returned by the toplevel is:
(identifier | -) : type = value
where the identifier cannot have the ':' character.

Here is the corresponding diff:

,
| @@ -113,7 +116,7 @@
|  (defun org-babel-ocaml-parse-output (output)
|Parse OUTPUT.
|  OUTPUT is string output from an ocaml process.
| -  (let ((regexp %s = \\(.+\\)$))
| +  (let ((regexp [^:]+ : %s = \\(.+\\)$))
|  (cond
|   ((string-match (format regexp string) output)
|(org-babel-read (match-string 1 output)))
`

Hopefully this will be helpful.

Alan

From 9fad60e4a30ce8de779866fabfe1c66e3ffef000 Mon Sep 17 00:00:00 2001
From: Alan Schmitt alan.schm...@polytechnique.org
Date: Thu, 2 May 2013 11:46:27 +0200
Subject: [PATCH] Babel ocaml: Fix the interaction with the toplevel

* lisp/ob-ocaml.el (org-babel-execute:ocaml): Always append ;; at the end of
the expression before sending it to the toplevel.
(org-babel-execute:ocaml): Do not remove the type information if verbatim is a
results parameter of the code block.
(org-babel-ocaml-parse-output): Make sure the complete type is taken into
account when matching against known types.
---
 lisp/ob-ocaml.el | 15 +--
 1 file changed, 9 insertions(+), 6 

Re: [O] Rationale for *text* - \alert{text} for Beamer export?

2013-05-02 Thread Marcin Borkowski
Dnia 2013-05-02, o godz. 02:48:41
James Harkins jamshar...@gmail.com napisał(a):

 John Hendy jw.hendy at gmail.com writes:
 
  Just wondering about the rationale behind using *bold* markup for
  \textbf{} in LaTeX export and to \alert{} in Beamer. Was this a
  frequently voiced request? I'm sure I can dig into this somewhere
  and change it, but if the majority prefers bold (not saying they
  do!), should that be the default?
  
  I'd prefer bold, personally. I don't like red table column titles
  or in 
 lists.
 
 I had asked the same question a while back, and I received some quite
 amusing replies about \alert being the Beamer way... which I
 promptly ignored and implemented my own hack to customize the LaTeX
 command for beamer to use for *bold text* (pasted as a git patch
 below).

So maybe consider \alert{...} being the Beamer way just like strong
being the HTML/CSS way.

 I'm reading Marcin's recommendations carefully, since now, for the
 first time, I need to learn more about tweaking LaTeX's output. I'm
 not sure I agree with all of that line of thought, though.
 
 ~~
 * Keeping that in mind, \alert{...} is /better/ than \textbf{...},
 just like \emph{...} is better than \textit{...}: it is semantic, not
   visual markup.
 ~~
 
 I can understand this rationale if the use case is to export from org
 to a LaTeX file, and then continue to work with the LaTeX file. In
 that case, you would want the exported LaTeX code to follow best
 practices and be maintainable. I'd guess a more common use case for
 org export is to work exclusively with the org markup, and allow the
 exporter to use LaTeX as an intermediary, on the way to PDF. At least,
 this is how *I* use it; it doesn't really bother me if the LaTeX code
 produced by org uses semantic or visual markup. Where I need semantic
 markup (and I will, in my next article), I'll write the semantic
 markup in org.

Fair point.  For me, Org-mode is more of a planner/outliner; using it
for markup/authoring seems awkward for me, since LaTeX is so
natural...  But then, I've been using LaTeX for something like 12 years
(and plain TeX earlier).  (One exception - for me - is authoring of
blog entries, and one day I'll play with an Oddmuse export...)  And I
imagine that for quite a few people, maintainability of the LaTeX code
resulting from Org-mode export might be essential.  And by
maintainability, I mean one of two things: (1) possibility of further
work on the file by a human or (2) possibility of changing the
look-and-feel by just loading a package or a simple customization in
the preamble.  For both cases, sticking as much as possible to semantic
markup in the exported code is crucial.

 I guess I look at this in a way that FAUST [1] uses c++ as an
 intermediary. You write the signal-processing graph in FAUST's own
 purely-functional language, which the FAUST compiler translates into
 c++ (with a variety of headers and wrappers for VST, OSX audio units,
 SuperCollider plug-ins etc.). The resulting c++ is a mess, from the
 standpoint of reading and maintenance, but you're not supposed to
 maintain that code by hand. You're supposed to go back to the FAUST
 code to make changes.
 
 org -- LaTeX -- PDF
 FAUST -- c++ -- DSP plugin
 
 But, going a step further, if semantic markup is what you need,
 wouldn't it be better to define a \newcommand wrapper for \textbf, and
 then tell org to export *bold* using the wrapper? That would assume
 that you can customize the string org uses for *bold*, which you can't
 at present... so maybe my hack has some use after all.

Fair point again.  I think that the point is that - unlike HTML - you
have \emph{...} in LaTeX, but no \strong{...} (or \alert{...} - for
that you need beamer; strangley enough, in the beamerarticle class,
\alert{...} is mapped to \emph{...}).  Now I guess I know the reason,
though it is only my suspicion and not knowledge.

You know, LaTeX is being advertised as being a document preparation
system.  But in fact it's not; it is a scientific paper preparation
system, and more precisely a computer science paper preparation
system.  Everything else are add-ons (packages and classes in
LaTeX-speak).  Even for maths publishing, pure LaTeX core is not
enough: you need at least amsmath/amssymb/amsfonts.  So, with the focus
being on /printed/ documents in a scientific field, boldface in text is
a no-no; basically, the /only/ reasonable use for boldface (apart from
some vector notation, but I'm speaking about text, not formulae here)
is in titles etc., where we don't use \textbf{...} (or {\bfseries ...})
anyway, since they are already packaged in higher-level, semantic
macros like \section{...} or \title{...}/\maketitle etc.

Now with documents other than papers on computer science actually
printed on physical paper, things are different.  But LaTeX (and again
- I mean core LaTeX2e, without additional packages etc.) simply does
not address that.  I wouldn't be surprised, though, if LaTeX3 gets
\strong{...} or 

Re: [O] Bug: org-archive-subtree should not include statitics counters for :ARCHIVE_OLPATH: [8.0.1 (release_8.0.1-10676-gd887b9 @ /home/mrb/dev/emacs/packages/org-mode/lisp/)]

2013-05-02 Thread Marcel van der Boom
On ma 29-apr-2013 10:50
Marcel van der Boom mar...@hsdev.com wrote:

 
 When using org-archive-subtree, any statistic counters present in the
 header will be copied to
 the :ARCHIVE_OLPATH: property.
 

Can anyone else reproduce this? Do I need to provide more information?

Thx,
marcel
-- 
Marcel van der Boom  -- http://hsdev.com/mvdb.vcf
HS-Development BV-- http://www.hsdev.com
We use bitcoin!  -- http://bitcoin.org



Re: [O] Rationale for *text* - \alert{text} for Beamer export?

2013-05-02 Thread Suvayu Ali
On Thu, May 02, 2013 at 02:48:41AM +, James Harkins wrote:
 ... implemented my own hack to customize the LaTeX
 command for beamer to use for *bold text* (pasted as a git patch
 below).

 [...chomp...chomp...chomp...]

 From 8ccbc7cad43b520067b8b29d4660fc99587995fd Mon Sep 17 00:00:00 2001
 From: James Harkins jamshar...@dewdrop-world.net
 Date: Thu, 21 Feb 2013 09:51:02 +0800
 Subject: [PATCH] hjh temp: add customize variable for bold/alert style
 
 ---
  lisp/ox-beamer.el |9 -
  1 file changed, 8 insertions(+), 1 deletion(-)
 
 diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
 index dc427de..44c1c68 100644
 --- a/lisp/ox-beamer.el
 +++ b/lisp/ox-beamer.el
 @@ -206,6 +206,12 @@ You might want to put e.g. \allowframebreaks=0.9\ 
 here.
:group 'org-export-beamer
:type '(string :tag Outline frame options))
  
 +(defcustom org-beamer-bold-macro alert
 +  LaTeX macro to insert for bold text (delimited by asterisks in the org 
 source file).
 +The default \alert\ renders as red text, normal weight.
 +Substitute \textbf\ to obtain boldface.
 +  :group 'org-export-beamer
 +  :type '(string :tag Bold macro))
  
  
  ;;; Internal Variables
 @@ -334,7 +340,8 @@ Return overlay specification, as a string, or nil.
Transcode BLOCK object into Beamer code.
  CONTENTS is the text being bold.  INFO is a plist used as
  a communication channel.
 -  (format \\alert%s{%s}
 +  (format \\%s%s{%s}
 +   org-beamer-bold-macro
 (or (org-beamer--element-has-overlay-p bold) )
 contents))

Not sure a patch introducing yet another variable is warranted when all
you need is a filter:

  http://orgmode.org/worg/exporters/beamer/ox-beamer.html#export-filters

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Rationale for *text* - \alert{text} for Beamer export?

2013-05-02 Thread Suvayu Ali
On Wed, May 01, 2013 at 11:41:49AM -1000, Thomas S. Dye wrote:
 John Hendy jw.he...@gmail.com writes:
 
  On Wed, May 1, 2013 at 10:00 AM, Marcin Borkowski mb...@wmi.amu.edu.pl 
  wrote:
 
 3) So, markup should be semantic, rather than visual.
 
 It is possible to achieve identical results using visual markup, of
 course, but why not let the computer keep track of things instead?
 
  Sure, and understood. In general, I'm using *text* simply to call
  attention to something important. I work in product development, so
  something like:
 
  Customer response to product sampling:
  - *US:* blah blah blah
  - *China:* blah blah blah
  - *India: blah blah blah
 
 Here, to achieve semantic markup, you would use description lists
 
 - US :: blah
 - China :: blah
 - India :: blah

Description lists align at the ::, which can look weird when you have
headings of very different lengths.  So I often use \structure{..}.  I
have a filter that translates +strikethrough+ text to structure[1].


Footnotes:

[1] http://orgmode.org/worg/exporters/beamer/ox-beamer.html#export-filters


-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] section subtitle in latex export

2013-05-02 Thread Masataro Asai
Nicolas,

sorry for my offending remarks in the second message. i was just a little
nervous about that unexpected behavior for me.

org latex classes can be considererd as a template. template is somewhat
similer to lambda. you wouldnt want any function to be modified by another
function which recieved it as its argument.

so if something may be inserted in the template without notice, instead it
should be better if it has more arguments. say additional %s. if only there
is two of them in the template you can add alternative title, this may be
an option. amother option is, giving altered version explicitly. which may
make it accept four templates per sectioning,
numbered,unnumbered,alternative numbered, altered unnumbered. some people,
at least not me, may want this feature.

if user can modify that behavior it would be definitrly better. well, that
may inflate the list of vars in customs, but thats another ploblem.

the reason of cancelling the alt title, the situation im in is written in
the
first message. one journal template throws an error because it does not
recognize altered titles.
maybe i can write a script which regex all alt titles out, but i wanted to
contribute to the development of org.

sorry for many typos, im currentry wrting on android.

masataro
 2013/05/02 17:26 Nicolas Goaziou n.goaz...@gmail.com:

 Hello,

 Masataro Asai guicho2.71...@gmail.com writes:

  Reply to myself:
 
  I edebugged the ox-latex and studied what's happening.
  Who wrote this code?

 Obviously, not you.

  you shouldn't do things like this... The code is overwriting the
  defcustom'ed sectioning format, no one knows.

 Doing what? Would you mind giving an example of that overwriting thing?

  the best answer for this problem would be changing the structure of
  org-latex-classes

 Really?

  but I dont want to do that right now. so I just gave an option for
  alternative-heading.

 Why would you want to remove every optional title? That would break
 things like tags:not-in-toc and ALT_TITLE properties.


 Regards,

 --
 Nicolas Goaziou



Re: [O] Rationale for *text* - \alert{text} for Beamer export?

2013-05-02 Thread James Harkins
On May 2, 2013 4:20 PM, Nicolas Goaziou n.goaz...@gmail.com wrote:
 James Harkins jamshar...@gmail.com writes:

  That would assume that you can customize the string org uses for
  *bold*, which you can't at present... so maybe my hack has some use
  after all.

 This has already been discussed, and there's a solution provided at:

   http://orgmode.org/worg/exporters/beamer/ox-beamer.html

 No need to add another customize for that. Thank you for your patch,
 though.

Fair enough -- that's far more flexible than what I did. I did the hack
months ago, when the documentation of the new exporter hadn't been written.
I never would have guessed that solution, based on the docstrings available
at the time.

FWIW, I wasn't submitting the patch for inclusion. It's only that a patch
was the easiest way to show the change. I guess I should have said so
specifically, since it's natural to assume that a patch posted to the list
is a proposal for a (permanent) change. Not my intent here.

hjh


[O] Worg: Links to parent nodes?

2013-05-02 Thread James Harkins
Apologies if this has been asked already. I just noticed that, e.g., the
ox-beamer.html page [1] has no links to its parent nodes. So for fun, I
hacked the url to go back up a couple of levels, and that page didn't have
any parent links either.

It would be very useful to have the standard breadcrumb trail at the top
and bottom of each page.

hjh


Re: [O] [PATCH v2] ox: Cache locations of fuzzy links

2013-05-02 Thread Nicolas Goaziou
Hello,

Lawrence Mitchell we...@gmx.li writes:

 * ox.el (org-export-resolve-fuzzy-link): Look for fuzzy link in a
   cache before trying to resolve it in the parse tree.

 When a document contains a large number of identical fuzzy links, it
 doesn't make sense to continually search for them.  Instead, cache the
 locations in the position independent case.
 ---
  lisp/ox.el | 42 +-
  1 file changed, 29 insertions(+), 13 deletions(-)

 Changes since v1:

 - Pull initialisation of link-cache into let
 - Don't use cons cells for keys, just use the path
   - lift found check to top-level let since it's now common

Thanks for the changes. 

 I've made this change.  Barring the eq test.

 Remember, paths are strings and two strings are only eq or eql if
 they are actually the same string (in memory).  In particular:

 (let ((p foo)) (eq (substring p 1) (substring p 1))) = nil
 (let ((p foo)) (eql (substring p 1) (substring p 1))) = nil
 (let ((p foo)) (equal (substring p 1) (substring p 1))) = t

 Hence, we must use equal or string-equal as a test in the hash
 table.  But string-equal isn't a predefined test, hence equal.

Sorry for being dense, but why do you use _path_, which is a string and,
as you say, requires `equal' for equality, instead of the first argument
of the function, i.e. _link_, which only needs `eq'?


Regards,

-- 
Nicolas Goaziou



Re: [O] section subtitle in latex export

2013-05-02 Thread Nicolas Goaziou
Masataro Asai guicho2.71...@gmail.com writes:

 org latex classes can be considererd as a template. template is somewhat
 similer to lambda. you wouldnt want any function to be modified by another
 function which recieved it as its argument.

Of course, `org-latex-classes' is a template. But it doesn't apply on
table of contents. However, Org needs some ways to control them.
Therefore it needs to handle optional arguments in \section macros and
alike.

 so if something may be inserted in the template without notice, instead it
 should be better if it has more arguments. say additional %s. if only there
 is two of them in the template you can add alternative title,

There are already other ways to control the alternative title. See
below.

 this may be an option. amother option is, giving altered version
 explicitly. 

There is the ALT_TITLE property, which allows to set an alternate title
for a given headline.

[...]

 the reason of cancelling the alt title, the situation im in is written in
 the
 first message. one journal template throws an error because it does not
 recognize altered titles.
 maybe i can write a script which regex all alt titles out, 

You can indeed write a filter for headlines which would remove every
optional title (see `org-export-filter-headline-functions'). Though,
Aaron Ecay's patch should solve most of the cases: no alternate title
will be added if you don't use ALT_TITLE or tags:not-in-toc option.

 but i wanted to contribute to the development of org.

You're welcome. But for the problem at hand, your patch isn't, IMO, an
acceptable solution.


Regards,

-- 
Nicolas Goaziou



Re: [O] Is it possible to create links to M-x occur results?

2013-05-02 Thread Rick Frankel

On 01.05.2013 18:41, Leo Alekseyev wrote:

Howdy Org-folks,

Something that I've found myself wishing for time and time again is 
to
be able to follow the link to a file and immediately pop into a set 
of

M-x occur results given some search term for that file.  That way I
could link to an overview of a file's class/function definitions, or
config stanzas, or other useful things.  Given that we can create
links to arbitrary elisp, I am sure that this can be done in
principle, but if there's a quick recipe that someone has come up
with, I'd love to hear about it!


That seems like a fun exercise. so:

#+BEGIN_SRC elisp
  (defun org-occur-open (uri)
Visit the file specified by URI, and run `occur' on the fragment
  \(anything after '#') in the uri.
(let ((list (split-string uri #)))
   (org-open-file (car list) t)
   (occur (mapconcat 'identity (cdr list) #
  (org-add-link-type occur 'org-occur-open)
#+END_SRC

and you can use a link like:

occur:m/file.txt#regex

rick



Re: [O] Bug in structmode++?

2013-05-02 Thread Nicolas Goaziou
Igor Sosa Mayor joseleopoldo1...@gmail.com writes:

 Thanks Nicolas. At least, I dont feel alone anymore... Is there any
 chance this getting fixed somehow? I used to use it very often in my
 emails and I miss it.

I miss it, too.

I didn't follow recent changes to orgstruct-mode, so I cannot help here.
I hope that someone more knowledgeable than I am will jump in.


Regards,

-- 
Nicolas Goaziou



[O] Patch for asynchronous export of ocaml code

2013-05-02 Thread Alan Schmitt
Hello,

It is not currently possible to asynchronously export the results of the
evaluation an ocaml babel block because the evaluation needs to start a toplevel
and thus asks the user what program to run. This of course blocks the
asynchronous export.

The attached patch adds a custom variable to specify the name of the command
to run, and directly calls the tuareg function that starts the toplevel given
the command.

For some context, here is the code that starts the caml session.

#+BEGIN_SRC emacs-lisp
(defvar tuareg-interactive-buffer-name)
(defun org-babel-prep-session:ocaml (session params)
  Prepare SESSION according to the header arguments in PARAMS.
  (require 'tuareg)
  (let ((tuareg-interactive-buffer-name (if (and (not (string= session none))
 (not (string= session 
default))
 (stringp session))
session
  tuareg-interactive-buffer-name)))
(save-window-excursion
  (if (fboundp 'tuareg-run-caml) (tuareg-run-caml) (tuareg-run-ocaml))
  (get-buffer tuareg-interactive-buffer-name
#+END_SRC

And this is the code from tuareg that is run.

#+BEGIN_SRC emacs-lisp
;;;###autoload
(defun tuareg-run-ocaml ()
  Run an OCaml toplevel process. I/O via buffer `*ocaml-toplevel*'.
  (interactive)
  (tuareg-run-process-if-needed)
  (display-buffer tuareg-interactive-buffer-name))

(defun tuareg-run-process-if-needed (optional cmd)
  Run an OCaml toplevel process if needed, with an optional command name.
I/O via buffer `*ocaml-toplevel*'.
  (if cmd
  (setq tuareg-interactive-program cmd)
(unless (comint-check-proc tuareg-interactive-buffer-name)
  (setq tuareg-interactive-program
(read-shell-command OCaml toplevel to run: 
tuareg-interactive-program
  (unless (comint-check-proc tuareg-interactive-buffer-name)
(let ((cmdlist (tuareg-args-to-list tuareg-interactive-program))
  (process-connection-type nil))
  (set-buffer (apply (function make-comint) ocaml-toplevel
 (car cmdlist) nil (cdr cmdlist)))
  (tuareg-interactive-mode)
  (sleep-for 1
#+END_SRC

With this patch (and setting `org-confirm-babel-evaluate' to nil), I'm able to
export documents requiring the evaluation of caml code asynchronously.

Alan

From 065cba70ae83b9483636b399604a64c0530eb463 Mon Sep 17 00:00:00 2001
From: Alan Schmitt alan.schm...@polytechnique.org
Date: Thu, 2 May 2013 16:57:29 +0200
Subject: [PATCH] Babel ocaml: allow ocaml code to run during asynchronous
 export

* lisp/ob-ocaml.el: Add a custom variable `org-babel-ocaml-command' to specify
the name of the toplevel to run.
(org-babel-prep-session:ocaml): Directly call `tuareg-run-process-if-needed'
with `org-babel-ocaml-command' as argument.
---
 lisp/ob-ocaml.el | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/lisp/ob-ocaml.el b/lisp/ob-ocaml.el
index 03500bb..1a194d8 100644
--- a/lisp/ob-ocaml.el
+++ b/lisp/ob-ocaml.el
@@ -51,6 +51,13 @@
 (defvar org-babel-ocaml-eoe-indicator \org-babel-ocaml-eoe\;;)
 (defvar org-babel-ocaml-eoe-output org-babel-ocaml-eoe)
 
+(defcustom org-babel-ocaml-command ocaml
+  Name of the command for executing Ocaml code.
+  :version 24.4
+  :package-version '(Org . 8.0)
+  :group 'org-babel
+  :type 'string)
+
 (defun org-babel-execute:ocaml (body params)
   Execute a block of Ocaml code with Babel.
   (let* ((vars (mapcar #'cdr (org-babel-get-header params :var)))
@@ -96,9 +103,10 @@
  (stringp session))
 session
   tuareg-interactive-buffer-name)))
-(save-window-excursion
-  (if (fboundp 'tuareg-run-caml) (tuareg-run-caml) (tuareg-run-ocaml))
-  (get-buffer tuareg-interactive-buffer-name
+(if (fboundp 'tuareg-run-process-if-needed)
+(tuareg-run-process-if-needed org-babel-ocaml-command)
+  (tuareg-run-caml))
+(get-buffer tuareg-interactive-buffer-name)))
 
 (defun org-babel-variable-assignments:ocaml (params)
   Return list of ocaml statements assigning the block's variables.
-- 
1.8.2.1



Re: [O] Is it possible to create links to M-x occur results?

2013-05-02 Thread Leo Alekseyev
Nice!  Short and sweet, and works great.  It should go on
orgmode.orgsomewhere in the cool hacks section.


On Thu, May 2, 2013 at 7:07 AM, Rick Frankel r...@rickster.com wrote:

 On 01.05.2013 18:41, Leo Alekseyev wrote:

 Howdy Org-folks,

 Something that I've found myself wishing for time and time again is to
 be able to follow the link to a file and immediately pop into a set of
 M-x occur results given some search term for that file.  That way I
 could link to an overview of a file's class/function definitions, or
 config stanzas, or other useful things.  Given that we can create
 links to arbitrary elisp, I am sure that this can be done in
 principle, but if there's a quick recipe that someone has come up
 with, I'd love to hear about it!


 That seems like a fun exercise. so:

 #+BEGIN_SRC elisp
   (defun org-occur-open (uri)
 Visit the file specified by URI, and run `occur' on the fragment
   \(anything after '#') in the uri.
 (let ((list (split-string uri #)))
(org-open-file (car list) t)
(occur (mapconcat 'identity (cdr list) #
   (org-add-link-type occur 'org-occur-open)
 #+END_SRC

 and you can use a link like:

 occur:m/file.txt#regex

 rick



[O] How to ensure code blocks are run during export?

2013-05-02 Thread Alan Schmitt
Hello,

I'm writing an exam in org mode, and it's going really well. I need to
have some code in code blocks being run during export (as it's defining
some functions for later questions), but I don't want anything to be
displayed in the final document. At the moment I use the following
options in the block:

:results silent :exports results

Is it the correct way to do it?

Thanks,

Alan



Re: [O] M-RET inside the first second-level heading of the first first-level heading

2013-05-02 Thread John Hendy
On Fri, Apr 26, 2013 at 1:54 AM, Bastien b...@gnu.org wrote:
 Hi Jisang,

 Jisang Yoo jisang.yoo.ac+...@gmail.com writes:

 2. Place cursor at the beginning of ** bacon and press M-RET and org 
 creates
 a first-level heading.

 This should now be fixed.  Thanks for reporting this,

There were some same/similar/related issues as well, and I'm still not
getting perfect results.

Using a minimal config (below), if I create this in a new file

* test
** test1
** test2

and then fold on * test, I get this:

* test...2

Also, after navigating to the end of * test...2 (with it folded) and
issuing M-RET, I get a new second level heading after ** test2. I
would have expected a new first level headline since I did M-RET on a
first level headline. Or is that the default behavior?

If so, I guess my only concern is the folding of the end of a headline
if there's no hard return after it into the ellipsis of it's parent.


Thanks!
John


 --
  Bastien




Re: [O] M-RET inside the first second-level heading of the first first-level heading

2013-05-02 Thread John Hendy
On Thu, May 2, 2013 at 1:51 PM, John Hendy jw.he...@gmail.com wrote:
 On Fri, Apr 26, 2013 at 1:54 AM, Bastien b...@gnu.org wrote:
 Hi Jisang,

 Jisang Yoo jisang.yoo.ac+...@gmail.com writes:

 2. Place cursor at the beginning of ** bacon and press M-RET and org 
 creates
 a first-level heading.

 This should now be fixed.  Thanks for reporting this,

 There were some same/similar/related issues as well, and I'm still not
 getting perfect results.

 Using a minimal config (below), if I create this in a new file

Sorry... config used with emacs -Q is this:

;; set load paths
;; set load dirs and global config options
(add-to-list 'load-path ~/.elisp/org.git/lisp/)
(add-to-list 'load-path ~/.elisp/org.git/contrib/lisp)

[deleted]

John



Re: [O] [new exporter] how can I export drawers?

2013-05-02 Thread Eric S Fraga
Carsten Dominik carsten.domi...@gmail.com writes:

[...]

 Hi Eric,

 I can see that this must be painful, so you are one of the
 people who suffer from this more that others.  On the other
 hand, this also makes you an asset for Org-mode, because
 you keep testing the exporter in many different ways.

 I hope that you can stay patient and keep reporting problems
 - by the end of this you will have your complete environment
 working and the exporter will have gotten better.

Hi Carsten,

Sorry!  I did not mean to come across as complaining at all.  I have
been stressed every so often lately because of the move to the new
exporter but *nobody* forced me to move over when I did.  I am obviously
a masochist at heart ;-)  I track the git version to make life
interesting...

To be clear: yes, the move to the new exporter has caused me a few
problems but none of the problems has been to the point that I have
regretted basing so much of my work on org.  Org has transformed, in a
very positive way, quite a few aspects of both my work and personal
lives and I owe much to you and everybody else that has contributed to
org.

If I can contribute by testing at the bleeding edge, I am happy that at
least I am making some contribution.  I wish I had the time and
expertise (in Emacs Lisp) to contribute more.

Thanks again,
eric

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org release_8.0.2-60-g713208




Re: [O] [Taskjuggler] Status of exporter

2013-05-02 Thread Eric S Fraga
Christian,

I must be doing something really silly (not unheard of ;-) but I just
cannot get the new tj3 exporter to work.  With an up to date org (as of
a few minutes ago), using the example from the tutorial but also an
example from Baptiste from last week, I get the following error message
when I try to export and open:

,
| Saving file /tmp/x.tjp...
| Wrote /tmp/x.tjp
| Processing TaskJuggler file ./x.tjp...
| /tmp/x.tjp:26: Error: Unexpected token '==' found. Expecting one of 
:HTMLBLOB, :WORD, :REF, :HREF, :INLINEFUNCSTART, :ITALIC, :BOLD, :CODE, 
:BOLDITALIC, :FCOLSTART
| ==  ==
| if: TaskJuggler failed with errors: Error: Unexpected token '==' found. 
Expecting one of :HTMLBLOB, :WORD, :REF, :HREF, :INLINEFUNCSTART, :ITALIC, 
:BOLD, :CODE, :BOLDITALIC, :FCOLSTART
`

I have TJ 3.4.0 and Ruby 1.9.1 installed on an Ubuntu system.

I have attached the x.org and x.tjp files in case they prove useful.

Any pointers would be most welcome.  I find that I need to create a
GANTT chart and, although I could use code I posted here a long time ago
for creating charts from org tables, I thought I'd revisit TJ...  the
aim would be to actually use TJ eventually for some of the project
management, from org obviously.

Thanks,
eric

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org release_8.0.2-60-g713208
#+BEGIN_EXAMPLE
* Project   :taskjuggler_project:

** Training material
   :PROPERTIES:
   :task_id:  training_material
   :END:
*** Markup Guidelines
:PROPERTIES:
:Effort:   2d
:task_id:  markup
:END:
*** Workflow Guidelines
:PROPERTIES:
:Effort:   2d
:END:
** Presentation
   :PROPERTIES:
   :Effort:   2d
   :BLOCKER:   markup
   :END:
#+END_EXAMPLE


x.tjp
Description: Binary data


[O] spreadsheet hline-relative (I) field references

2013-05-02 Thread Greg Minshall
hi.  i've two suggestions/requests/queries about using hline-relative
references, e.g., @III, in formulas in org-mode spreadsheets.

1.  i would like to use this syntax on the *left* hand side of a
formula.  e.g.,

#+TBLFM: @I$2=vsum(@-I$1..@+I$1)

(meaning, the second column in the first row after the first hline gets
the sum of all the first columns in the rows between the first and
second hlines).

2.  i have occasions where i would like to address hlines from the
bottom, rather than from the top.  is there a syntax for this?  if not,
maybe something like @Z (and all its friends, including @ZZZ, etc.)?

comments?

cheers, Greg



Re: [O] [html] centering

2013-05-02 Thread Eric Abrahamsen
Samuel Wales samolog...@gmail.com writes:

 Has there been a recent change in HTML centering?  We get this now:

   div class=center

 This does not work in browsers that do not support CSS.

 Thanks.

 Samuel

Looks like Bastien put that in in baa2999, around March 12. That commit
moved the remaining inline style declarations into CSS, presumably as
that's considered best practice. I can't speak for what we *should* be
supporting, though...

E




Re: [O] [PATCH] export to various flavors of (X)HTML

2013-05-02 Thread Eric Abrahamsen
Rick Frankel r...@rickster.com writes:

 On Tue, Apr 30, 2013 at 08:26:52PM -0700, Eric Abrahamsen wrote:
 Rick Frankel r...@rickster.com writes:
 
  Whoops. Wrong key. Patch actually attached to this email...
  rick
 
 Great, I'll consolidate all these -- would it be better to mush them
 into one big patch, or to keep them separate (I suppose for ease of
 rollback, if something goes wrong)?

 Probably squashing them into one patch would be the best. But Carsten
 or Bastien might disagree :).

 rick

Okay, there it is: one big patch (including your xml declaration fix).

I didn't add any more refined handling of the html5-fancy option. As a
second-order option it didn't seem worthy of an #+OPTIONS entry, and I
didn't bother checking for an empty string, either. It can always be
#+BINDed if necessary, and if it ever annoys anyone I can fix it
further.

E

From 9224f289801c7f1193718fe7f2ca351e26d7534b Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen e...@ericabrahamsen.net
Date: Thu, 2 May 2013 13:40:58 -0700
Subject: [PATCH] ox-html.el  Export to different (X)HTML flavors, including
 HTML5

* lisp/ox-html.el
(org-html-doctype-alist): New variable holding an alist of (X)HTML
			 doctypes
(org-html-xhtml-p): New function
(org-html-html5-p): New function
(org-html-close-tag): New function
(org-html-html5-fancy): New export option, determining whether or not to
use HTML5-specific elements.
(org-html-html5-elements): New variable, new HTML5 elements.
(org-html-special-block): Export special blocks to new HTML5 elements.
(org-html-format-inline-image): Use figure and figcaption for
	 	standalone images.
Significant changes to `org-html-format-inline-image',
`org-html--build-meta-info', `org-html--build-head',
`org-html--build-pre/postable', `org-html-template',
`org-html-horizontal-rule', `org-html-format-list-item',
`org-html-line-break', `org-html-table', and `org-html-verse-block'.

doc/org.texi: Document the above
---
 doc/org.texi|  97 +-
 lisp/ox-html.el | 251 
 2 files changed, 277 insertions(+), 71 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index 7437451..c294ea6 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -596,6 +596,7 @@ Exporting
 HTML export
 
 * HTML Export commands::How to invoke HTML export
+* HTML doctypes::   Org can export to various (X)HTML flavors
 * HTML preamble and postamble::  How to insert a preamble and a postamble
 * Quoting HTML tags::   Using direct HTML in Org mode
 * Links in HTML export::How links will be interpreted and formatted
@@ -10969,6 +10970,7 @@ language, but with additional support for tables.
 
 @menu
 * HTML Export commands::How to invoke HTML export
+* HTML doctypes::   Org can export to various (X)HTML flavors
 * HTML preamble and postamble::  How to insert a preamble and a postamble
 * Quoting HTML tags::   Using direct HTML in Org mode
 * Links in HTML export::How links will be interpreted and formatted
@@ -10980,7 +10982,7 @@ language, but with additional support for tables.
 * JavaScript support::  Info and Folding in a web browser
 @end menu
 
-@node HTML Export commands, HTML preamble and postamble, HTML export, HTML export
+@node HTML Export commands, HTML doctypes, HTML export, HTML export
 @subsection HTML export commands
 
 @table @kbd
@@ -11008,7 +11010,98 @@ Export to a temporary buffer.  Do not create a file.
 @c @noindent
 @c creates two levels of headings and does the rest as items.
 
-@node HTML preamble and postamble, Quoting HTML tags, HTML Export commands, HTML export
+@node HTML doctypes, HTML preamble and postamble, HTML Export commands, HTML export
+@subsection HTML doctypes
+@vindex org-html-doctype
+@vindex org-html-doctype-alist
+
+Org can export to various (X)HTML flavors.
+
+Setting the variable @code{org-html-doctype} allows you to export to different
+(X)HTML variants.  The exported HTML will be adjusted according to the sytax
+requirements of that variant.  You can either set this variable to a doctype
+string directly, in which case the exporter will try to adjust the syntax
+automatically, or you can use a ready-made doctype.  The ready-made options
+are:
+
+@itemize
+@item
+``html4-strict''
+@item
+``html4-transitional''
+@item
+``html4-frameset''
+@item
+``xhtml-strict''
+@item
+``xhtml-transitional''
+@item
+``xhtml-frameset''
+@item
+``xhtml-11''
+@item
+``html5''
+@item
+``xhtml5''
+@end itemize
+
+See the variable @code{org-html-doctype-alist} for details.  The default is
+``xhtml-strict''.
+
+@subsubheading Fancy HTML5 export
+@vindex org-html-html5-fancy
+@vindex org-html-html5-elements
+
+HTML5 introduces several new element types.  By default, Org will not make
+use of these element types, but you can set @code{org-html-html5-fancy} to
+@code{t} (or use the corresponding @code{HTML_HTML5_FANCY} export option), 

[O] [PATCH] Smart inference of task progress when exporting to TJ3

2013-05-02 Thread Martin
* contrib/lisp/ox-taskjuggler.el: Extend variable `complete' to respect clock 
times if no other information is given.

There are three possibilities for setting a task's progress when exporting to 
TJ3:
 1) If TODO state equals done = 100%
 2) If property complete is explicitly given = use that.
 3) Otherwise get the clocksum of the task and set the progress by comparing to 
`effort'.

TINYCHANGE
---
 contrib/lisp/ox-taskjuggler.el |   31 +++
 1 file changed, 27 insertions(+), 4 deletions(-)

diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index 3458e06..a97c075 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -780,6 +780,16 @@ channel.
;; Closing report.
}\n))
 
+
+(defun org-taskjuggler--clocksum-task (task)
+Return the clocksum of a parsed subtree = does not verify whether the parsed 
duration matches the start and end times
+(let* ((tsum 0))
+  (org-element-map (org-element-contents task) 'clock
+(lambda (hl) (setq tsum (+ tsum (org-duration-string-to-minutes 
(org-element-property :duration hl)
+)
+  tsum
+))
+
 (defun org-taskjuggler--build-task (task info)
   Return a task declaration.
 
@@ -791,11 +801,24 @@ a property \task_id\ it will be used as the id for this 
task.
 Otherwise it will use the ID property.  If neither is defined
 a unique id will be associated to it.
   (let* ((allocate (org-element-property :ALLOCATE task))
+ (effort (org-element-property :EFFORT task))
+ ;; smart completeness inference: 
+ ;;  - if state=done = 100%
+ ;;  - if explicit property for complete = take that value
+ ;;  - otherwise get clocksum of this task and relate to the effort, 
whilst limiting values to [0,99]
+ ;;  = 100% possible if and only if state=DONE. Overbooking does stop 
at 99%.
+ (complete-explicit (org-element-property :COMPLETE task))
  (complete
-  (if (eq (org-element-property :todo-type task) 'done) 100
-(org-element-property :COMPLETE task)))
+  ;; state=done = complete=100
+  (if (eq (org-element-property :todo-type task) 'done) 100.0
+;; else if explicit property = use that
+(if complete-explicit (string-to-number complete-explicit)
+  ;; else guess the completeness from clocksum  
+  (let* ((clocked (org-taskjuggler--clocksum-task task))
+ (complete-guess (and effort (/ (* 100 clocked) 
(org-duration-string-to-minutes effort)
+(and complete-guess (max (min 99 complete-guess) 0))) ;; check 
ranges and don't set complete=100 until state=DONE
+ )))
  (depends (org-taskjuggler-resolve-dependencies task info))
- (effort (org-element-property :EFFORT task))
  (milestone
   (or (org-element-property :MILESTONE task)
   (not (or (org-element-map (org-element-contents task) 'headline
@@ -826,7 +849,7 @@ a unique id will be associated to it.
   (if (= org-taskjuggler-target-version 3.0) allocate
 allocations)
   allocate))
- (and complete (format   complete %s\n complete))
+ (and complete (format   complete %.1f\n complete))
  (and effort
   (format   effort %s\n
   (let* ((minutes (org-duration-string-to-minutes effort))
-- 
1.7.9.5



Re: [O] [Taskjuggler] Status of exporter

2013-05-02 Thread John Hendy
On Thu, May 2, 2013 at 3:18 PM, Eric S Fraga e.fr...@ucl.ac.uk wrote:
 Christian,

 I must be doing something really silly (not unheard of ;-) but I just
 cannot get the new tj3 exporter to work.  With an up to date org (as of
 a few minutes ago), using the example from the tutorial but also an
 example from Baptiste from last week, I get the following error message
 when I try to export and open:

 ,
 | Saving file /tmp/x.tjp...
 | Wrote /tmp/x.tjp
 | Processing TaskJuggler file ./x.tjp...
 | /tmp/x.tjp:26: Error: Unexpected token '==' found. Expecting one of 
 :HTMLBLOB, :WORD, :REF, :HREF, :INLINEFUNCSTART, :ITALIC, :BOLD, :CODE, 
 :BOLDITALIC, :FCOLSTART
 | ==  ==
 | if: TaskJuggler failed with errors: Error: Unexpected token '==' found. 
 Expecting one of :HTMLBLOB, :WORD, :REF, :HREF, :INLINEFUNCSTART, :ITALIC, 
 :BOLD, :CODE, :BOLDITALIC, :FCOLSTART
 `

 I have TJ 3.4.0 and Ruby 1.9.1 installed on an Ubuntu system.

 I have attached the x.org and x.tjp files in case they prove useful.


Yeah, something's goofy with your report syntax, but I've just kind of
used the TJ3 report from their tutorial and tweaked it. I attached my
default report file which just gives me a gantt chart. I don't really
use the resource allocation much since I'm on a team for which I'm not
the manager of people's time and don't really have an idea of what %
of their overall load is dedicated to the project we work on together.
I'm interested in those assigned to a task and durations/estimates...
but not really what their overall load is.

Anyway, the .tji attached has a lot of stuff commented out that was in
the actual tj3 tutorial file. I left it for you so you can see some of
the other functionality they use, but I've turned it off as I'm just
not there yet and don't have time to learn more at the moment.


Hope that helps!
John

 Any pointers would be most welcome.  I find that I need to create a
 GANTT chart and, although I could use code I posted here a long time ago
 for creating charts from org tables, I thought I'd revisit TJ...  the
 aim would be to actually use TJ eventually for some of the project
 management, from org obviously.

 Thanks,
 eric

 --
 : Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
 : in Emacs 24.3.50.1 and Org release_8.0.2-60-g713208


reports.tji
Description: Binary data


[O] How to initiate source edits

2013-05-02 Thread Andreas Röhler

Hi,

have in some source file, let's assume Python, the following:


foo = {
bar: (
 baz,
 qux,
),
}

What is the best way to put this into an

#+BEGIN_SRC python

foo = {
bar: (
 baz,
 qux,
),
}

#+END_SRC

Thanks,

Andreas