[Orgmode] Re: Repeating dates on named weekdays

2010-01-16 Thread Ben Finney
Glauber Alex Dias Prado  writes:

> William Halliburton  writes:
> > How can one enter in repeating dates such as
> >
> > every third thursday of each month
> >
> http://www.gnu.org/software/emacs/manual/html_node/org/Repeating-items.html#Repeating-items
> http://orgmode.org/manual/Repeated-tasks.html#Repeated-tasks

That doesn't help. Neither of those pages say anything about this common
use case.

I do wish the Org manual, at least, would give an example of what the OP
is asking for: repeating events on “every month on the Nth D-weekday at
T time”, and how to translate the N, D, and T into some Org date+time
format that will give that result.

I'd provide a suggested addition to the manual, but I still don't
understand the baroque sexp date format myself.

-- 
 \“Good morning, Pooh Bear”, said Eeyore gloomily. “If it is a |
  `\   good morning”, he said. “Which I doubt”, said he. —A. A. Milne, |
_o__)_Winnie-the-Pooh_ |
Ben Finney



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


[Orgmode] From comments in code to org-mode

2010-01-16 Thread andrea
I had an idea which would be really nice if I'm able to implement it.
I write very often in code comments like
// FIXME: infinite loop
for example, now is a good thing they're in the code, but I also would
like to centralize the error management per project in some way.

So I thought something like, adding a hook in after-save-hook that
checks all the FIXME|TODO... and adds it to an org-mode file.

That org-mode should be like

* FIXME [[file:error.c:20][error.c]] (don't remember the syntax)
  
Maybe also including the date when this has been written the first time.
Then if the error is corrected or the nice thing would be adding a 
 CLOSED at [date]

line.

The only problem I see is if you change the text but leave the FIXME,
in that case maybe the other thing is not CLOSED but it's just changed,
and we should remove the old and create a new entry.

What do you think, could that be a good idea?
Is there maybe a way to do it?

PS. sorry for the crossposting but here is more appropriate I guess



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


[Orgmode] Re: Repeating dates on named weekdays

2010-01-16 Thread Glauber Alex Dias Prado
William Halliburton  writes:

> Hello all, please excuse me if this is a FAQ, I can't seem to find any
> discussion on it.
kind of
>
> How can one enter in repeating dates such as
>
> every third thursday of each month
>
http://www.gnu.org/software/emacs/manual/html_node/org/Repeating-items.html#Repeating-items
http://orgmode.org/manual/Repeated-tasks.html#Repeated-tasks

> or
>
> the first and third wendsdays of each month
>
> ?
>
> Thank you very much.
> Will
> ___
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode







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


[Orgmode] Bug: Exporting commands with angle brackets [6.34a]

2010-01-16 Thread Bill Jackson

When exporting to LaTeX, curly brackets in a command will be escaped
if that command also contains angle brackets.  This can be a problem
when using beamer.  An example input file:



#+LaTeX_CLASS: beamer

* The One and Only Frame
  When LaTeX \alert<2>{commands} contain angle brackets, the curly
  brackets are erroneously escaped in the output.  \alert{Commands}
  that do not contain angle brackets work properly.



Typing C-c C-e l will generate the output file:



% Created 2010-01-15 Fri 13:57
\documentclass{beamer}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{soul}
\usepackage{amssymb}
\usepackage{hyperref}


\title{escCurly}
\author{}
\date{15 January 2010}

\begin{document}

\maketitle

\begin{frame}
\frametitle{Outline}
\setcounter{tocdepth}{3}
\tableofcontents
\end{frame}

\begin{frame}
\frametitle{The One and Only Frame}
\label{sec-1}

  When \LaTeX{} \alert<2>\{commands\} contain angle brackets, the curly
  brackets are erroneously escaped in the output.  \alert{Commands}
  that do not contain angle brackets work properly.
\end{frame}

\end{document}




Emacs  : GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600)
 of 2009-07-29 on SOFT-MJASON
Package: Org-mode version 6.34a

current state:
==
(setq
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-export-preprocess-hook '(org-export-blocks-preprocess)
 org-tab-first-hook '(org-hide-block-toggle-maybe)
 org-src-mode-hook '(org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-directory "O:/org"
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-export-preprocess-before-normalizing-links-hook 
'(org-remove-file-link-modifiers)

 org-mode-hook '(#[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook org-show-block-all
append local]
   5]
 )
 org-confirm-elisp-link-function 'yes-or-no-p
 org-occur-hook '(org-first-headline-recenter)
 org-export-preprocess-before-selecting-backend-code-hook 
'(org-beamer-select-beamer-code)

 org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc
   org-beamer-auto-fragile-frames
   org-beamer-place-default-actions-for-lists)
 )


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


[Orgmode] Bug: Inconsistency exporting \LaTeX and \TeX [6.34a]

2010-01-16 Thread Bill Jackson

When exporting to LaTeX, the commands \LaTeX and \TeX are not
processed consistently.  In particular, the backslash for \LaTeX is
escaped.  This might not be a bug, but it is a bit confusing.  An
example input file:



* The One and Only Header
  The command \LaTeX generates an escaped backslash, while \TeX and
  \alpha do not.  Note that LaTeX is converted to a command, while TeX
  is not.



Typing C-c C-e l will generate the output file:



% Created 2010-01-15 Fri 13:47
\documentclass[11pt]{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{soul}
\usepackage{amssymb}
\usepackage{hyperref}


\title{escLaTeX}
\author{}
\date{15 January 2010}

\begin{document}

\maketitle

\setcounter{tocdepth}{3}
\tableofcontents
\vspace*{1cm}
\section{The One and Only Header}
\label{sec-1}

  The command \\LaTeX{} generates an escaped backslash, while \TeX and
  $\alpha$ do not.  Note that \LaTeX{} is converted to a command, while TeX
  is not.

\end{document}




Emacs  : GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600)
 of 2009-07-29 on SOFT-MJASON
Package: Org-mode version 6.34a

current state:
==
(setq
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-export-preprocess-hook '(org-export-blocks-preprocess)
 org-tab-first-hook '(org-hide-block-toggle-maybe)
 org-src-mode-hook '(org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-directory "O:/org"
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-export-preprocess-before-normalizing-links-hook 
'(org-remove-file-link-modifiers)

 org-mode-hook '(#[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook org-show-block-all
append local]
   5]
 )
 org-confirm-elisp-link-function 'yes-or-no-p
 org-occur-hook '(org-first-headline-recenter)
 org-export-preprocess-before-selecting-backend-code-hook 
'(org-beamer-select-beamer-code)

 org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc
   org-beamer-auto-fragile-frames
   org-beamer-place-default-actions-for-lists)
 )


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


[Orgmode] [PATCH] Allow regexps in org-file-apps to capture link parameters using groups

2010-01-16 Thread Jan Böcker
What is this?
=

This patch changes the way extension regexps in `org-file-apps' are
handled. Instead of against the file name, the regexps are now matched
against the whole link, and you can use grouping to extract link
parameters which you can then use in a command string to be executed.

