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

2013-05-03 Thread Carsten Dominik

On 2.5.2013, at 19:25, Leo Alekseyev  wrote:

> Nice!  Short and sweet, and works great.  It should go on orgmode.org 
> somewhere in the cool hacks section.

Make a patch if you don't have write access to worg...

- Carsten

> 
> 
> On Thu, May 2, 2013 at 7:07 AM, Rick Frankel  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
> 



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

2013-05-03 Thread Carsten Dominik

On 2.5.2013, at 21:28, Eric S Fraga  wrote:

> Carsten Dominik  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.

You did not, I wanted to tell you that your input is appreciated.

Cheers

- Carsten

>  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] [PATCH] export to various flavors of (X)HTML

2013-05-03 Thread Carsten Dominik
Thanks, I will look at this patch next week.

- Carsten

On 2.5.2013, at 23:07, Eric Abrahamsen  wrote:

> Rick Frankel  writes:
> 
>> On Tue, Apr 30, 2013 at 08:26:52PM -0700, Eric Abrahamsen wrote:
>>> Rick Frankel  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
> 
> <0001-ox-html.el-Export-to-different-X-HTML-flavors-includ.patch>




Re: [O] [html] centering

2013-05-03 Thread Carsten Dominik

On 2.5.2013, at 03:22, Samuel Wales  wrote:

> Has there been a recent change in HTML centering?  We get this now:
> 
>  
> 
> This does not work in browsers that do not support CSS.

Specifically, which browsers are you talking about?

What do you mean by "not working"?  Just not centered,
or something worse?

Thanks

- Carsten

> 
> Thanks.
> 
> Samuel
> 
> -- 
> The Kafka Pandemic: http://thekafkapandemic.blogspot.com
> 
> The disease DOES progress.  MANY people have died from it.  ANYBODY can get 
> it.
> 




Re: [O] odd behavior for begin_src org :results

2013-05-03 Thread Sebastien Vauban
Hello Greg,

Greg Minshall wrote:
> It appears that only *string* values are allowed for any :var that are
> defined (i.e., ':var bar="foo"', and *not* ':var bar=3').

Confirmed. The following does not work.

#+begin_src org :results drawer replace :var you=2
Hello $you
#+end_src

> since i'm not 100% sure of the semantics, maybe this is desired.

I dunno either. Clearly, an error should not happen. OTOH, there is no concept
of Org variable, so every variable here comes down to be implemented as a
simple string replacement, hence the need for strings only, maybe.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] How to initiate source edits

2013-05-03 Thread Achim Gratz
Andreas Röhler  easy-emacs.de> writes:
> What is the best way to put this into an
> 
> #+BEGIN_SRC python
> 
> foo = {
>  "bar": (
>   "baz",
>   "qux",
>  ),
> }
> 
> #+END_SRC

< s TAB python C-c ' C-x i src.python C-c '


Regards,
Achim.





Re: [O] section subtitle in latex export

2013-05-03 Thread Aaron Ecay
Hello Nicolas,

2013ko maiatzak 2an, Nicolas Goaziou-ek idatzi zuen:

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

Done.  I then merged the patch into the master branch.

Thanks,

-- 
Aaron Ecay



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

2013-05-03 Thread Memnon Anon
Carsten Dominik  writes:

> On 2.5.2013, at 19:25, Leo Alekseyev  wrote:
>
> Nice! Short and sweet, and works great. It should go on
> orgmode.org somewhere in the cool hacks section.
> 
>
> Make a patch if you don't have write access to worg...

It is probably easier to fix it directly...

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

should get you started with that.

Go ahead, it is really not that difficult ;).

And if things get messed up, it is VC after all, so very easy to fix any
'mistake' that may have happened.

Memnon





Re: [O] How to initiate source edits

2013-05-03 Thread Andreas Röhler

Am 03.05.2013 10:07, schrieb Achim Gratz:

Andreas Röhler  easy-emacs.de> writes:

What is the best way to put this into an

#+BEGIN_SRC python

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

#+END_SRC


< s TAB python C-c ' C-x i src.python C-c '


Regards,
Achim.






Thanks a lot!



Re: [O] [Taskjuggler] Status of exporter

2013-05-03 Thread Eric S Fraga
John Hendy  writes:

[...]

> Yeah, something's goofy with your report syntax, but I've just kind of

Is there something I can do in org to fix the report syntax?  I would
have thought that the /out of the box/ ox-taskjuggler would export
something that works.  Or is it my TJ configuration somehow?

> 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

Thanks.  Works well and does what I need!

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




Re: [O] How to initiate source edits

2013-05-03 Thread Myles English

Hi Andreas,

Andreas Röhler writes:

> 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

A literal answer would be:

echo "#+BEGIN_SRC python\n" > newfile.org
cat somefile.py >> newfile.org
echo "\n#+END_SRC\n">> newfile.org

Myles



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

2013-05-03 Thread Daimrod
Martin  writes:

Hello Martin,

Thanks for your patch. I will only make a few stylistic remarks.

