[O] Can I export from org mode to org mode?

2012-05-03 Thread Piter_
Hi everybody.
I keep my notes in one big org file. It have grown big
One solution could be filtering tree and display only the information I need,
another id to split it into smaller files by topic.
I would appreciate a hint on how to do the later.

Thanks.
Petro.



Re: [O] orgstuct++ does not lurk silently in the shadow

2012-05-03 Thread Nicolas Goaziou
Bastien  writes:

> Nicolas Goaziou  writes:
>
>> No, it happens with `message-mode-hook'. Here is the relevant part of my
>> configuration:
>
> I can't reproduce this with a bare emacs-24.0.94 -Q (this is the oldest
> Emacs I can test with.)
>
> Can you detail the steps to reproduce?  

I cannot reproduce it with -Q (though indentation is strange at the
beginning).

I'm not sure where it comes from, though. It looks like an eisenbug to
me. Debugging `org-indent-line-function' didn't help.


Regards,

-- 
Nicolas Goaziou



Re: [O] fill-paragraph: wrong behaviour after latex-environments

2012-05-03 Thread Benjamin Motz
a...@fastmail.fm (Albert Z. Wang) writes:

[...]
> This sets several new paragraph boundary markers to prevent wrapping
> them into paragraphs: \begin{, \end{, and the unnumbered display
> equation shortcut \[, \].

Thank you, that did the trick!

Shouldn't that be the default behaviour, i.e. should this be
considered a bug?

Benjamin




Re: [O] fill-paragraph: wrong behaviour after latex-environments

2012-05-03 Thread Albert Z. Wang
Benjamin Motz  writes:

> Hi,
>
> invoking fill-paragraph on the following org-code will delete the
> newline after \end{equation}:
>
> The relation
> \begin{equation}
> E=mc^2
> \end{equation}
> won't be further discussed here.
>
> This behaviour is undesirable because it makes the org-text less
> readable. Also, when adding '%' after \end{equation}, newline is still
> being deleted by fill-paragraph (and the text after '%' won't be
> exported e.g. by latex-export).
>
> Is there a workaround or can someone point me to the location where I
> can fix/change this behaviour?
>
> Thanks, Benjamin

I had the same issue; fixed it by adding the following org-mode-hook:

(add-hook 'org-mode-hook 
  (lambda ()
;; don't rewrap display equations into paragraphs
(setq paragraph-separate 
  (concat "[\\f 
\\t]*\\(begin{\\|end{\\|\\[\\|\\]\\)\\|"
  paragraph-separate))


This sets several new paragraph boundary markers to prevent wrapping
them into paragraphs: \begin{, \end{, and the unnumbered display
equation shortcut \[, \].





Re: [O] Remaining Work Report

2012-05-03 Thread Sebastien Vauban
Hi Myles,

Myles English wrote:
>>> On Mon, 19 Mar 2012 14:33:17 +0100, Sebastien Vauban said:
>
>   > #+COLUMNS: %40ITEM(Task) %6Effort(Estim.){:}
>
>   > The question I'm trying to give an answer to is: *what's the
>   > remaining number of hours (or days) to finish my project*?
>
> I have just been through this myself so I hope I will be able to help.
>
> To exclude DONE items from the columnview I moved the Effort property out of
> the way to the Old_Effort property when the state changes to DONE:
>
> ,---
> | (require 'org)  
>   
> | (defun my-move-effort-if-done ()
>   
> | "For TOC style columnview table.  Don't want to include DONE
>   
> |   items in the TODO Effort column so copy Effort to Old_Effort  
>   
> |   property" 
>   
> | (interactive)   
>   
> | ( when (string= (org-get-todo-state) "DONE")
>   
> |   (member (org-get-todo-state) org-done-keywords)   
>   
> |   ;; check if changing to DONE  
>   
> |   (org-entry-put nil "Old_Effort" (org-get-effort)) 
>   
> |   ;; get the :Effort: property  
>   
> |   ;(message (format "Got: %s when changin to %s" ( org-get-effort ) 
> (org-get-todo-state)))
> |   (setq org-clock-effort (org-get-effort))  
>   
> |   (org-entry-delete nil "Effort"))) 
>   
> | 
>   
> | (setq org-after-todo-state-change-hook nil) 
>   
> | 
>   
> | (add-hook 'org-after-todo-state-change-hook 
>   
> |   'my-move-effort-if-done)  
>   
> `---
>
> Unlike your example I made heavy use of inline tasks and also wanted heading
> numbers instead of asterisks, so that the final table looks like a table of
> contents with estimated times remaining. I had to do some more things to
> achieve this and can elaborate if you like.

I finally spend some time to look at your answer, and give a feedback.

First, I really thank you for your answer. It really is interesting to see how
others tackle with the same (kind of) problem.

Second, about your "workaround". It does not satisfy me (renaming the property
Effort to Old_Effort upon transition change to DONE)[1] because:

- What happens if you reopen the task, clock some time on it, and close it?
  A new move of the property will occur, with a nil (hence, null?) value?
  Your Old_Effort will be overwritten?

- My goal is to show, in a table, the progress made on all tasks (TODO, STRT,
  DONE), and moreover to compare "spent time" (CLOCK) vs "estimated time"
  (Effort). Hence, I need to have the effort property at all times[2].

Do you have, maybe, an alternative way for those?

Best regards,
  Seb

[1] Though, it's a nice idea...

[2] Or I would need to complexify the table report, and search for Old_Effort,
then (if not found) search for Effort. I'm scared of having as well entries
with the 2 different properties, because of a mistake when quickly editing
(via C-c C-x e, for example).

-- 
Sebastien Vauban




Re: [O] orgstuct++ does not lurk silently in the shadow

2012-05-03 Thread Bastien
Nicolas Goaziou  writes:

> No, it happens with `message-mode-hook'. Here is the relevant part of my
> configuration:

I can't reproduce this with a bare emacs-24.0.94 -Q (this is the oldest
Emacs I can test with.)

Can you detail the steps to reproduce?  

Sorry this is boring, but I don't want to let such a serious but in the
wild. 

Thanks!

-- 
 Bastien



Re: [O] orgstuct++ does not lurk silently in the shadow

2012-05-03 Thread Nicolas Goaziou
Hello,

Bastien  writes:

> Nicolas Goaziou  writes:
>
> I can reproduce the problem with 
>
>   (add-hook 'message-setup-hook 'turn-on-orgstruct++)
>
> I cannot reproduce it with
>
>   (add-hook 'message-mode-hook 'turn-on-orgstruct++)
>
> Can you confirm this is the same for you?

No, it happens with `message-mode-hook'. Here is the relevant part of my
configuration:

#+begin_src elisp
(defun ngz-message-mode-hook-handler ()
  (turn-on-flyspell)
  (turn-on-orgtbl)
  (turn-on-orgstruct++)
  (set (make-local-variable 'org-footnote-tag-for-non-org-mode-files) nil)
  (local-set-key (kbd "C-c C-x f") 'org-footnote-action))

(add-hook 'message-mode-hook 'ngz-message-mode-hook-handler)
#+end_src


Regards,

-- 
Nicolas Goaziou



Re: [O] orgstuct++ does not lurk silently in the shadow

2012-05-03 Thread Bastien
Hi Nicolas,

Nicolas Goaziou  writes:

> I confirm the problem with latest Org (Org-mode version 7.8.09
> (release_7.8.09-483-g01d83d)) and GNU Emacs 24.0.95.1.
>
> I also use orgstruct++-mode.

I can reproduce the problem with 

  (add-hook 'message-setup-hook 'turn-on-orgstruct++)

I cannot reproduce it with

  (add-hook 'message-mode-hook 'turn-on-orgstruct++)

Can you confirm this is the same for you?

(The manual advertizes using `message-mode-hook'.)

Thanks,

-- 
 Bastien



Re: [O] orgstuct++ does not lurk silently in the shadow

2012-05-03 Thread Nicolas Goaziou
Hello,

>  Eric Fraga  writes:

>> Further, with orgstuct++-mode, trying to add a new line (i.e. my
>> response), I get the following error message:
>>
>> ,
>> | org-indent-line-function: Lisp nesting exceeds `max-lisp-eval-depth' [3 
>> times]
>> `

I confirm the problem with latest Org (Org-mode version 7.8.09
(release_7.8.09-483-g01d83d)) and GNU Emacs 24.0.95.1.

I also use orgstruct++-mode.


Regards,

-- 
Nicolas Goaziou



[O] fill-paragraph: wrong behaviour after latex-environments

2012-05-03 Thread Benjamin Motz
Hi,

invoking fill-paragraph on the following org-code will delete the
newline after \end{equation}:

The relation
\begin{equation}
E=mc^2
\end{equation}
won't be further discussed here.

This behaviour is undesirable because it makes the org-text less
readable. Also, when adding '%' after \end{equation}, newline is still
being deleted by fill-paragraph (and the text after '%' won't be
exported e.g. by latex-export).

Is there a workaround or can someone point me to the location where I
can fix/change this behaviour?

Thanks, Benjamin




Re: [O] [bug] new exporter fails on read only files

2012-05-03 Thread Nicolas Goaziou
Hello,

Eric Fraga  writes:

> Okay, I have investigated.  Attached is a simple example which
> illustrates the problem which appears to be use of a latex macro within
> a table.

Thank you. This bug should be fixed now.

> Are latex macros still allowed?

They are.

As side note, is the provided example, you can also replace
"\label{sec:bug}" with, for example <> and "\ref{sec:bug}" with
[[sec-bug]] to achieve the same result, with the added benefit of being
able to navigate between the two with `org-open-link'.

> * new exporter
>   \label{sec:bug}
>
>   This section illustrates a simple bug in the new exporter, I think.
>
>   | Section   | Description|
>   |---+|
>   | \ref{sec:bug} | An illustration of the bug |
>   |---+|


Regards,

-- 
Nicolas Goaziou



Re: [O] orgstuct++ does not lurk silently in the shadow

2012-05-03 Thread Bastien
Hi Eric,

Eric Fraga  writes:

> Ummm, doesn't work well for me at all.  If I try to fill your main
> paragraph above, the whole quoted text is filled into one
> mess.  Without orgstuct++-mode, it works.
>
> Further, with orgstuct++-mode, trying to add a new line (i.e. my
> response), I get the following error message:
>
> ,
> | org-indent-line-function: Lisp nesting exceeds `max-lisp-eval-depth' [3 
> times]
> `
>
> with the following backtrace:
>
> ,
> | Debugger entered--Lisp error: (error "Lisp nesting exceeds 
> `max-lisp-eval-depth'")
> |   org-indent-line-function()
> |   org-indent-line-function()
> |   org-indent-line-function()
> |   ... repeated ad infinitum ...
> `

Mh.. do you confirm this is from latest git?  More precisely,
please make sure you have this commit in your git log:

  http://orgmode.org/w/?p=org-mode.git;a=commit;h=a8c312

I don't see how the Emacs version could interfere here, but
please give it too -- along with the way you call orgstuct++-mode
for messages.  I do this:

(add-hook 'message-mode-hook 'turn-on-orgstruct++)

It works fine here.

Best,

-- 
 Bastien



Re: [O] orgstuct++ does not lurk silently in the shadow

2012-05-03 Thread Eric Fraga
Bastien  writes:

> Hi Christopher,
>
> I've now fixed orgstuct++-mode so that you can turn it on and off
> safely.  Some Org filling functions fall back on the major-mode
> filling functions through a new defmacro.
>
> Please test and report any problem.
>
> Thanks!

Ummm, doesn't work well for me at all.  If I try to fill your main
paragraph above, the whole quoted text is filled into one
mess.  Without orgstuct++-mode, it works.

Further, with orgstuct++-mode, trying to add a new line (i.e. my
response), I get the following error message:

,
| org-indent-line-function: Lisp nesting exceeds `max-lisp-eval-depth' [3 times]
`

with the following backtrace:

,
| Debugger entered--Lisp error: (error "Lisp nesting exceeds 
`max-lisp-eval-depth'")
|   org-indent-line-function()
|   org-indent-line-function()
|   org-indent-line-function()
|   ... repeated ad infinitum ...
`

thanks,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1
: using Org release_7.8.09-482-gf47915




Re: [O] [bug] new exporter fails on read only files

2012-05-03 Thread Eric Fraga
Nicolas Goaziou  writes:

> Hello,
>
> Eric Fraga  writes:
>
>> Actually, I have updated (one minute ago) and the problem has now
>> changed!  I now get this error:
>>
>> ,
>> | and: Wrong type argument: stringp, (latex-fragment (:value 
>> "\\ref{sec:evaporative}" :begin 11957 :end 11978 :post-blank 0))
>> `
>
> This is a bit short to start investigations. Something is happening at
> position 11957 in your buffer. You may want to narrow it to the
> paragraph/table/construct around and try to export it again. It could
> make a minimal example.

Okay, I have investigated.  Attached is a simple example which
illustrates the problem which appears to be use of a latex macro within
a table.  Are latex macros still allowed?  I have used emacs -Q and
loaded in the new export etc.  No customisations.

The error message for this example is:

,
| and: Wrong type argument: stringp, (latex-fragment (:value "\\ref{sec:bug}" 
:begin 322 :end 335 :post-blank 0))
`

> You may also try (org-element-parse-buffer) to see if the error comes
> from the parser or the export engine. You could even try to export to

It's the export engine and it's due to my \ref{...} having the \
escaped, which should not happen.

Thanks,
eric

#+TITLE: examplebug.org
#+AUTHOR:Eric S Fraga
#+EMAIL: e.fr...@ucl.ac.uk
#+DATE:  2012-01-09 Mon

* new exporter
  \label{sec:bug}

  This section illustrates a simple bug in the new exporter, I think.

  | Section   | Description|
  |---+|
  | \ref{sec:bug} | An illustration of the bug |
  |---+|

  The table has a reference using a direct latex command.



-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1
: using Org release_7.8.09-414-gb3e8a8


Re: [O] Habit tracking and table data

2012-05-03 Thread Steinar Bang
> Bernt Hansen :

> By default marking it done creates a log entry with just the timestamp
> (no log note).

If I'm going to edit the table directly anyway, I don't really need the
habit tracking functionality.  Or is there something I will be missing
out on, that I don't see...?

Would it be possible to automate the setting of a time stamp in the
first column when creating a new row?