Re: [O] recurring events with different notes for each occurrence

2013-10-12 Thread Karl Voit
* Jarmo Hurri  wrote:
>
> I tried to play with these, but did not get the extra info in the
> agenda.
>
> Maybe I need to get better acquainted with agendas. Is there a way to
> associate a property with each repeating timestamp and show this
> property in the agenda? (There most likely is.)

Try one of these[1]:

;;; http://orgmode.org/worg/org-faq.html
(setq org-agenda-skip-additional-timestamps-same-entry nil)

... most probably fixing your issue IMHO.

;; Show all future entries for repeating tasks
(setq org-agenda-repeating-timestamp-show-all t)

;; Show all agenda dates - even if they are empty
(setq org-agenda-show-all-dates t)



  1. https://github.com/novoid/dot-emacs/blob/master/org-mode.el
-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github




Re: [O] LaTeX math mode and export

2013-10-12 Thread Nicolas Goaziou
Hello,

Fabrice Popineau  writes:

> I'm not sure why it is not correct : I guess you mean not correct Org
> syntax?

Correct.

> The problem as I feel it is that \[ \] works sometimes, but not as
> often as with LaTeX, which is disconcerting.

\[...\] is more limited in Org than in LaTeX, indeed.

> I know that theparagraph entity in Org mode is different than what it is is
> in LaTeX, but still.
>
> Why \[ ... \] couldn't be handled as if it where \begin{equation} ...
> \end{equation} ?
> Is there any other use of \[ that would prevent its detection ?

There are two types of structures in Org syntax: inline (i.e. contained
in a paragraph) and not inline. inlined structures always belong to
a non-inlined one. Therefore, the parser always gives precedence to
non-inlined syntax over inlined one.

Thus, the following example will be a single paragraph with some maths
inside:

  A paragraph with \[1+1=2\] maths.

But the following one:

  A paragraph
  \[1
+ 1
= 2
  \]
  with maths.

will be a paragraph, a list and another paragraph: "A paragraph\n\[1",
" + 1" and " = 2\n\]\nwith maths."

If \[...\] constructs were to be changed into non-inlined, the maths
snippet in the first example would not be recognized.

It is theoretically possible to make "\[...\]" both inline and
non-inline. Though, I have the feeling that it would come with its own
set of problems.

> Sorry to be such an hassle, but that would help to smooth the conversion of
> previous LaTeX files/users
> to Org.

I think that a major pitfall for these users is to think that you can
wrap LaTeX syntax in Org structures. Actually, Org only supports
a limited set of LaTeX syntax.

> IF I fix it and I use #+begin_equation ... #+end_equation , I still hit
> something with these math delimiters:

No, you should use \begin{equation}...\end{equation} in order to make it
a full LaTeX environment. #+begin_equation is not an equation
environment, it's a special block, which can contain Org syntax (and you
don't want Org syntax here).

>  > - \(\min(x,y)\) , \(\max(x,y)\)
>> > - \(\operatorname{Prime}(x) = \left\{ \begin{array}{cl} 1 & \text{ if }
>> >   x \text{ is prime } \\ 0 & \text{ if } x \text{ is not prime }
>> > \end{array} \right. \)
>>
>> The last line is not correctly indented: it doesn't belong to the last
>> item and therefore, the math snippets is not recognized.
>
> True, didn't notice that it could make a difference, because Org-mode
> refuses to indent it.
> I mean I used  on all lines and thought that it wasn't indented
> because it could have
> been the previous line that was wrapped. Org-mode is able to indent the
> second line but
> what is preventing it to indent the third line?

The last line doesn't belong to the list above. "Indenting" it at the
"x" level would actually change the structure of the list, which is more
than what a simple indentation command is allowed to do (I know about
python mode and I don't think it is a good behaviour for Org).

> Ok. I understand that curly braces in plain text need to be backslahed in
> LaTeX.
> But again what is surprising is that the backslash itself
> in \IEEEAuthorBlockA and \IEEEAuthorBlockN are not translated to LaTeX
> syntax.

Honestly, it surprised me too, as I thought that every curly bracket
would be escaped. But I don't have time to look into it at the moment.

> I hope my comments do not seem too rude. I try to report the feeling of
> someone
> who doesn't know the internals. I think that the less suprised the user is,
> the more it is
> willing to accept the tool. In the area of maths delimiters, I start to
> wonder if Org-mode doesn't push too far
> its guessing of what the user had intended. But maybe I don't see the whole
> picture.

I think the behaviour is not surprising once you know that Org you can't
mix raw LaTeX and regular Org syntax without some precautions. In
particular, Org can only parse very simple LaTeX syntax, but provides
ways to deal with more more complex one.


Regards,

-- 
Nicolas Goaziou



Re: [O] LaTeX math mode and export

2013-10-12 Thread Nicolas Goaziou
Completing myself,

> Fabrice Popineau  writes:

>> But again what is surprising is that the backslash itself
>> in \IEEEAuthorBlockA and \IEEEAuthorBlockN are not translated to LaTeX
>> syntax.
>
> Honestly, it surprised me too, as I thought that every curly bracket
> would be escaped. But I don't have time to look into it at the moment.

Actually, the reason is that regexp matching a macro is:

  "[a-zA-Z]+\\*?\\(\\(\\[[^][\n{}]*\\]\\)\\|\\({[^{}\n]*}\\)\\)*"

IOW, brackets (even escaped) are not allowed in the arguments of a LaTeX
macro. So the first \IEEEAuthorBlockN is correctly recognized but
\IEEEauthorblockA fails.

This is not optimal, but I think it is sufficient, since, again, Org
handles only simple raw LaTeX syntax.



[O] Run commands after html export

2013-10-12 Thread Jarmo Hurri

Greetings.

I feel like a newbie most of the time when I try to do something a bit
more complicated with org. And finding the solution in the manuals is
often pretty hard.

What I would like to do now is to automatically run some commands after
I have exported an org file as html. (In particular, I want to commit to
git and push changes to remote repo.) I know about publishing, but it
seems like overkill for a single org file.

I looked at the documentation, found hooks, and read source code, but
could not find the solution. The hooks in org-export-html-final-hook
seem to be run before the file is saved. I found no applicable hooks in
org-exp.el.

While I am at it, is there a way to set a default export type (html), or
do I have to bind a new key or rebind C-c C-e?

Thanks in advance - again.

Jarmo




[O] Hooks org-publish-before-export-hook, org-publish-after-export-hook no longer in use?

2013-10-12 Thread Iannis Zannos
Hello,

it appears that in org-mode 8.x the hooks org-publish-before-export-hook
and org-publish-after-export-hook are no longer used. I did a search in the
source code of org-mode 8.2.1 downloaded from
http://orgmode.org/org-8.2.1.zip, and then looked for one of the hooks
with:

find ./ -name "*.el" -exec grep -H -n "org-publish-before" '{}' \; -print

No entries were found.
Instead, the method for customizing export seems to have been changed to
accept a list of publishing functions in a project-alist:

find ./ -name "*.el" -exec grep -H -n "publishing-function" '{}' \; -print

gives the related code in lines 650-662 of file lisp/ox-publish-el.

If the above is correct, then the org-mode manual should be updated to
reflect the change, at page:
http://orgmode.org/worg/org-configs/org-hooks.html

Cheers,

Iannis Zannos


Re: [O] LaTeX math mode and export

2013-10-12 Thread Suvayu Ali
On Sat, Oct 12, 2013 at 09:58:27AM +0200, Nicolas Goaziou wrote:
> Fabrice Popineau  writes:
> 
> > The problem as I feel it is that \[ \] works sometimes, but not as
> > often as with LaTeX, which is disconcerting.
> 
> \[...\] is more limited in Org than in LaTeX, indeed.
> 
> > I know that theparagraph entity in Org mode is different than what it is is
> > in LaTeX, but still.
> >
> > Why \[ ... \] couldn't be handled as if it where \begin{equation} ...
> > \end{equation} ?
> > Is there any other use of \[ that would prevent its detection ?
> 
> There are two types of structures in Org syntax: inline (i.e. contained
> in a paragraph) and not inline. inlined structures always belong to
> a non-inlined one. Therefore, the parser always gives precedence to
> non-inlined syntax over inlined one.
> 
> Thus, the following example will be a single paragraph with some maths
> inside:
> 
>   A paragraph with \[1+1=2\] maths.
> 
> But the following one:
> 
>   A paragraph
>   \[1
> + 1
> = 2
>   \]
>   with maths.
> 
> will be a paragraph, a list and another paragraph: "A paragraph\n\[1",
> " + 1" and " = 2\n\]\nwith maths."
> 
> If \[...\] constructs were to be changed into non-inlined, the maths
> snippet in the first example would not be recognized.
> 
> It is theoretically possible to make "\[...\]" both inline and
> non-inline. Though, I have the feeling that it would come with its own
> set of problems.

A very nice explanation.  Thank you.

> > Sorry to be such an hassle, but that would help to smooth the conversion of
> > previous LaTeX files/users
> > to Org.
> 
> I think that a major pitfall for these users is to think that you can
> wrap LaTeX syntax in Org structures. Actually, Org only supports
> a limited set of LaTeX syntax.

If I may, I think these users are better off using some of the Org
outside Org libraries.

  

One of Org's goals, with regards to exporters, is to be uniform across
all backends so that one can export the same document using multiple
backends without major changes.  Including more and more LaTeX source
deviates from that goal.

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Run commands after html export

2013-10-12 Thread Jarmo Hurri

Answering my own question...

> What I would like to do now is to automatically run some commands
> after I have exported an org file as html.

I ended up circumventing the problem - that is, the exporter - by
creating a code block in which I first run org-html-export-to-html and
then do my git stuff. I no longer use the exporter, I just evaluate the
block.

Lesson learned.

Jarmo




[O] [PATCH] lisp/org.el (org-set-tags): Calculate width of tags with string-width

2013-10-12 Thread Yasushi SHOJI
* lisp/org.el (org-set-tags): Width of strings presenting on a buffer
should be calculated with `string-width' instead of `length'.

This fixes unaligned tags for the languages with multi-width
characters.
---
Hi,

I just noticed that tags are not aligned when I use Japanese chars for
tags.  This patch should fix it.

Other two usages of `length' in the function are fine since they seem
to be used to find the length of lists.

oh, I also found one trailing white space in the fine.  Please drop
that hunk if you don't want to mix it.

Best,

 lisp/org.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 5ff9969..a6df29d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14556,7 +14556,7 @@ With prefix ARG, realign all tags in headings in the 
current buffer."
   0)
  p0 (if (equal (char-before) ?*) (1+ (point)) (point))
  tc (+ org-tags-column (if (> org-tags-column 0) (- di) di))
- c1 (max (1+ c0) (if (> tc 0) tc (- (- tc) (length tags
+ c1 (max (1+ c0) (if (> tc 0) tc (- (- tc) (string-width 
tags
  rpl (concat (make-string (max 0 (- c1 c0)) ?\ ) tags)))
  (replace-match rpl t t)
  (and (not (featurep 'xemacs)) c0 indent-tabs-mode (tabify p0 (point)))
@@ -20385,7 +20385,7 @@ If `org-special-ctrl-o' is nil, just call `open-line' 
everywhere."
 (open-line n))
((org-at-table-p)
 (org-table-insert-row))
-   (t
+   (t
 (open-line n
 
 (defun org-return (&optional indent)
-- 
1.8.4.rc3






Re: [O] using %(sexp) in capture templates

2013-10-12 Thread Mike McLean

On Oct 12, 2013, at 2:03 AM, Manish  wrote:

>  >> On Fri, Oct 11, 2013 at 9:55 PM, Mike McLean wrote:
>   >> 
>   >>   > On Oct 10, 2013, at 9:51 PM, Manish wrote:
>   >>   > 
>   >>   > i am trying to use %(org-mac-outlook-message-insert-selected)
>   >>   > in a capture template to create a todo entry from an email
>   >>   > selected in outlook on mac os x.  i was expecting that the
>   >>   > function will get executed when the template is called and
>   >>   > enter a link to the email but seems to return nothing.  the
>   >>   > function works when used outside of template.  any ideas how i
>   >>   > can begin to debug this or if i should be doing anything
>   >>   > differently?
>   >>   > 
>   >> 
>   >> When I added the support for Outlook I matched the style and design
>   >> of the existing Org mac message (for Mail). In particular
>   >> org-mac-outlook-message-insert-selected does not return a value, it
>   >> is designed to be called interactively and inserts a link at the
>   >> current point in the current buffer. As such it would not work as a
>   >> %() capture template.
>   >> 
>   >> Now on the other hand all org-mac-outlook-message-insert-selected
>   >> does is ~(insert (org-mac-outlook-message-get-links "s"))~. I
>   >> presume (though I haven't tested) that you could use the inner form
>   >> ~(org-mac-outlook-message-get-links "s")~ in a %() sexp in a
>   >> capture template.
>   >> 
> 
> thanks!  it does work this way.
> 
> i am not sure if it's directly related but there's a weird issue.  once
> i have a link to an email, i can open it by c-c c-o only once.  any
> following attempt just fails with a message: "org-mac-link: error could
> not find outlook message " where msgid is the id of the
> message. when i ran the mdfind command that i found in the source in the
> terminal, it again worked once only.  any subsequent attempt opens a
> finder window.  very very odd behavior since i am not even modifying the
> email in anyway (other than just opening it) that might change its
> message id or something.

It has definitely worked for the same message multiple times for me (even after 
changing a message by moving it, etc.). Since the Org mac Outlook interface 
uses Spotlight indexing, and Spotlight uses the loose messages in the Microsoft 
User Data folder, maybe rebuilding one or both of the Outlook profile or the 
Spotlight index would fix your issues?

Re: [O] Run commands after html export #orgmode

2013-10-12 Thread Iannis Zannos
Hello Jarmo,

it may be useful to look into the publishing scheme of org-mode.
Export = export a single file
Publish = publish a set of files. More extensive configuration
capabilities. Can also be used to publish single file.

Publish provides very extensive configuration capabilities, which include a
preparation-function and a completion-function hook. The completion
function can be used to ftp or rsync or otherwise copy data to the target
directory. Have a look at:

http://orgmode.org/worg/doc.html search for: org-publish-project-alist. In
that section you will find following passage:

  `:publishing-function'

Function to publish file.  Each back-end may define its
own (i.e. `org-latex-publish-to-pdf',
`org-html-publish-to-html').  May be a list of functions, in
which case each function in the list is invoked in turn.

Another property allows you to insert code that prepares
a project for publishing.  For example, you could call GNU Make
on a certain makefile, to ensure published files are built up to
date.

  `:preparation-function'

Function to be called before publishing this project.  This
may also be a list of functions.

  `:completion-function'

Function to be called after publishing this project.  This
may also be a list of functions.

You will find more info in the orgmode manual here:
http://orgmode.org/manual/Configuration.html#Configuration
and here:
http://orgmode.org/manual/Sources-and-destinations.html#Sources-and-destinations
and in further related parts linked-to from the above.

Hopefully the above is useful.

Best,
Iannis Zannos


On Sat, Oct 12, 2013 at 2:11 PM, Jarmo Hurri  wrote:

>
> Answering my own question...
>
> > What I would like to do now is to automatically run some commands
> > after I have exported an org file as html.
>
> I ended up circumventing the problem - that is, the exporter - by
> creating a code block in which I first run org-html-export-to-html and
> then do my git stuff. I no longer use the exporter, I just evaluate the
> block.
>
> Lesson learned.
>
> Jarmo
>
>
>


Re: [O] org babel before excute hook

2013-10-12 Thread Henning Redestig
I thought about temp files, but that makes the file names cryptic which is
inconvenient for communication without people outside org.. also, I tend
recompile figures many times which would cause a lot of cluttering files
that are hard to delete since you don't know which file is the one
currently linked in your org file...

Anyway, I made this instead which appears to work as I intended


(defun org-babel-about-to-overwrite-file ()
  (let ((info (org-babel-get-src-block-info)))
(setq result-file (cdr (assoc :file (nth 2 info
(if (save-excursion
  (goto-char 0)
  (re-search-forward (concat ":file +" result-file) nil t)
  (re-search-forward (concat ":file +" result-file) nil t))
(message (concat result-file " defined in more than one source block"))
  (org-babel-execute-maybe

(add-hook 'org-ctrl-c-ctrl-c-hook 'org-babel-about-to-overwrite-file)





2013/10/12 Charles Berry 

> John Kitchin  andrew.cmu.edu> writes:
>
> >
> >
> >
> > I have a related kind of problem. When preparing notes
> > for a class, I may end up with 70 code blocks in an org file, many of
> > which create graphics. I am always worried about accidentally using the
> > same filename and overwriting a graphic from an earlier block. A unique,
> >  but reproducible filename would be sufficient for my needs.
> >
>
> Header arg values can be elisp calls. You can use `make-temp-file'.
>
> So every time this block is executed, a new file is created and the
> file link is added to the results.
>
> #+BEGIN_SRC R :results output append :file (make-temp-file "temp")
> cat(date(),"\n")
> #+END_SRC
>
> #+RESULTS:
> [[file:/var/folders/kb/2hchpbyj7lb6z76l0q73w_fhgn/T/temp302IjV]]
> [[file:/var/folders/kb/2hchpbyj7lb6z76l0q73w_fhgn/T/temp3028Lu]]
>
> See `temporary-file-directory', too, if you want to use this, as the
> default may not be what you intend.
>
>
> You might want to use this:
>
> #+BEGIN_SRC emacs-lisp
>   (defun local-tfile (file)
> (let ((temporary-file-directory "."))
>   (make-temp-file file)))
> #+END_SRC
>
> Then the files go in the local directory when this is executed:
>
> #+BEGIN_SRC R :file (local-tfile "tfile") :results output append
> cat(date(),"\n")
> #+END_SRC
>
> You might not want `append' in this case.
>
>
> HTH,
>
> Chuck
>
> [rest deleted]
>
>
>
>
>


Re: [O] How to collect status of all checkboxes in lower subtrees

2013-10-12 Thread Rainer Stengele
Am 10.10.2013 18:05, schrieb Eric S Fraga:
> Rainer Stengele  writes:
> 
>> Hi!
>>
>> I have a headline with several sub headlines and sub items in lists.
>> Scattered all over I have checkboxes.
>> I would very much like to collect and see the overall status of unchecked 
>> checkboxes.
> 
> Not sure you can do what you want.  However, if you change the checkbox
> lists to headlines with TODOs, what you want is possible:
> 
> #+begin_src org
>   ,* project [2/6]
>   ,** [1/3] subproject 1
>   ,*** TODO todo 1
>   ,*** DONE todo 2
>   ,*** TODO todo 3
>   ,** [1/3] sub subproject 1
>   ,*** TODO todo 1
>   ,*** TODO todo 2
>   ,*** DONE todo 3
> #+end_src
> 
Thank you Eric,
until now TODOs for me always seemed to be a bit heavyweight because of the 
headline needed.
I wonder how people are working.
Do you use checkboxes a lot or prefer TODOs even for simple subtasks?

I find it disturbing to have to open a new headline just for a simple task.
This forces me to continue with TODOs (= headlines) else all subitems will 
belong to the preceding headline.

Any best practice or comment?

Thanks,
Rainer



[O] Run commands after html export

2013-10-12 Thread Iannis Zannos
Hello Jarmo,

it may be useful to look into the publishing scheme of org-mode.
Export = export a single file
Publish = publish a set of files. More extensive configuration
capabilities. Can also be used to publish single file.

Publish provides very extensive configuration capabilities, which include a
preparation-function and a completion-function hook. The completion
function can be used to ftp or rsync or otherwise copy data to the target
directory. Have a look at:

http://orgmode.org/worg/doc.html search for: org-publish-project-alist. In
that section you will find following passage:

  `:publishing-function'

Function to publish file.  Each back-end may define its
own (i.e. `org-latex-publish-to-pdf',
`org-html-publish-to-html').  May be a list of functions, in
which case each function in the list is invoked in turn.

Another property allows you to insert code that prepares
a project for publishing.  For example, you could call GNU Make
on a certain makefile, to ensure published files are built up to
date.

  `:preparation-function'

Function to be called before publishing this project.  This
may also be a list of functions.

  `:completion-function'

Function to be called after publishing this project.  This
may also be a list of functions.

You will find more info in the orgmode manual here:
http://orgmode.org/manual/Configuration.html#Configuration
and here:
http://orgmode.org/manual/Sources-and-destinations.html#Sources-and-destinations
and in further related parts linked-to from the above.

Hopefully the above is useful.

Best,
Iannis Zannos


On Sat, Oct 12, 2013 at 2:11 PM, Jarmo Hurri  wrote:

>
> Answering my own question...
>
> > What I would like to do now is to automatically run some commands
> > after I have exported an org file as html.
>
> I ended up circumventing the problem - that is, the exporter - by
> creating a code block in which I first run org-html-export-to-html and
> then do my git stuff. I no longer use the exporter, I just evaluate the
> block.
>
> Lesson learned.
>
> Jarmo
>
>
>


Re: [O] using %(sexp) in capture templates

2013-10-12 Thread Manish
> On Sat, Oct 12, 2013 at 7:24 AM, Mike McLean wrote:
>
> > On Oct 12, 2013, at 2:03 AM, Manish wrote:
> >
> > > On Fri, Oct 11, 2013 at 9:55 PM, Mike McLean wrote:
> > >
> > > > On Oct 10, 2013, at 9:51 PM, Manish wrote:
> > > >
> > > > i am trying to use %(org-mac-outlook-message-insert-selected) in
> > > > a capture template to create a todo entry from an email selected
> > > > in outlook on mac os x.  i was expecting that the function will
> > > > get executed when the template is called and enter a link to the
> > > > email but seems to return nothing.  the function works when used
> > > > outside of template.  any ideas how i can begin to debug this or
> > > > if i should be doing anything differently?
> > > >
> > >
> > > When I added the support for Outlook I matched the style and
> > > design of the existing Org mac message (for Mail). In particular
> > > org-mac-outlook-message-insert-selected does not return a value,
> > > it is designed to be called interactively and inserts a link at
> > > the current point in the current buffer. As such it would not work
> > > as a %() capture template.
> > >
> > > Now on the other hand all org-mac-outlook-message-insert-selected
> > > does is ~(insert (org-mac-outlook-message-get-links "s"))~. I
> > > presume (though I haven't tested) that you could use the inner
> > > form ~(org-mac-outlook-message-get-links "s")~ in a %() sexp in a
> > > capture template.
> > >
> >
> > thanks!  it does work this way.
> >
> > i am not sure if it's directly related but there's a weird issue.
> > once i have a link to an email, i can open it by c-c c-o only once.
> > any following attempt just fails with a message: "org-mac-link:
> > error could not find outlook message " where msgid is the id
> > of the message. when i ran the mdfind command that i found in the
> > source in the terminal, it again worked once only.  any subsequent
> > attempt opens a finder window.  very very odd behavior since i am
> > not even modifying the email in anyway (other than just opening it)
> > that might change its message id or something.
>
> it has definitely worked for the same message multiple times for me
> (even after changing a message by moving it, etc.). since the org mac
> outlook interface uses spotlight indexing, and spotlight uses the
> loose messages in the microsoft user data folder, maybe rebuilding one
> or both of the outlook profile or the spotlight index would fix your
> issues?

i'll look into rebuilding outlook profiles and spotlight indexes.
meanwhile, following has worked consistently for me:

#+begin_src emacs-lisp
(defun org-mac-outlook-message-open (msgid)
  "open a message in outlook"
  (do-applescript
   (concat
"tell application \"Microsoft Outlook\"\n"
 (format "open message id %s\n" msgid)
 "activate\n"
 "end tell")))
#+end_src

cheers!
--manish


[O] Tasks started tag

2013-10-12 Thread Chris Henderson
I have the following line in my .emacs for tasks which I invoke with C-c
C-t. How can I add another tag called 'Started' for tasks I already started:

(setq org-todo-keywords
'((sequence "TODO(t)" "|" "DONE(d)")
  (sequence "|" "CANCELED(c)")))

(setq org-todo-keyword-faces
   '(("CANCELED" . (:foreground "blue" :weight bold

Thanks.