1. Could you add `contrib/lisp/ox-taskjuggler.el:' to the subject? (The
   first line of the commit message)
   
2. IIUC you don't need the TINYCHANGE cookie because the changes are
   made in contrib/ which doesn't require copyright assignment.
   Furthermore, I don't think your changes could be considered `tiny'
   (it changes more than 20 lines and doesn't look like a rewrite).

3. Could you reformat a bit your code so it fit in 80 column? (You can
   often use M-q for the comments)

-- 
Daimrod/Greg


pgp8MNzaVlSsW.pgp
Description: PGP signature


Re: [O] Exporting large documents

2013-05-03 Thread Carsten Dominik
Hi Lawrence,

thanks for doing this.  Stuff to think about - but no good
ideas for improvements here either - I am just not familiar enough
with the export engine.  Nicolas, it would be interesting to
hear from you if you have comments and ideas about quadratic
behavior of the exporter, and if you think these are
inevitable.

My guess is that quadratic behavior would mostly result
from searches of the data structure.  From the data you
show it seems that most of the damage is done during
export, not during parsing.

- Carsten

On 29.4.2013, at 18:04, Lawrence Mitchell  wrote:

> Carsten Dominik wrote:
>> Hi Achim,
> 
>> this is an interesting experiment, thank you!
> 
>> I think it would also be interesting to use elp to see which
>> function are taking up the non-linear time.
> 
> I did a bit of digging and here are the results.  No potential
> fixes though.
> 
> Taking the "Introduction" section of orgmanual.org and doubling
> it up so the buffer is 16x, 32x, 64x and 128x copies of the
> introduction and then running latex export having
> elp-instrumented the org package shows the following.
> 
> There are a few instances of quadratic behaviour that contribute
> to the slowdown.
> 
> Main culprit:
> 
> Name times-called cumulative-time time-per-call
> org-export-data 10132 29.364160173 0.0028981603
> org-export-data 20180 90.198301053 0.0044696878
> org-export-data 40276 316.37200089 0.0078550998
> org-export-data 80468 1155.4851323 0.0143595607
> 
> Less important but still a noticeable total runtime:
> 
> org-element-map 1133 2.6814707420 0.0023666996
> org-element-map 2285 10.799367732 0.0047262003
> org-element-map 4589 43.787327887 0.0095418016
> org-element-map 9197 173.27839595 0.0188407519
> 
> org-export-resolve-fuzzy-link 48 2.6659073480 0.0555397364
> org-export-resolve-fuzzy-link 96 10.766515020 0.1121511981
> org-export-resolve-fuzzy-link 192 43.725658059 0.2277378023
> org-export-resolve-fuzzy-link 384 173.15348462 0.4509205328
> 
> org-latex-link 144 2.6730487589 0.0185628386
> org-latex-link 288 10.783675007 0.0374433159
> org-latex-link 576 43.768676906 0.0759872862
> org-latex-link 1152 173.27176368 0.1504095170
> 
> 
> Unimportant but still quadratic:
> 
> org-export-get-headline-number 176 0.0036720380 2.086...e-05
> org-export-get-headline-number 352 0.0154215390 4.381...e-05
> org-export-get-headline-number 704 0.0636496679 9.041...e-05
> org-export-get-headline-number 1408 0.2382477599 0.0001692100
> 
> org-babel-get-inline-src-block-matches 112 0.0174396369 0.0001557110
> org-babel-get-inline-src-block-matches 224 0.0521645539 0.0002328774
> org-babel-get-inline-src-block-matches 448 0.182069907 0.0004064060
> org-babel-get-inline-src-block-matches 896 0.66889546 0.0007465351
> 
> org-babel-remove-result 112 0.0332858050 0.0002971946
> org-babel-remove-result 224 0.0837776260 0.0003740072
> org-babel-remove-result 448 0.2475016210 0.0005524589
> org-babel-remove-result 896 0.8013491290 0.0008943628
> 
> org-babel-where-is-src-block-result 112 0.0320815769 0.0002864426
> org-babel-where-is-src-block-result 224 0.081381881 0.0003633119
> org-babel-where-is-src-block-result 448 0.2425831529 0.0005414802
> org-babel-where-is-src-block-result 896 0.7915090309 0.0008833806
> 
> 
> 
> Cheers,
> 
> Lawrence
> 
> 




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

2013-05-03 Thread Sebastien Vauban
Alan,

Alan Schmitt wrote:
> 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?

It works, but a better way'd simply be ":exports none".

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] How to initiate source edits

2013-05-03 Thread Andreas Röhler

Am 03.05.2013 10:34, schrieb Myles English:


Hi Andreas,

Andreas Röhler writes:


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


A literal answer would be:

echo "#+BEGIN_SRC python\n" > newfile.org
cat somefile.py >> newfile.org
echo "\n#+END_SRC\n">> newfile.org

Myles



ahh, that's great too :)

BTW think it should exist a way to transform a region accordingly. Will open a 
separate thread maybe.

Andreas



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

2013-05-03 Thread Alan Schmitt
Sebastien Vauban writes:

> Alan,
>
> Alan Schmitt wrote:
>> 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?
>
> It works, but a better way'd simply be ":exports none".

I tried, and this does not run the code block (I see errors for later
code blocks that depend on it, and there is no mention of running that
code block in the log).

Alan



Re: [O] [Taskjuggler] Status of exporter

2013-05-03 Thread Christian Egli
Hi Eric

Eric S Fraga  writes:

> I must be doing something really silly (not unheard of ;-) but I just
> cannot get the new tj3 exporter to work.  

No, you found a bug in the exporter :-(.

> Any pointers would be most welcome.  

The problem is that I added a new feature which inserts the TITLE of the
document in the report. As it happens if you don't define a title it is
empty and the default report becomes invalid. So you could either

- define a document title (#+TITLE: Foo)
- define an export title (property 'EXPORT_TITLE')
- or git pull. I just pushed a fix that should use the headline of the
  project if the document title is empty.

Sorry for the inconvenience.

Christian

-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland

-
Die neue Online-Bibliothek der SBS: Mit wenigen Klicks zum Buch unter 
http://online.sbs.ch



[O] initiate source edits and region

2013-05-03 Thread Andreas Röhler

Hi all,

want to wrap org-mode src markup around code in existing region.

Having a look at the way "

Re: [O] initiate source edits and region

2013-05-03 Thread Sebastien Vauban
Andreas,

Andreas Röhler wrote:
> want to wrap org-mode src markup around code in existing region.
>
> Maybe someone already wrote such region-sensitive insert/init?

Yes, Eric: C-c C-v C-d

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Exporting large documents

2013-05-03 Thread Lawrence Mitchell
Carsten Dominik wrote:
> Hi Lawrence,

> thanks for doing this.  Stuff to think about - but no good
> ideas for improvements here either - I am just not familiar enough
> with the export engine.  Nicolas, it would be interesting to
> hear from you if you have comments and ideas about quadratic
> behavior of the exporter, and if you think these are
> inevitable.

> My guess is that quadratic behavior would mostly result
> from searches of the data structure.  From the data you
> show it seems that most of the damage is done during
> export, not during parsing.

Yes, I think that's right.  The parse tree is built in one pass I
think, but some of the export requires walking over this tree a
lot.  It's unclear to me if this is necessary or not, or if the
export could be built with a single linear pass over the parse
tree.

Lawrence




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

2013-05-03 Thread Sebastien Vauban
Alan,

Alan Schmitt wrote:
> Sebastien Vauban writes:
>> Alan Schmitt wrote:
>>> 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?
>>
>> It works, but a better way'd simply be ":exports none".
>
> I tried, and this does not run the code block (I see errors for later
> code blocks that depend on it, and there is no mention of running that
> code block in the log).

The following does work.

--8<---cut here---start->8---
#+name: do-this
#+begin_src org :results drawer replace :var you="44" :exports none
  Hello $you
#+end_src

#+begin_src org :results drawer replace :var data=do-this :exports results
  Value: $data
#+end_src
--8<---cut here---end--->8---

Maybe giving an ECM would help.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] initiate source edits and region

2013-05-03 Thread Andreas Röhler

Am 03.05.2013 13:11, schrieb Sebastien Vauban:

Andreas,

Andreas Röhler wrote:

want to wrap org-mode src markup around code in existing region.

Maybe someone already wrote such region-sensitive insert/init?


Yes, Eric: C-c C-v C-d

Best regards,
   Seb



That's it, thanks!



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

2013-05-03 Thread Martin Becker

Dear Daimrod,

Thank you for these remarks, next time I know.
I attached a "clean" patch.


On 03.05.2013 10:40, Daimrod wrote:

Martin  writes:

Hello Martin,

Thanks for your patch. I will only make a few stylistic remarks.

1. Could you add `contrib/lisp/ox-taskjuggler.el:' to the subject? (The
first line of the commit message)

2. IIUC you don't need the TINYCHANGE cookie because the changes are

made in contrib/ which doesn't require copyright assignment.
Furthermore, I don't think your changes could be considered `tiny'
(it changes more than 20 lines and doesn't look like a rewrite).

3. Could you reformat a bit your code so it fit in 80 column? (You can
often use M-q for the comments)



>From ec5076f93678a3ca5d0944cd777a0d87c74dfeee Mon Sep 17 00:00:00 2001
From: Martin Becker 
Date: Thu, 2 May 2013 23:08:40 +0200
Subject: [PATCH] contrib/lisp/ox-taskjuggler.el: Smart inference of task
 progress when exporting to TJ3

* 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'.
---
 contrib/lisp/ox-taskjuggler.el |   36 
 1 file changed, 32 insertions(+), 4 deletions(-)

diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index 3458e06..97c4aae 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -780,6 +780,17 @@ 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 +802,28 @@ 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)))
+	  )))
  (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 +854,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] Is it possible to create links to M-x occur results?