For example, to allow linking to PDF files using the syntax
file:/doc.pdf::, you can add the following entry to
org-file-apps:

Extension: \.pdf::\([0-9]+\)\'
Command:   evince "%s" -p %1

In a command string to be executed, the parameters can be referenced
using %1, %2, etc.  Lisp forms can access them using (string-match n link).


Where to get it?

Either apply the patch by hand or

git pull git://github.com/jboecker/org-mode.git org-file-apps-parameters


What's next? / Feedback
===

- Find the bugs. Since this messes with links, a central concept of Org,
I probably have missed some edge cases; so please test this and
report if it works for you.

I also appreciate any feedback on code quality or the design decisions
made. I am learning elisp along the way, so you may be able to write
some changes in a more idiomatic and/or elegant way.

- Add a mechanism for org-mode modules to add default values to
org-file-apps, similar to the variables org-file-apps-defaults-*.
This could be used by modules to define their own extensions to the
syntax of file: links.

- Modify org-docview.el to use this and deprecate the docview: link syntax.


What does it (intentionally) break?
===

This patch introduces a backwards-incompatible change. If LINE or SEARCH
is given, the file is no longer guaranteed to open in emacs: if IN-EMACS
is nil and an entry in org-file-apps matches, that takes precedence.

A grep of the lisp/ and contrib/ directories showed that no code in the
org-mode distribution was relying on this behaviour; whereever LINE or
SEARCH is given, IN-EMACS is also set to t.