2013-05-03 Thread Nicolas Richard
Memnon Anon  writes:
> Carsten Dominik  writes:
>> On 2.5.2013, at 19:25, Leo Alekseyev  wrote:
>> Nice! Short and sweet, and works great. It should go on
>> orgmode.org somewhere in the cool hacks section.
>> Make a patch if you don't have write access to worg...
> Go ahead, it is really not that difficult ;).

Yeah, let's go ahead indeed.

>From db3313e2e88741a4084988bba656530d09ac7356 Mon Sep 17 00:00:00 2001
From: Nicolas Richard 
Date: Fri, 3 May 2013 14:04:01 +0200
Subject: [PATCH] org-hacks.org: Support for occur: links

---
 org-hacks.org | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/org-hacks.org b/org-hacks.org
index 290dcf1..56cd24b 100644
--- a/org-hacks.org
+++ b/org-hacks.org
@@ -1109,6 +1109,29 @@ accomplish this:
 
 Then just use `M-x my-org-insert-link' instead of `org-insert-link'.
 
+*** Insert a link that activates =M-x occur= in the target buffer
+Posted on the Org-mode mailing list by Rick Frankel
+(http://lists.gnu.org/archive/html/emacs-orgmode/2013-05/msg00072.html), this
+is support for =occur:= links to automagically open an *Occur* session.
+
+#+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
+
+Links are written like this :
+
+#+begin_src org
+  [[occur:m/file.txt#regex][text]]
+#+end_src
+
+
+
 ** Archiving Content in Org-Mode
 *** Preserve top level headings when archiving to a file
 #+index: Archiving!Preserve top level headings
-- 
1.8.1.5




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

2013-05-03 Thread Alan Schmitt
Sebastien Vauban writes:

> The following does work.

It does, I agree, but this does not. If you run export on this:

--8<---cut here---start->8---
# -*- org-confirm-babel-evaluate: nil -*-

Setting the stage

#+BEGIN_SRC ocaml :results silent :exports none
let f x = x;;
#+END_SRC

Using the function

#+BEGIN_SRC ocaml :results code verbatim :exports results
f 3;;
#+END_SRC
--8<---cut here---end--->8---

Then the `f 3' results in an error. Looking in the ocaml buffer that is
launched for evaluation, one sees:

,
| f 3;;
| "org-babel-ocaml-eoe";;
| Characters 0-1:
|   f 3;;
|   ^
| Error: Unbound value f
| # - : string = "org-babel-ocaml-eoe"
`

And the declaration of f was not run.

If you replace `none' by `results' for the `:exports' of the first
block, then everything works fine.

I don't think this is specific to ocaml, I guess it may happen with
every session-based evaluation.

Alan



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

2013-05-03 Thread Rick Frankel
On Fri, May 03, 2013 at 09:14:43AM +0200, Carsten Dominik wrote:
>On 2.5.2013, at 19:25, Leo Alekseyev  wrote:
> 
>  Nice!  Short and sweet, and works great.  It should go on orgmode.org
>  somewhere in the cool hacks section.
> 
>Make a patch if you don't have write access to worg...

I have added it to org-hacks.org between "Store link to a message when
sending in Gnus" and "Send html messages and attachments with
Wanderlust", but when i push to master, i get the following in the log
output from the git-hook and it' doesn't show up in the website:

   remote: Publishing file /home/emacs/git/worg/sitemap.org using 
`org-publish-org-to-html'
   remote: Symbol's function definition is void: org-publish-org-to-html

rick



[O] Export Org-mode content to Reveal.js presentations

2013-05-03 Thread Yujie Wen
Hi,

  I'd like to introduce a new Org-Mode exporter, Org-reveal, that exports
Org-mode contents to Reveaj.js presentations.

  Reveal.js is a web-based presentation framework, with beautiful 3-D
effects and 2-D slides arrangements. The original sample illustration can
be found at http://lab.hakim.se/reveal-js/#/.

  With Org-reveal, you can easily exports your Org documents to Reveal.js
presentations. A sample presentation created by Org-reveal can be found at
http://naga-eda.org/home/yujie/org-reveal/.

  Org-reveal is hosted on https://github.com/yjwen/org-reveal. Should you
have any suggestion or bug-report, please contact me yjwen.ty AT gmail DOT
com.

Thanks and regards,
Yujie


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

2013-05-03 Thread Sebastien Vauban
Alan,

Alan Schmitt wrote:
> Sebastien Vauban writes:
>
>> The following does work.
>
> It does, I agree, but this does not. If you run export on this:
>
> # -*- org-confirm-babel-evaluate: nil -*-
>
> Setting the stage
>
> #+BEGIN_SRC ocaml :results silent :exports none
> let f x = x;;
> #+END_SRC
>
> Using the function
>
> #+BEGIN_SRC ocaml :results code verbatim :exports results
> f 3;;
> #+END_SRC
>
> Then the `f 3' results in an error. Looking in the ocaml buffer that is
> launched for evaluation, one sees:
>
> ,
> | f 3;;
> | "org-babel-ocaml-eoe";;
> | Characters 0-1:
> |   f 3;;
> |   ^
> | Error: Unbound value f
> | # - : string = "org-babel-ocaml-eoe"
> `
>
> And the declaration of f was not run.
>
> If you replace `none' by `results' for the `:exports' of the first
> block, then everything works fine.
>
> I don't think this is specific to ocaml, I guess it may happen with
> every session-based evaluation.

I don't know OCaml at all, so I cannot try your example locally on my machine.

Though, you speak of "session": where is your session header argument?  Isn't
that the problem?

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Gentoo ebuild for app-emacs/org-mode-8.0.1

2013-05-03 Thread Christoph LANGE
Hi Achim,

about ORG_ADD_CONTRIB and other faults that you pointed out in my
ebuild: I'm sorry but I didn't manage to test this before going on
holiday.  Meanwhile I see there has been progress; see Ulrich Müller's
comment at  and my
reply.  I just wanted to let everyone know, but I am currently unable to
work on this.

Cheers,

Christoph

-- 
Christoph Lange, http://www.facebook.com/ch.lange, Skype duke4701



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

2013-05-03 Thread Alan Schmitt
Hi Sebastien,

Sebastien Vauban writes:

> I don't know OCaml at all, so I cannot try your example locally on my
> machine.

And I don't know about other languages that support sessions,
unfortunately.

> Though, you speak of "session": where is your session header argument?  Isn't
> that the problem?

There is a default session for Caml code, so one does not need this
argument.

Alan



Re: [O] initiate source edits and region

2013-05-03 Thread François Pinard
"Sebastien Vauban" writes:

> Yes, Eric: C-c C-v C-d

Wow, I did not know that command, which seems quite useful!  Thanks.

However, it inserts the markers in lower case.  In a previous mail list
discussion on this (delicate, almost heated) matter, Bastien finally
ruled out that the preference in Org documentation and behaviour should
use capitals.  As my preference then was then lower case, I edited all
my Org files to use capitals instead, as a way towards consistency with
Org.  The above command should also insert capitals, for Org being
consistent with itself :-)

François



Re: [O] initiate source edits and region

2013-05-03 Thread Sebastien Vauban
Hello François,

François Pinard wrote:
> "Sebastien Vauban" writes:
>
>> Yes, Eric: C-c C-v C-d
>
> Wow, I did not know that command, which seems quite useful!  Thanks.
>
> However, it inserts the markers in lower case.  In a previous mail list
> discussion on this (delicate, almost heated) matter, Bastien finally
> ruled out that the preference in Org documentation and behaviour should
> use capitals.  As my preference then was then lower case, I edited all
> my Org files to use capitals instead, as a way towards consistency with
> Org.  The above command should also insert capitals, for Org being
> consistent with itself :-)

So true this can become a very passionate debate.

Regarding the case, I followed Carsten telling he'd have used lower case from
the beginning if nice keyword highlighting had been available at that time.

That, plus personal taste, made me stick with lower case.

Unlike you, I just edited 2 lines, to keep all my files consistent:

--8<---cut here---start->8---
  ;; keep lower-case
  (setq org-babel-results-keyword "results")
--8<---cut here---end--->8---

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] initiate source edits and region

2013-05-03 Thread Carsten Dominik

On 3.5.2013, at 15:19, François Pinard  wrote:

> "Sebastien Vauban" writes:
> 
>> Yes, Eric: C-c C-v C-d
> 
> Wow, I did not know that command, which seems quite useful!  Thanks.

I did not know it either.  Great.

> 
> However, it inserts the markers in lower case.  In a previous mail list
> discussion on this (delicate, almost heated) matter, Bastien finally
> ruled out that the preference in Org documentation and behaviour should
> use capitals.

Could you please point me to that discussion?  Thanks.

- Carsten

>  As my preference then was then lower case, I edited all
> my Org files to use capitals instead, as a way towards consistency with
> Org.  The above command should also insert capitals, for Org being
> consistent with itself :-)

I think this would be one more useful option to add.

- Carsten


Re: [O] Export Org-mode content to Reveal.js presentations

2013-05-03 Thread Rasmus
Yujie Wen  writes:

> Hi,
>
>   I'd like to introduce a new Org-Mode exporter, Org-reveal, that exports
> Org-mode contents to Reveaj.js presentations.
>
>   Reveal.js is a web-based presentation framework, with beautiful 3-D
> effects and 2-D slides arrangements. The original sample illustration can
> be found at http://lab.hakim.se/reveal-js/#/.
>
>   With Org-reveal, you can easily exports your Org documents to Reveal.js
> presentations. A sample presentation created by Org-reveal can be found at
> http://naga-eda.org/home/yujie/org-reveal/.
>
>   Org-reveal is hosted on https://github.com/yjwen/org-reveal. Should you
> have any suggestion or bug-report, please contact me yjwen.ty AT gmail DOT
> com.

Both sets of slides look amazing!  Thanks for proving this exporter.

Will you distribute it via org-contrib or org eventually?

One (lazy) question: does it support MathJax as standard Org HTML?

Again, thanks!

–Rasmus

-- 
Enough with the bla bla!




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

2013-05-03 Thread Eric S Fraga
Carsten Dominik  writes:
> You did not, I wanted to tell you that your input is appreciated.

Thanks!

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




Re: [O] [Taskjuggler] Status of exporter

2013-05-03 Thread Eric S Fraga
Christian Egli  writes:

> Hi Eric
>
> Eric S Fraga  writes:
>
>> I must be doing something really silly (not unheard of ;-) but I just
>> cannot get the new tj3 exporter to work.  
>
> No, you found a bug in the exporter :-(.
>
>> Any pointers would be most welcome.  
>
> The problem is that I added a new feature which inserts the TITLE of the
> document in the report. As it happens if you don't define a title it is
> empty and the default report becomes invalid. So you could either
>
> - define a document title (#+TITLE: Foo)
> - define an export title (property 'EXPORT_TITLE')
> - or git pull. I just pushed a fix that should use the headline of the
>   project if the document title is empty.
>
> Sorry for the inconvenience.
>
> Christian

Thanks!  No worries.  This is all work in progress, of course.  I've
updated my org and the example works just fine.

I now have other problems, as I have started defining an actual project
as opposed to the examples I have found on the list and on Worg.  I get
errors, having allocated efforts to all my tasks, that tasks do
not fit into the project time frame.  How is this time frame defined?
Do I need to specify something else in the org file?  The project I am
defining is several years long with tasks typically a number of months
long each.  Is there some default?  

I have tried allocating resources as well but get the same problem
regardless.

Example output (wrapped):

,
| if: TaskJuggler failed with errors: Warning in scenario plan: Task
| workplan.framework.implementation.final does not fit into project time
| frame Warning: Task workplan.framework.implementation.final:
| 2014-02-06-17:00-+ ->  Error in scenario plan: Some tasks did not
| fit into the project time frame.
`

Maybe I need to relearn taskjuggler...  If that's the case, please don't
hesitate to tell me.  Taskjuggler specifics are OT.

Thanks again,
eric

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




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

2013-05-03 Thread Christian Egli
Hi Martin

Martin Becker  writes:

> Thank you for these remarks, next time I know.
> I attached a "clean" patch.

I like this patch, this is good stuff. Can you tell me how you use this?
I.e. does tj3 adapt the length fo a task based on your clock table?

A few remarks on the patch from my side:

+  ;; 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)))
+ )))

I would write this using cond instead of nested if. Makes it more clear.

>> 2. IIUC you don't need the TINYCHANGE cookie because the changes
>> are made in contrib/ which doesn't require copyright assignment.

The taskjuggler exporter used to be in core before it was moved to
contrib by Bastien or Nicolas on the bases that there aren't many users
(and probably because it wasn't maintained very well). This is OK for
now, but eventually I'd like to move it back to core. So we need
assignment for this patch.

Thanks
Christian
-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland




Re: [O] [Taskjuggler] Status of exporter

2013-05-03 Thread Christian Egli
Hi Eric

Eric S Fraga  writes:

> I get errors, having allocated efforts to all my tasks, that tasks do
> not fit into the project time frame. How is this time frame defined?

This is defined on the project. I think it is some kind of tj3
optimization to limit the space that it has to allocate.

> Do I need to specify something else in the org file? The project I am
> defining is several years long with tasks typically a number of months
> long each. Is there some default?

There is a default, see `org-taskjuggler-default-project-duration'. In
theory (according to the doc string of `org-taskjuggler--build-project')
you should also be able to set an "end" property on the project, but
this hasn't been implemented yet. You can set a deadline and this will
be used as an end date, but as I said before I might change this as a
DEADLINE maps more to maxend. So your best bet at the moment is to use
the default project duration.

Hope that helps
Christian
-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland




[O] org-babel-demarcate-block added to menu

2013-05-03 Thread Andreas Röhler

Cheers,

Andreas
commit 3684737f97fc78eeca8f6d284985e39a88a5393e
Author: Andreas Roehler 
Date:   Fri May 3 17:22:33 2013 +0200

menu provide `org-babel-demarcate-block'

org-mode menu should enable access to edit commands
This change opens a slot, so other commands may follow

TINYCHANGE

diff --git a/lisp/org.el b/lisp/org.el
index ae0110f..e759994 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20719,7 +20719,11 @@ See the individual commands for more information."
  ["Convert to odd/even levels" org-convert-to-oddeven-levels t])
 ("Editing"
  ["Emphasis..." org-emphasize t]
- ["Edit Source Example" org-edit-special t]
+ ("Edit Code Sources"
+  ["Wrap/split code in region or at point." org-babel-demarcate-block t]
+  ["Edit current chunk" org-edit-special t]
+  )
+
  "--"
  ["Footnote new/jump" org-footnote-action t]
  ["Footnote extra" (org-footnote-action t) :active t :keys "C-u C-c C-x f"])


Re: [O] [Taskjuggler] Status of exporter

2013-05-03 Thread Eric S Fraga
Christian,

ignore my previous email re: time span for the project.  Having looked
at your code, I see that you make use of the SCHEDULED and DEADLINE
properties of the top headline.  This is obvious (in hindsight).  So
this works.

I now have a further problem which I will email later when I am back
online.  I am currently on the train home without Internet access (which
means that this email may cross any from you or others).

Thanks again,
eric
-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org release_8.0.2-68-g40635b




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

2013-05-03 Thread Martin Becker

Hi Christian,


I like this patch, this is good  stuff. Can you tell me how you use

> this?
Thanks, I attached a file where I made some tests. My idea was, that 
clock times are only used when there is no explicit information given, 
viz., when there is neither a property `complete' nor the task state 
equals "done". Since I am clocking most of my activities, it would be 
convenient for me to let the exporter/TJ3 infer the task progress 
instead of explicitly giving the `complete' property. So far for the story.



 I.e. does tj3 adapt the length fo a task based on your clock

> table?
No, TJ3 is not adapting anything here, neither am I. Since you cannot 
give values > 100 (%), my patch limits the maximum inferred progress to 
99. We could let the exporter overwrite the effort with the clocksum in 
those cases, but it doesn't seem right.

I found out some more details after reading the documentation of TJ3:
- The `complete' property is merely for documentation purposes, it's 
totally ignored by TJ3 when it comes to scheduling. It just "looks 
nice". Being only "cosmetic", tracking can be done via clock times as 
proposed.
- But there is another thing we could do: One can add "bookings" to the 
tasks, which could be exactly the clock times from org-mode. I tried 
this manually and it seems to be a mixed blessing: If doing so, TJ3 
internally grows the effort when the bookings exceed them and 
reschedules accordingly (which is nice). On the other hand sensible 
clock times are vital then. What I mean is, when there are bookings that 
are too early w.r.t. a task's earliest possible start (due to 
dependencies etc.), then TJ3 exits with an error. I am not sure this is 
wanted behavior. What do you think? Additionally, the visually 
attractive completeness is not derived from the bookings or anything.