I decided against adding an additional parameter because that would be
redundant; the original link as seen by org-open-at-point can be
reconstructed from PATH, LINE and SEARCH.

I am not that sure if this is the right way to do this, but it seems to
break as little as possible while hopefully avoiding to add too much
complexity.




---
 lisp/ChangeLog |   10 ++
 lisp/org.el|   56
+---
 2 files changed, 55 insertions(+), 11 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3f46f3c..c4605bd 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
+2010-01-16  Jan Böcker  
+
+   * org.el (org-open-file): Allow regular expressions in
+   org-file-apps to capture link parameters using groups.  In a
+   command string to be executed, the parameters can be referenced
+   using %1, %2, etc.  Lisp forms can access them using
+   (string-match n link).
+   (org-apps-regexp-alist): Adopt the created regexp, as this is now
+   matched against a file: link instead of the file name.
+
 2010-01-16  Carsten Dominik  

* org.el (org-link-unescape, org-link-escape): Only use hexlify if
diff --git a/lisp/org.el b/lisp/org.el
index ee81c4d..2351419 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -1463,7 +1463,7 @@ you can use this variable to set the application
for a given file
 extension.  The entries in this list are cons cells where the car
identifies
 files and the cdr the corresponding command.  Possible values for the
 file identifier are
- \"regex\" Regular expression matched against the file name.  For
backward
+ \"regex\" Regular expression matched against the file: link.  For
backward
compatibility, this can also be a string with only
alphanumeric
characters, which is then interpreted as an extension.
  `directory'   Matches a directory
@@ -1494,9 +1494,13 @@ Possible values for the command are:
does define this command, but you can overrule/replace it
here.
  stringA command to be executed by a shell; %s will be replaced
-   by the path to the file.
+   by the path to the file. If the file identifier is a regex,
+   %n will be replaced by the match of the nth
subexpression (group).
  sexp  A Lisp form which will be evaluated.  The file path will
-   be available in the Lisp variable `file'.
+   be available in the Lisp variable `file', the link itself
+   in the Lisp variable `link'. If the file identifier is a
regex,
+   the original match data will be restored, so
subexpression matches
+   are accessible using (match-string n link).
 For more examples, see the system specific constants
 `org-file-apps-defaults-macosx'
 `org-file-apps-defaults-windowsnt'
@@ -8935,10 +8939,12 @@ With a double C-c C-u prefix arg, Org tries to
avoid opening in Emacs
 and to use an external applicati

[Orgmode] icalendar: exporting times of day specified in heading?

2010-01-16 Thread Stephen Eglen
Hi,

I often use org-agenda-diary-entry to make simple entries into
an agenda.org file.  I see that the agenda is clever enough to recognise
if a time range has been typed into the heading.  However, this time
range is not exported by the icalendar code.

Here's a simple example, independent of org-agenda-diary-entry, although
in reality, example 2 would be the type of entry I normally make.

if I have a test.org file containing:
--
* <2010-01-16 Sat 08:00-08:30> example 1

* <2010-01-16 Sat> example 2 09:00-09:30
--

then when I view the agenda I see:

Saturday   16 January 2010
  test:8:00- 8:30 example 1
   8:00.. 
  test:9:00- 9:30  example 2 
  10:00.. 

[There's an extra space before 'example 2', which I'm not sure about.]

So far, so good - the agenda has parsed 09:00-09:30 from the headline.
But now if I make an ics file (e.g. by 'C-c C-e i' in test.org) the
start and end time of the event are not recognised.  Here's a relevant
snippet from test.ics:

BEGIN:VCALENDAR
...
DTSTART:20100116T08
DTEND:20100116T083000
SUMMARY: example 1
CATEGORIES:test
...
DTSTART;VALUE=DATE:20100116
DTEND;VALUE=DATE:20100117
SUMMARY: example 2 09:00-09:30

What I *think* I'd like is that for the 2nd calendar entry is

DTSTART:20100116T0900
DTEND:20100116T0930

Is that sensible/possible?  Alternatively, how about
org-agenda-diary-entry parsing the time specification and writing the
date and time within angle brackets?

(org-version)
"Org-mode version 6.33trans (release_6.33f.22.gcb8ce.dirty)"

Thanks, Stephen




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