I would write this using cond  instead of nested if. Makes it more

> clear.
Oh yes, I will do that. I am fairly new to Lisp, it is a nice exercise.


2. IIUC you don't need  the TINYCHANGE cookie because the changes

>>> are made in contrib/ which doesn't require copyright assignment.
> The taskjuggler exporter used to be in core before it was moved to
> contrib by Bastien or Nicolas on the bases that there aren't many
> users (and probably because it wasn't maintained very well). This is
> OK for now, but eventually I'd like to move it back to core. So we
> need assignment for this patch.
Is it that I need to sign something? That is not a problem, I happily 
contribute here.


#+PROPERTY: Effort_ALL 2d 5d 10d 20d 30d 35d 50d
#+PROPERTY: allocate_ALL dev doc test
#+PROPERTY: ORDERED_ALL true false
#+COLUMNS: %70ITEM(Task) %3Effort %8allocate %BLOCKER %ORDERED

* Resources:taskjuggler_resource:
** Developers
:PROPERTIES:
:resource_id: dev
:END:
*** Paul Smith
:PROPERTIES:
:resource_id: paul
:END:
*** Sébastien Bono
:PROPERTIES:
:resource_id: seb
:END:
*** Klaus Müller
** Others
*** Peter Murphy
:PROPERTIES:
:resource_id: doc
:limits:   { dailymax 7h }
:END:
*** Dim Sung
:PROPERTIES:
:resource_id: test
:END:


* Accounting Software   :taskjuggler_project:
  SCHEDULED: <2013-04-15 Mo>
** STARTED Specification
   - State "STARTED"from "TODO"   [2013-05-02 Do 16:50]
   CLOCK: [2013-04-30 Do 16:50]--[2013-05-03 Do 16:50] => 72:00
   :PROPERTIES:
   :Effort:   20d
   :allocate: dev
   :task_id:  task_spec
   :END:
** Software Development
   :PROPERTIES:
   :allocate: dev   
   :ORDERED:  true
   :BLOCKER:  previous-sibling
   :task_id:  task_dev
   :END:
*** TODO Database coupling
CLOCK: [2013-05-03 Do 15:21]--[2013-05-11 Do 22:21] => 199:00
:PROPERTIES:
:Effort:   20d
:END:

*This task uses the smart progress inference*: This task's
completeness is guessed using the clocked times, since it has no
explicit `complete' property. However the clock durations add up
to more than the effort and TJ3 does only allow values
[0,100]. Therefore semantically the task is not regarded as
complete until the TODO state equals "done", no matter how much we
clock on it.  According to TJ3 doc, the complete information has
no impact on the TJ3 scheduler, it's pure documentation.

*Alternatives*: 
1) Instead of setting `complete', we could set the property
   `booking' for a resource or task, when we export to TJ3. Then
   TJ3 would have additional information, since the bookings
   reflect how much work was actually put into a task vs. how much
   we originally planned. Note that unlike `complete' this has an
   impact on the scheduling. TJ3 then can schedule a new plan
   based on the amount of work that actually happened.  Downside
   is, that the org-syntax does not capture who/which resource
   clocks on a task. And that the clock times will cause
   scheduling errors when they do not comply with the scheduled
   time windows for the tasks (e.g., when th

Re: [O] [Taskjuggler] Status of exporter

2013-05-03 Thread Eric S Fraga
Christian Egli  writes:

[...]

> There is a default, see `org-taskjuggler-default-project-duration'. In

Thanks.  I have used #+BIND to set this.  However, it would be nice if
this variable did not assume days but instead allowed a TJ specification
(e.g. 6m, 4y).  I had to calculate how long 4 years was in days...

Mind you, I find TJ a bit annoying in how it deals with durations other
than days.  I can specify that a task is 1m long but TJ converts this to
4 weeks which is not the same.  I have to start thinking in terms of
weeks, I guess.

> this hasn't been implemented yet. You can set a deadline and this will
> be used as an end date, but as I said before I might change this as a
> DEADLINE maps more to maxend. So your best bet at the moment is to use
> the default project duration.

Done!

On the way home, I had another problem to do with resource allocation
but I can no longer reproduce it.  So it looks like I am all set!

Thanks for this exporter.

eric

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




Re: [O] Export Org-mode content to Reveal.js presentations

2013-05-03 Thread Eric S Fraga
Yujie Wen  writes:

> Hi,
>
>   I'd like to introduce a new Org-Mode exporter, Org-reveal, that exports
> Org-mode contents to Reveaj.js presentations.

This looks really interesting.  So many choices, so little time... :(
I really like the ability to see the zoomed out view of the set of
slides as well as the L/R and U/D paradigm.  I can see using the latter
to have detail that may be missed in a short talk but included in a
longer version of the same talk.

Thanks,
eric

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




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

2013-05-03 Thread Christian Egli
Hi Martin

Martin Becker  writes:

> My idea was, that clock times are only used when there is no explicit
> information given, viz., when there is neither a property `complete'
> nor the task state equals "done". Since I am clocking most of my
> activities, it would be convenient for me to let the exporter/TJ3
> infer the task progress instead of explicitly giving the `complete'
> property. So far for the story.

Ah, I get it. You are infering the % complete based on how much effort
you have already put into a task. The problem is that this doesn't
always relate to each other: You might have put a lot of effort into a
task and still be only at 10% complete.

>> I.e. does tj3 adapt the length fo a task based on your clock
>> table?
> No, TJ3 is not adapting anything here, neither am I. Since you cannot
> give values > 100 (%), my patch limits the maximum inferred progress
> to 99. We could let the exporter overwrite the effort with the
> clocksum in those cases, but it doesn't seem right.

Yes, since this is another problem with infering the complete
information from the planed effort and actual effort: You can end up
with complete more than 100% :-), namely if the actual effort is bigger
than the planed effort.
  
> I found out some more details after reading the documentation of TJ3: 
> - The `complete' property is merely for documentation purposes, it's
> totally ignored by TJ3 when it comes to scheduling. It just "looks
> nice". 

Yes, I think there are some other draw backs with the complete
information. Check the taskjuggler mailing list archives for a
discussion on tracking the progress of a project
(https://groups.google.com/d/topic/taskjuggler-users/ZCk_est4GKE/discussion).
I for one would like it if were used for scheduling. 

> - But there is another thing we could do: One can add "bookings" to
> the tasks, which could be exactly the clock times from org-mode. I
> tried this manually and it seems to be a mixed blessing: If doing so,
> TJ3 internally grows the effort when the bookings exceed them and
> reschedules accordingly (which is nice). 

This is something that would make sense in the exporter. The clocking
information that we have in the org file is really what tj3 wants as a
booking.

> On the other hand sensible clock times are vital then. What I mean is,
> when there are bookings that are too early w.r.t. a task's earliest
> possible start (due to dependencies etc.), then TJ3 exits with an
> error. I am not sure this is wanted behavior. What do you think?

Yes, it appears that you will have to have bookings for all the tasks to
make this work properly. This is a lot of overhead. I'm also not sure
this is wanted. But the benefit would be that you can use projection
mode in which tj3 will afaik recalculate the duration of the project
based an planed and actual effort. Might be worth exploring.

> Additionally, the visually attractive completeness is not derived from
> the bookings or anything.

Yes.

>> but eventually I'd like to move it back to core. So we need
>> assignment for this patch.
> Is it that I need to sign something?

Have a look at request-assign-future.txt in the org-mode git repo.

Thanks
Christian

-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland




Re: [O] [Taskjuggler] Status of exporter

2013-05-03 Thread Christian Egli
Christian Egli  writes:

> In theory (according to the doc string of
> `org-taskjuggler--build-project') you should also be able to set an
> "end" property on the project, but this hasn't been implemented yet.

I remember now what the problem with this was. The exporter uses the top
task both as the task and the container for the project[1]. So an start
and an end on this task applies to both the project and the task (which
is not always what you want). You might want to assign a start to the
top task but probably not an end. The end is supposed to be calculated
based on efforts and resource availability. But unless you specify a
default duration you will have to specify and end date for the
_project_.

Maybe we need some fake (in the sense that they are not tj3 attributes)
attributes to specify start and end of a project.

Thanks
Christian

Footnotes: 
[1]  Unless you set `org-taskjuggler-keep-project-as-task' to nil

-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland




Re: [O] [PATCH] Re: Can't export LaTeX source code blocks

2013-05-03 Thread Sebastien Vauban
Hi Eric,

Could you look at this patch, fixing the priority hierarchy of Babel header
arguments, and apply it, if judged OK?

Best regards,
  Seb

"Sebastien Vauban" wrote:
> "Sebastien Vauban" wrote:
>> Thomas S. Dye wrote:
>>> "Sebastien Vauban" writes:
>>>
>> The code block is NEVER exported. I don't understand why?
>
> I'm not sure either.
>>>
>>> I took a quick look at ob-latex.el. The code there sets `:exports
>>> results' and then, IIUC, goes on its way without checking if :exports
>>> has been set in the buffer.
>>>
>>> It looks to me like ob-latex.el would need to be revised.
>>
>> I don't have the impression that the error lies in `ob-latex' as the other
>> `ob-LANG' files don't either make any special check -- while all 
>> graphics-only
>> languages do, as well, have the default of "results" for ":exports".
>>
>> I have the impression the problem is to search in `ob-core'
>> (`org-babel-execute-src-block') or `ob-exp'... But that's not yet clear to me
>> where that could be.
>
> I think I found it. That was a priority order problem for implementing the
> hierarchy of header arguments inheritage in `ob-core'.
>
> Best regards,
>   Seb
>
> From 3339c0f7d296fc68a206b0f69270da3a91025840 Mon Sep 17 00:00:00 2001
> From: Sebastien Vauban 
> Date: Sat, 27 Apr 2013 11:40:25 +0200
> Subject: [PATCH 2/2] Fix priority order for inheriting header arguments
>
> * ob-core.el (org-babel-parse-src-block-match): Fix order of list of header
> arguments.
>
> ---
>  lisp/ob-core.el |4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lisp/ob-core.el b/lisp/ob-core.el
> index 9baff0c..73dca8f 100644
> --- a/lisp/ob-core.el
> +++ b/lisp/ob-core.el
> @@ -1,6 +1,6 @@
>  ;;; ob-core.el --- working with code blocks in org-mode
>  
> -;; Copyright (C) 2009-2012  Free Software Foundation, Inc.
> +;; Copyright (C) 2009-2013  Free Software Foundation, Inc.
>  
>  ;; Authors: Eric Schulte
>  ;;   Dan Davison
> @@ -1323,8 +1323,8 @@ may be specified in the properties of the current 
> outline entry."
>(buffer-string)))
> (org-babel-merge-params
>  org-babel-default-header-args
> -   (org-babel-params-from-properties lang)
>  (if (boundp lang-headers) (eval lang-headers) nil)
> +   (org-babel-params-from-properties lang)
>  (org-babel-parse-header-arguments
>  (org-no-properties (or (match-string 4) ""
> switches
> -- 
> 1.7.9

-- 
Sebastien Vauban




[O] LaTex / PDF export doesn't hyphenate

2013-05-03 Thread D. C. Toedt
ENVIRONMENT:  Using Mac OS X Mountain Lion, Emacs 24.3, Org-mode 7.9.1.

PROBLEM:  When I export to LaTex, there's no hyphenation.

The problem exists even when I manually insert hyphenation points with \-
as shown below.

This problem exists when I process a book manuscript, and also when I
process a tiny file such as the following:

=begin quote=

#+LATEX_CLASS: book

** Affiliate

a) One individual or organization ("Person") is an Affiliate of another
Per\-son if, either directly or indirectly via one or more intermediaries,
the first Person controls, or is controlled by, or is under common
con\-trol with, the other Person.

b) For this purpose, a\nbsp{}Person controls an organization if the Person
has voting control\nbsp{}--- via legal, beneficial or equitable ownership;
a\nbsp{}voting agreement; or otherwise\nbsp{}--- of securities of (or other
interest in) the organization having more than the Minimum Voting
Percentage (51% if the Agreement does not specify otherwise) of the
aggregate right to vote for the organization's board of directors or
comparable governing body.

c) A\nbsp{}Person also controls an organization if the Person has a
legally-enforceable right to select, or to prevent the selection, of
a\nbsp{}majority of the members of that board or other body.

=end quote=


INVESTIGATION:  I looked at the buffer *Org PDF LaTex Output*; the only
occurrences of any "hyphen"-related string are:

=begin quote=

Babel  and hyphenation patterns for english, dumylang,
nohyphenation, ge
rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus,
arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech,
danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi,
finnis
h, french, friulan, galician, german, ngerman, swissgerman, monogreek,
greek, h
ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada,
malayalam, ma
rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish,
italian,
kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal,
nynorsk,
 polish, portuguese, romanian, romansh, russian, sanskrit, serbian,
serbianc, s
lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian,
uppersorbian,
welsh, loaded.

=end quote=

EXPERIMENTS:  In the course of a lot of Google-searching, I've tried,
without success, the following:

#+LATEX_HEADER: \usepackage[english]{babel}


and

#+LATEX_HEADER: \usepackage[english=hyphenation]{babel}


All suggestions gratefully received.

*--*
*
*
*D. C. Toedt III * |  IP and contracts lawyer for tech companies   |
 Houston (Central time)
My last name is pronounced "Tate"   |   E: d...@toedt.com  |  O: +1 (713)
364-6545  |  C: +1 (713) 516-8968
*Blog:* On Contracts   |  *LinkedIn:*
dctoedt
|   
Calendar
 (redacted)


[O] Bug: Insert org headline errors out [8.0.2 (release_8.0.2-68-g40635b @ /home/dsubramanian/.emacs.d/thirdparty/org-mode/lisp/)]

2013-05-03 Thread deepak subramanian
I am getting the below error when inserting a headline in org mode using
Ctrl-Enter or M-Enter
System : Ubuntu 10.04

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  looking-at(nil)
  (and (looking-at org-complex-heading-regexp) (match-beginning 4) (> p
(match-beginning 4)))
  (let ((p ...)) (goto-char (point-at-bol)) (and (looking-at
org-complex-heading-regexp) (match-beginning 4) (> p ...)))
  (save-excursion (let (...) (goto-char ...) (and ... ... ...)))
  (and (org-get-alist-option org-M-RET-may-split-line (quote headline))
(save-excursion (let ... ... ...)))
  (let ((split ...) tags pos) (cond (... ...)
(org-insert-heading-respect-content ... ... ... ... ...) (... ... ... ...
... ... ... ... ... ... ...) (t ... ...)))
  (if (and (bolp) (org-at-heading-p) (not eops) (or ... ...)) (open-line
(if blank 2 1)) (save-excursion (setq previous-pos ...) (end-of-line) (setq
hide-previous ...)) (and org-insert-heading-respect-content (save-excursion
...)) (let (... tags pos) (cond ... ... ... ...)))
  (let* ((empty-line-p nil) (eops ...) (org-insert-heading-respect-content
...) (level nil) (on-heading ...) (fix-level ...) (on-empty-line ...) (head
...) (blank-a ...) (blank ...) pos hide-previous previous-pos) (if (and ...
... ... ...) (open-line ...) (save-excursion ... ... ...) (and
org-insert-heading-respect-content ...) (let ... ...)) (insert head)
(just-one-space) (setq pos (point)) (end-of-line 1) (unless (= ... pos)
(just-one-space) (backward-delete-char 1)) (when (and
org-insert-heading-respect-content hide-previous) (save-excursion ... ...))
(when (and begn endn) (narrow-to-region ... ...)) (run-hooks (quote
org-insert-heading-hook)))
  (let (begn endn) (when (org-buffer-narrowed-p) (setq begn ... endn ...)
(widen)) (let* (... ... ... ... ... ... ... ... ... ... pos hide-previous
previous-pos) (if ... ... ... ... ...) (insert head) (just-one-space) (setq
pos ...) (end-of-line 1) (unless ... ... ...) (when ... ...) (when ... ...)
(run-hooks ...)))
  (cond ((or ... ...) (insert ... ...) (run-hooks ...)) ((or arg ... ...)
(let ... ... ...)))
  (let ((itemp ...)) (cond (... ... ...) (... ...)))
  org-insert-heading(nil nil)
  (let ((org-insert-heading-respect-content t)) (org-insert-heading arg
invisible-ok))
  org-insert-heading-respect-content(nil)
  call-interactively(org-insert-heading-respect-content nil nil)


Emacs  : GNU Emacs 23.1.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2012-05-18 on batsu, modified by Debian
Package: Org-mode version 8.0.2 (release_8.0.2-68-g40635b @
/home/dsubramanian/.emacs.d/thirdparty/org-mode/lisp/)

current state:
==
(setq
 org-log-done 'time
 org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-tab-first-hook '(org-hide-block-toggle-maybe
org-src-native-tab-command-maybe
  org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-todo-keywords '(sequence "TODO" "INPROGRESS" "|" "DONE")
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-hide-inline-tasks org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-mode-hook '((lambda nil
  (org-add-hook (quote change-major-mode-hook) (quote
org-show-block-all)
   (quote append) (quote local))
  )
 #[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-confirm-elisp-link-function 'yes-or-no-p
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-insert-heading-respect-content t
 org-occur-hook '(org-first-headline-recenter)
 org-from-is-user-regexp nil
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 )


Re: [O] [html] centering

2013-05-03 Thread Samuel Wales
Hi Carsten,

On 5/3/13, Carsten Dominik  wrote:
>> Has there been a recent change in HTML centering?  We get this now:
>>
>>  
>>
>> This does not work in browsers that do not support CSS.
>
> Specifically, which browsers are you talking about?
>
> What do you mean by "not working"?  Just not centered,
> or something worse?

Just not centered.  I want my posts to work in text-oriented browsers
if possible, and I find that emacs-w3m does not seem to center.  In my
test, at least, a normal export of a subtree to a buffer (with HEAD)
does not center in emacs-w3m.

Incidentally, I normally export blog posts without HEAD, because
Blogger does not work well that way.  So the new change means, as far
as I can tell, that I will have to add a CSS definition for center to
the places where I export.

Thanks.

Samuel

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

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



Re: [O] LaTex / PDF export doesn't hyphenate

2013-05-03 Thread Marcin Borkowski
Dnia 2013-05-03, o godz. 15:55:09
"D. C. Toedt"  napisał(a):

> ENVIRONMENT:  Using Mac OS X Mountain Lion, Emacs 24.3, Org-mode
> 7.9.1.
> 
> PROBLEM:  When I export to LaTex, there's no hyphenation.
> 
> The problem exists even when I manually insert hyphenation points
> with \- as shown below.
> [...]
> All suggestions gratefully received.

It works here (though on different OS and Org-mode version); it even
hyphenates things not marked by \-.  Can you paste the generated LaTeX
file and the whole .log file?  Also, try to put a line saying
\showhyphens{agreement} and search for things like "Underfull \hbox";
shortly thereafter, you should see something like "agree-ment".

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



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

2013-05-03 Thread Martin Becker

Hi again,

On 03.05.2013 22:25, Christian Egli wrote:

Hi Martin

Martin Becker  writes:


My idea was, that clock times are only used when there is no explicit
information given, viz., when there is neither a property `complete'
nor the task state equals "done". Since I am clocking most of my
activities, it would be convenient for me to let the exporter/TJ3
infer the task progress instead of explicitly giving the `complete'
property. So far for the story.

Ah, I get it. You are infering the % complete based on how much effort
you have already put into a task. The problem is that this doesn't
always relate to each other: You might have put a lot of effort into a
task and still be only at 10% complete.
Of course this rarely works out like that. At least me, I am using such 
planning to see "how wrong" I was and what is the impact of that. 
Though, "booking" would be better for that as I learned meanwhile.

I.e. does tj3 adapt the length fo a task based on your clock
table?

No, TJ3 is not adapting anything here, neither am I. Since you cannot
give values > 100 (%), my patch limits the maximum inferred progress
to 99. We could let the exporter overwrite the effort with the
clocksum in those cases, but it doesn't seem right.

Yes, since this is another problem with infering the complete
information from the planed effort and actual effort: You can end up
with complete more than 100% :-), namely if the actual effort is bigger
than the planed effort.

yes...see above.
   

I found out some more details after reading the documentation of TJ3:
- The `complete' property is merely for documentation purposes, it's
totally ignored by TJ3 when it comes to scheduling. It just "looks
nice".

Yes, I think there are some other draw backs with the complete
information. Check the taskjuggler mailing list archives for a
discussion on tracking the progress of a project
(https://groups.google.com/d/topic/taskjuggler-users/ZCk_est4GKE/discussion).
I for one would like it if were used for scheduling.
That's why I stopped the inferred progress at 99%...one never knows as 
the linked thread shows ;) Until there is a change in semantics for that 
property, it shouldn't hurt to guess it like that.

- But there is another thing we could do: One can add "bookings" to
the tasks, which could be exactly the clock times from org-mode. I
tried this manually and it seems to be a mixed blessing: If doing so,
TJ3 internally grows the effort when the bookings exceed them and
reschedules accordingly (which is nice).

This is something that would make sense in the exporter. The clocking
information that we have in the org file is really what tj3 wants as a
booking.
Agreed, I think that's much more interesting than `complete'. However is 
tricky to integrate that well without ending in bad (ox-taskjuggler) 
user experience caused by TJ3 refusing to schedule...

On the other hand sensible clock times are vital then. What I mean is,
when there are bookings that are too early w.r.t. a task's earliest
possible start (due to dependencies etc.), then TJ3 exits with an
error. I am not sure this is wanted behavior. What do you think?

Yes, it appears that you will have to have bookings for all the tasks to
make this work properly. This is a lot of overhead. I'm also not sure
this is wanted. But the benefit would be that you can use projection
mode in which tj3 will afaik recalculate the duration of the project
based an planed and actual effort. Might be worth exploring.
I am not quiet through TJ3 doc to understand what projection really is, 
but it seems that booking only *some* tasks also makes a difference (as 
I said, it grows the effort if there was an underestimation and thereby 
affects the project timing). Eventually a user could clock and book just 
a subset of the tasks (e.g., his own) and skip others or whatever...



Additionally, the visually attractive completeness is not derived from
the bookings or anything.

Yes.


but eventually I'd like to move it back to core. So we need
assignment for this patch.

Is it that I need to sign something?

Have a look at request-assign-future.txt in the org-mode git repo.

Will do.


Thanks
Christian



Thanks &
have a nice weekend,
Martin



[O] Org odt export

2013-05-03 Thread Wiskey 5 Alpha
Hello all.  I use the odt-export functionality quite extensively.  I
recently upgraded to org-mode version 8.0.2-2-g93da18-elpaplus.

I created an .ott file to use as my style reference for some handouts i
created.  In previous versions of org-mode, I used a line in the header
like this

#+ODT_STYLES_FILE: "/path/to/handout.ott"

this always incorporated the styles from the ott file until the upgrade.  I
checked the manual and the syntax seems to be the same.

Also , #+INCLUDE: directives seem to just be copied in verbatim, even if
they have directives, such as {{{date(%d %b %Y)}}}

I have confirmed that i (require 'ox-odt) .

Thank you.
-Tim