[O] "Recent items" Agenda view?

2013-10-11 Thread Martin Beck
Hi,

I'm often having the problem that I want to quickly attach an information to
an item I've created or I've been working on during the last days and then
have to invoke a keyword search.

How could I create an agenda with a list of headlines which have any
timestamp in the last 7 days (as they were created, clocked, changed their
status etc.?), sorted by the most recent timestamp?

Thanks a lot,
kind regards

Martin





Re: [O] [BUG?] Compilation failure with Emacs 24.3.50.1 (trunk) on 'ox-publish' (Multiple args to , are not supported)

2013-10-11 Thread Vladimir Lomov
Hello,
** Vladimir Lomov [2013-10-10 16:15:27 +0900]:

> Hello,
> topic title states my problem completely, some details:
> - I use emacs compiled from bzr trunk (revno 114606) on my system:
>   Archlinux x86_64 with gcc 4.8.1 and make 4.0;
> - org-mode: 8.2.1-86-gbe3dad.

> This is excert from make log:
> #+BEGIN_EXAMPLE
> ...
> Compiling
> /home/vladimir/buildpkg/emacs-org-mode/src/org-mode/lisp/ox-publish.el...

> In toplevel form:
> ox-publish.el:887:1:Error: Multiple args to , are not supported: (\, (\`
> (when (quote (\, force)) (org-publish-remove-all-timestamps))) (\` (let
> ((org-publish-use-timestamps-flag (if (quote (\, force)) nil (\,
> org-publish-use-timestamps-flag (org-publish-projects (quote (\,
> org-publish-project-alist))
> ...
> #+END_EXAMPLE

I have found the reason of such behaviour: commit 114570 of Emacs
repository introduced this, below diff between 114569 and 114570:
-- 8< --
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog  2013-10-08 03:48:01 +
+++ lisp/ChangeLog  2013-10-08 04:30:31 +
@@ -1,5 +1,8 @@
 2013-10-08  Stefan Monnier  
 
+   * emacs-lisp/backquote.el (backquote-process): Catch uses of , and ,@
+   with more than one argument (bug#15538).
+
* mpc.el (mpc-songs-jump-to): Adjust to different playlist format.
 
* vc/pcvs.el: Use lexical-binding.

=== modified file 'lisp/emacs-lisp/backquote.el'
--- lisp/emacs-lisp/backquote.el2013-01-01 09:11:05 +
+++ lisp/emacs-lisp/backquote.el2013-10-08 04:30:31 +
@@ -153,11 +153,18 @@
  (list 'quote s
((eq (car s) backquote-unquote-symbol)
 (if (<= level 0)
-(cons 1 (nth 1 s))
+(if (> (length s) 2)
+;; We could support it with: (cons 2 `(list . ,(cdr s)))
+;; But let's not encourage such uses.
+(error "Multiple args to , are not supported: %S" s)
+  (cons 1 (nth 1 s)))
   (backquote-delay-process s (1- level
((eq (car s) backquote-splice-symbol)
 (if (<= level 0)
-(cons 2 (nth 1 s))
+(if (> (length s) 2)
+;; (cons 2 `(append . ,(cdr s)))
+(error "Multiple args to ,@ are not supported: %S" s)
+  (cons 2 (nth 1 s)))
   (backquote-delay-process s (1- level
((eq (car s) backquote-backquote-symbol)
   (backquote-delay-process s (1+ level)))

-- 8< --


So, I don't know whom to blame for this behaviour.

P.S. I also noted other strange thing in function 'org-publish-all':
there two almost identical lines in that function:
-- 8< --
  (when force (org-publish-remove-all-timestamps))
-- 8< --
but first is run with backquote. Earlier I found out that commenting
line with backquote solves the problem.

---
WBR, Vladimir Lomov

-- 
 i'd solve a windows key problem with fdisk :)



Re: [O] [BUG?] Strange message in minibuffer while exporting into HTML

2013-10-11 Thread Sebastien Vauban
Hello Vladimir,

Vladimir Lomov wrote:
> please consider this sample Org document (ex-call.org):
>
> #+TITLE: Example with CALL directive
> #+AUTHOR: Vladimir Lomov
> #+OPTIONS: num:nil
>
> * This is first section
>
> Recently I faced with a strange message in minibuffer:
> #+BEGIN_EXAMPLE
> Marker points into wrong buffer: #
> #+END_EXAMPLE
> when exporting the Org document into HTML.
>
> At first I was puzzled what causes this message in that particular Org
> document, while rest my Org documents are exported to HTML just fine.
>
> After a while I tried to strip down that document to figure out what
> may cause that message. And seems that problem is in CALL strings.
>
> In that particural document I have several CALL directive, commenting
> out them (just added a ~#~ at beginning of a line with a space after
> it) allows me to export that document into HTML.
>
> The purpose of this example document to ensure that even simple CALL
> line could cause such behaviour.
>
> This is CALL directive, it calls function defined below
> #+CALL: simple-func()
>
> Even without evaluation of this directive exporting into HTML fails
> with above message.
>
> Commenting that directive make it possible to export into HTML.
>
> Another attempt:
> #+CALL: simple-func(name="Vladimir Lomov")
>
> * The simple Emacs Lisp function
>
> This simple Emacs Lisp function has to be called by CALL directive:
> #+NAME: simple-func
> #+BEGIN_SRC emacs-lisp :var name="My name"
>   (format "[You told me:] %S" name)
> #+END_SRC
>
> My system:
> - Archlinux x86_64, gcc 4.8.1, make 4.0
> - emacs: GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.0) 
> of 2013-10-10 on smoon4
>   (compile from bzr trunk, revno 114606)
> - org-mode: Org-mode version 8.2.1 (release_8.2.1-77-g8aaf3c @ 
> /usr/share/emacs/site-lisp/org/)
>
> I have typed above document in Emacs run as
> emacs -Q -l min-org.el --eval "(require 'ox-html)" ex-call.org
>
> Is this really a bug or my misunderstanding of 'CALL' directive usage?

I confirm the problem on my Windows environment:

- GNU Emacs 24.3.50.1 (i686-pc-mingw32) of 2013-09-30 on LEG570
- Org-mode version 8.1.1 (release_8.1.1-13-ga1f9a1)

... and I don't see any problem with your syntax. I'm as puzzled as you are.

Would you wanna help, I think trying to bisect Org mode would be a great step
into fixing what I think to be a problem in Org.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] org-grep, and problems

2013-10-11 Thread Suvayu Ali
Hi François,

On Thu, Oct 10, 2013 at 09:14:57PM -0400, François Pinard wrote:
> Suvayu Ali  writes:
> 
> > No matter what I search for, I get 0 results!  My org-directory points
> > to the correct location: ~/org.  Not sure what is wrong.
> 
> Annoying!  I just tried resetting org-grep-directories to nil here, as a
> way to force the default of org-directory, and it works well for me.
> 
> Would you happen to be using Windows?  I only tried it on Linux.  It
> surely depend on "find" and "grep" being system commands.  (And I should
> document that.)

I'm on Linux.

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] org-debbugs.el

2013-10-11 Thread Michael Albinus


Michael Albinus  writes:

Hi,

> If the org-mode maintainers find this package useful, it could be added
> to the contrib directory.

Still no response from the maintainers. Before I continue to invest into
this package, I would like to know whether it is a suitable
approach. Otherwise, I could spend my time better.

Best regards, Michael.




[O] [PATCH] Add catch-up all LaTeX errors

2013-10-11 Thread Francesco Pizzolante
Hi,

This is not a definitive patch. It's just a first step in getting a better one.

The issue is the fact that, when exporting to PDF, in some cases, Org tells
that the export has been done successfully while the PDF file has not been
produced!

As an example, if you open the target PDF file with Adobe Reader and, in the
meantime, you export your Org file again to PDF, you'll see that Org will tell
you it's OK (Process Completed) while, if you look at the *Org PDF LaTeX
Output* buffer, you'll see an error such as:

--8<---cut here---start->8---
! I can't write on file `toto.pdf'.
[...]
--8<---cut here---end--->8---

The problem comes from the fact that Org just checks for a couple of error
messages (defined in org-latex-known-errors) and report it's OK if it doesn't
find those messages:

--8<---cut here---start->8---
(defcustom org-latex-known-errors
  '(("Reference.*?undefined" .  "[undefined reference]")
("Citation.*?undefined" .  "[undefined citation]")
("Undefined control sequence" .  "[undefined control sequence]")
("^! LaTeX.*?Error" .  "[LaTeX error]")
("^! Package.*?Error" .  "[package error]")
("Runaway argument" .  "Runaway argument"))
[...]
--8<---cut here---end--->8---

In order to be sure to check for ALL errors, we should check for any line
beginning with '!' (http://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings).
That's the idea of this patch.

Though, the issue with this patch is that some error can match 2 messages, and
you get the following display:

--8<---cut here---start->8---
Process completed with errors: [LaTeX error] [Unknown error]
--8<---cut here---end--->8---

To this issue, I see 2 solutions:

1. Either catch all errors with a single regexp (and remove all other regexps):

--8<---cut here---start->8---
(defcustom org-latex-known-errors
  '(("^!.*" .  "LaTeX error"))
[...]
--8<---cut here---end--->8---

2. Stop on the first error found and report it.

In all cases, it would be much better to be able to report the error line such
as:

--8<---cut here---start->8---
Process completed with errors: [! I can't write on file `toto.pdf'.]
--8<---cut here---end--->8---

Can someone do this or help me to achieve it?

Best regards,
 Francesco

---
 lisp/ox-latex.el |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 9262ded..2cffe38 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -862,7 +862,8 @@ logfiles to remove, set `org-latex-logfiles-extensions'."
 ("Undefined control sequence" .  "[undefined control sequence]")
 ("^! LaTeX.*?Error" .  "[LaTeX error]")
 ("^! Package.*?Error" .  "[package error]")
-("Runaway argument" .  "Runaway argument"))
+("Runaway argument" .  "Runaway argument")
+("^!.*" . "[Unknown error]"))
   "Alist of regular expressions and associated messages for the user.
 The regular expressions are used to find possible errors in the
 log of a latex-run."
--
1.7.9



Re: [O] org-mode based groupware wiki

2013-10-11 Thread Torsten Wagner
Hi Eric,

still trying to figure out whats wrong with my set-up. Did you had time to
look intio it.
It seems somehow elnode does not play well anymore with the current version
of ehtml.
Or something like this.
I can access elnodes standard services and I can create new services like
described in the elnode wiki.
However, following the README of ehtml. I receive the early posted error
message. This is not an emacs-based error or any sort of crash. It seems to
be something which is "well" handled by elnodes error catching.

Would be glad if you could give us some advice how to deal with that or how
to test further. We are in the middle of setting up a groupware wiki. Two
of us are org-mode users and the others do not really care what
markup-language that might have to use. Thus, it gives us the comfort to
stick with org-mode and we only have to decide to go the ehtml/emacs way or
the gollum/org-ruby way. Even more luckily this is not a decision forever,
since the files remain to be native org-files on both systems, I believe we
could switch at anytime.
This is again a nice example of the pure text based org-mode paradigm.

Thanks

Torsten


On 7 October 2013 17:02, Torsten Wagner  wrote:

> Hi Eric,
>
> thanks for the email. I will give org-ehtml a try. Do you still actively
> maintain it. We would rely rather heavily on it ( a group of about 10
> people) and I would be happy to know that I do not ride a dead horse. On
> the other hand you get a bunch of beta-testers ;)
>
> Could you agree with the following comparison:
>
> * gollum
> - standalone application, based on git and org-ruby.
> - can use different makeup-languages
> - can be integrated in a larger environment (read something about using
> Apache Webserver)
> - enables the creation and editing of pages via webbrowser (a minimal
> org-mode editor is available)
> - basic settings of the theme (top, footer, sidebar).
>
> * org-ehtml
> - part of org-mode requires emacs and elnode
> - makes use of the new exporter
> - ...
>
> ... because I tried to give it a test but it did not work out.
> I tried a test instance via the following commands (and its outputs)
>
> (ert "org-ehtml")
> ->
> Selector: "org-ehtml"
> Passed: 0
> Failed: 0
> Total:  0/0
>
> Started at:   2013-10-07 16:44:00+0200
> Finished.
> Finished at:  2013-10-07 16:44:00+0200
>
> (setq org-ehtml-docroot "/home/torsten/test-wiki/")
> ->
> "/home/torsten/test-wiki/"
>
> (elnode-start 'org-ehtml-handler :port )
> ->
> (( . #))
>
> When I start it according to the README, all I get when calling
> http://localhost:/simple.org is:
>
> Server error
>
> No errors are given in any log-buffer I could find.
>
> Not sure where the problem appears. A test of elnode according to the
> elnode README worked out ok
>
> (defun my-test-handler (httpcon)
>   "Demonstration function"
>   (elnode-http-start httpcon 200 '("Content-type" . "text/html"))
>   (elnode-http-return httpcon "HELLO!"))
>
> (elnode-start 'my-test-handler :port 8010 :host "localhost")
>
>
> Might it be, that the elnode API changed and that the handler function
> need some rewrite?
>
> All the best
>
> Torsten
>
>
>
> On 4 October 2013 16:03, Eric Schulte  wrote:
>
>> Check out org-ehtml.  See the original announcement [1] and the repo on
>> github [2].  It might need some attention as the Org-mode export API is
>> constantly in flux, but it does work to allow editing of Org-mode pages
>> through a web page.
>>
>> Cheers,
>>
>> Footnotes:
>> [1]  http://thread.gmane.org/gmane.emacs.orgmode/58773/focus=58884
>>
>> [2]  https://github.com/eschulte/org-ehtml
>>
>> --
>> Eric Schulte
>> https://cs.unm.edu/~eschulte
>> PGP: 0x614CA05D
>>
>
>


Re: [O] [BUG?] Strange message in minibuffer while exporting into HTML

2013-10-11 Thread Vladimir Lomov
Hello,
** Sebastien Vauban [2013-10-11 09:32:12 +0200]:

> Hello Vladimir,

[...]

> I confirm the problem on my Windows environment:

> - GNU Emacs 24.3.50.1 (i686-pc-mingw32) of 2013-09-30 on LEG570
> - Org-mode version 8.1.1 (release_8.1.1-13-ga1f9a1)

> ... and I don't see any problem with your syntax. I'm as puzzled as you are.

> Would you wanna help, I think trying to bisect Org mode would be a great step
> into fixing what I think to be a problem in Org.

Hm, this is my the best approach to "debug":
1. in all cases I run emacs like
   #+BEGIN_EXAMPLE
 emacs -Q --eval "(add-to-list 'load-path \"~/tmp/org-mode\")" --eval 
"(require 'org)" --eval "(require 'ox-html)" ex-call2.org
   #+END_EXAMPLE
2. this is the file 'ex-call2.org':
   #+BEGIN_SRC org
 ,* This is title of first section
 
 Call me:
 ,#+CALL: simp-func()

 ,* Function definition

 ,#+NAME: simp-func()
 ,#+BEGIN_SRC emacs-lisp :var name="My name is..."
   (format "[You passed data] %S" name)
 ,#+END_SRC
   #+END_SRC
3. before run 'C-c C-e h h' (export into HTML) I run ~M-x org-version~
   to ensure what version I run;
4. I started from releases: 8.2.1, 8.2... 8.0 and found that in all
   release begins with 8.1 I see mentioned message, but in releases
   8.0.6 and 8.0.7 there is another message:
   #+BEGIN_QUOTE
 Reference 'simp-func' not found in this buffer
   #+END_QUOTE
   so I decided to find out which commit changed this message.
5. I did: =git bisect release_8.1 release_8.0.7= and after some steps I
   got:
   #+BEGIN_EXAMPLE
 685b2967247597f75d22cb77896bc8a70503b2c3 is the first bad commit
 commit 685b2967247597f75d22cb77896bc8a70503b2c3
 Author: Eric Schulte 
 Date:   Tue Jun 25 07:55:32 2013 -0600

 evaluate elisp header args at original call site

 * lisp/ob-core.el (org-babel-execute-src-block): Ensure that the
   location is set before anything else is done.
 * lisp/ob-ref.el (org-babel-ref-parse): Evaluate Emacs Lisp values in
   header arguments at the location of the original code block.
 * testing/lisp/test-ob.el (test-ob/location-of-header-arg-eval): Test
   defending the new header argument evaluation behavior.

 :04 04 9e11b15cf73c6a0a9856f2a3393f27419e251f14 
b106e079f13673e440c391bcb6a1e6dddb4994ed M lisp
 :04 04 3935206e2970ec1f338a8b5524906a6d32e58d0e 
19f36ce174bbfcd58f6e2bad5313d2de7cdc43c7 M testing
   #+END_EXAMPLE

I have to stop here because I don't know Emacs Lisp and org-mode
internals to debug further.

---
WBR, Vladimir Lomov

-- 
 solaris is bsd, so it should work
* Espy takes wichert's crack pipe away



[O] LaTeX math mode and export

2013-10-11 Thread Fabrice Popineau
Hi,

The status of when warious LaTeX related markers are escaped or not has
moved over time, but the situation reached is still not very clear.

If I do the following test with yesterday's git org-mode :

#+LaTeX_CLASS: article
#+OPTIONS: H:2 <:nil toc:nil
* Test
[2013-10-11 ven. 10:45]
** Subsection
[2013-10-11 ven. 10:46]

 Let blah blah blah ...
  \[ \tilde{\delta}(q, w) = \left\{\begin{array}{ll}
  q & \text{ si }  w = \epsilon \\ \delta(\tilde{\delta}(q,w'),a) &
\text{ si } w = w'a \text{ et } a \in \Sigma
\end{array}\right. \]
** Subsection
[2013-10-11 ven. 10:48]

 Let blah blah blah ...
\[\begin{array}{c}
  \begin{array}{|c|c|c|}
\hline
\delta_{1} & 0 &  1 \\
\hline
p & \{p, q\} & \{q\} \\
\hline
q & \{r\} & \{q, r\} \\
\hline
r & \{s\} & \{p\} \\
\hline
s & \{s\} & \{p\} \\
\hline
  \end{array}
\]

The first \[ is left as-is but the second one is translated
into $\backslash$[ which is obviously weird.

Moreover Mathjax being able to interpret this, it should be better if these
equations where all left as-is in the text for both html and latex
exporters. Unless there is something I can't see that prevents to do it?

I have two other examples of the same kind of problem:

1- Same thing with \( ... \) instead of \[ ...\] :

** Subsection
[2013-10-11 ven. 11:05]

- \(\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. \)

I ended up in surrounding the second item text into #+begin_latex ...
#+end_latex.

2 - Quoting of {} may also happen in unwanted places. If I write a complex
author line like :

#+AUTHOR: \IEEEauthorblockN{Foo, Bar} \IEEEauthorblockA{ Somewhere\\ Over
the Rainbow \\ Email: \{foo,bar\}@baz.fr } \and \IEEEauthorblockN{foobar}
\IEEEauthorblockA{somewhere else \\ Email: foo...@baz.fr}

I get with the latex export :

\author{\IEEEauthorblockN{Foo, Bar} \IEEEauthorblockA\{ Somewhere\\ Over
the Rainbow \\ Email: \{foo,bar\}@baz.fr \} \and \IEEEauthorblockN{foobar}
\IEEEauthorblockA{somewhere else \\ Email: foo...@baz.fr}}

It seems impossible to avoid that the curly braces of \IEEEauthorblockA be
left as-is.

I guess all of this is about tweaking regular expressions, but I'm afraid I
won't be aware of other side effects.
I would be glad to whoever can offer a better handling of these situations.

Another related question also : did anybody managed to hilghlight LaTeX
equations inside org-mode ?
It could be very helpful to detect missing end markers.

Thanks for your work on Org mode and for you help :-)

-- 
Fabrice Popineau
-
SUPELEC
Département Informatique
3, rue Joliot Curie
91192 Gif/Yvette Cedex
Tel direct : +33 (0) 169851950
Standard : +33 (0) 169851212
--


Re: [O] [BUG?] Strange message in minibuffer while exporting into HTML

2013-10-11 Thread Eric S Fraga
Vladimir Lomov  writes:

> Hello,
> please consider this sample Org document (ex-call.org):

[...]

> Recently I faced with a strange message in minibuffer:
> #+BEGIN_EXAMPLE
> Marker points into wrong buffer: #
> #+END_EXAMPLE
> when exporting the Org document into HTML.

[...]

I think this might be a is the same problem I posted about a couple of days 
ago, a
problem that affects both #+call: and call_ invocations of babel blocks.

When I try your file, exporting to either HTML or LaTeX, I get the same
error.  I am using the latest emacs snapshot.

What is interesting is that if I save your file as t.org, extra buffers
named t.org<2> and t.org<2><2> are created after having done two export
attempts.  Do either of these appear for you?

By the way, what version of Emacs are you using?

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.2.1-86-gbe3dad




Re: [O] org-debbugs.el

2013-10-11 Thread Suvayu Ali
Hi Michael,

On Fri, Oct 11, 2013 at 10:03:34AM +0200, Michael Albinus wrote:
> 
> 
> Michael Albinus  writes:
> 
> Hi,
> 
> > If the org-mode maintainers find this package useful, it could be added
> > to the contrib directory.
> 
> Still no response from the maintainers. Before I continue to invest into
> this package, I would like to know whether it is a suitable
> approach. Otherwise, I could spend my time better.

I'm CC'ing the maintainers, maybe they have missed the thread amidst all
the traffic.  FWIW, I think this is a wonderful package.  I have your
patches applied on my private Org repository.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.



[O] [BUG?] Additional warning period in timestamp affects parsing

2013-10-11 Thread Thorsten Jolitz

Hi List, 

with tmp.org

#+begin_src org
* A
  DEADLINE: <2013-10-11 Fr 06:33 +1m -3d>

txt A

* B
  DEADLINE: <2013-10-11 Fr 22:00 +1m>

txt B
#+end_src

calling `org-element-parse-buffer' results in the following parse-tree

#+begin_src emacs-lisp
  (org-data nil (headline (:raw-value "A" :begin 1 :end 55 :pre-blank 0 :hiddenp
  nil :contents-begin 5 :contents-end 54 :level 1 :priority nil :tags nil
  :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil
  :archivedp nil :commentedp nil :quotedp nil :deadline (timestamp (:type active
  :raw-value "<2013-10-11 Fr 06:33 +1m -3d>" :year-start 2013 :month-start 10
  :day-start 11 :hour-start 6 :minute-start 33 :year-end 2013 :month-end 10
  :day-end 11 :hour-end 6 :minute-end 33 :begin 17 :end 46 :post-blank 0))
  :CATEGORY "timestmp" :title (#("A" 0 1 (:parent #1))) :parent #0) (section
  (:begin 5 :end 55 :contents-begin 5 :contents-end 54 :post-blank 1 :parent #1)
  (planning (:closed nil :deadline (timestamp (:type active :raw-value
  "<2013-10-11 Fr 06:33 +1m -3d>" :year-start 2013 :month-start 10 :day-start 11
  :hour-start 6 :minute-start 33 :year-end 2013 :month-end 10 :day-end 11
  :hour-end 6 :minute-end 33 :begin 17 :end 46 :post-blank 0)) :scheduled nil
  :begin 5 :end 48 :post-blank 1 :parent #2)) (paragraph (:begin 48 :end 54
  :contents-begin 48 :contents-end 54 :post-blank 0 :post-affiliated 48 :parent
  #2) #("txt A " 0 6 (:parent #3) (headline (:raw-value "B" :begin 55 :end
  104 :pre-blank 0 :hiddenp nil :contents-begin 59 :contents-end 104 :level 1
  :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0
  :footnote-section-p nil :archivedp nil :commentedp nil :quotedp nil :deadline
  (timestamp (:type active :raw-value "<2013-10-11 Fr 22:00 +1m>" :year-start
  2013 :month-start 10 :day-start 11 :hour-start 22 :minute-start 0 :year-end
  2013 :month-end 10 :day-end 11 :hour-end 22 :minute-end 0 :begin 71 :end 96
  :post-blank 0 :repeater-type cumulate :repeater-value 1 :repeater-unit month))
  :CATEGORY nil :title (#("B" 0 1 (:parent #1))) :parent #0) (section (:begin 59
  :end 104 :contents-begin 59 :contents-end 104 :post-blank 0 :parent #1)
  (planning (:closed nil :deadline (timestamp (:type active :raw-value
  "<2013-10-11 Fr 22:00 +1m>" :year-start 2013 :month-start 10 :day-start 11
  :hour-start 22 :minute-start 0 :year-end 2013 :month-end 10 :day-end 11
  :hour-end 22 :minute-end 0 :begin 71 :end 96 :post-blank 0 :repeater-type
  cumulate :repeater-value 1 :repeater-unit month)) :scheduled nil :begin 59
  :end 98 :post-blank 1 :parent #2)) (paragraph (:begin 98 :end 104
  :contents-begin 98 :contents-end 104 :post-blank 0 :post-affiliated 98 :parent
  #2) #("txt B " 0 6 (:parent #3))
#+end_src

Note the two different deadline timestamps:

#+begin_src emacs-lisp
  (:deadline (timestamp (:type active :raw-value "<2013-10-11 Fr
  06:33 +1m -3d>" :year-start 2013 :month-start 10 :day-start 11
   :hour-start 6 :minute-start 33 :year-end 2013 :month-end
   10 :day-end 11 :hour-end 6 :minute-end 33 :begin 17 :end
   46 :post-blank 0)))
#+end_src

and 

#+begin_src emacs-lisp
  (:deadline (timestamp (:type active :raw-value "<2013-10-11 Fr
  22:00 +1m>" :year-start 2013 :month-start 10 :day-start
  11 :hour-start 22 :minute-start 0 :year-end 2013 :month-end
  10 :day-end 11 :hour-end 22 :minute-end 0 :begin 71 :end
  96 :post-blank 0 :repeater-type cumulate :repeater-value
  1 :repeater-unit month)))
#+end_src

It looks as if the combination of repeater *and* special warning period
prevents the parsing of both of them.

-- 
cheers,
Thorsten




Re: [O] [BUG?] Strange message in minibuffer while exporting into HTML

2013-10-11 Thread Vladimir Lomov
Hello,
** Eric S Fraga [2013-10-11 08:45:09 +0100]:

> Vladimir Lomov  writes:

>> Hello,
>> please consider this sample Org document (ex-call.org):

> [...]

>> Recently I faced with a strange message in minibuffer:
>> #+BEGIN_EXAMPLE
>> Marker points into wrong buffer: #
>> #+END_EXAMPLE
>> when exporting the Org document into HTML.

> [...]

> I think this might be a is the same problem I posted about a couple of days 
> ago, a
> problem that affects both #+call: and call_ invocations of babel blocks.

> When I try your file, exporting to either HTML or LaTeX, I get the same
> error.  I am using the latest emacs snapshot.

> What is interesting is that if I save your file as t.org, extra buffers
> named t.org<2> and t.org<2><2> are created after having done two export
> attempts.  Do either of these appear for you?

No, I think because export function fails so it can't produce any buffer.

> By the way, what version of Emacs are you using?

Emacs compile from bzr repository (currently this is 114588).

---
WBR, Vladimir Lomov

-- 
"For three days after death hair and fingernails continue to grow but
phone calls taper off."
-- Johnny Carson



Re: [O] org-debbugs.el

2013-10-11 Thread Nicolas Richard


Michael Albinus  writes:

> Michael Albinus  writes:
>
> Hi,
>
>> If the org-mode maintainers find this package useful, it could be added
>> to the contrib directory.
>
> Still no response from the maintainers. Before I continue to invest into
> this package, I would like to know whether it is a suitable
> approach. Otherwise, I could spend my time better.

Hello Michael,
 
While trying your package, I noticed that C-h m would not work because
of a misplaced docstring. Here's the patch (but I'm not sure I have the
latest version, sorry if this is already fixed).

Also, I heard recently on #org-mode about bugpile, which is an old (last
updated more than a year ago) of Thorsten Jolitz and Eric Schulte. The
doc says:
,
|  The Bugpile project has two goals:
| 
| Develop a bugtracker (called Bugpile) for GNU Emacs Org-mode,
| using Elisp, Elnode, Org-mode, and a dVCS.
| As part of the engineering process, abstract out a web-framework
| (iOrg) based on these GNU Emacs technologies.
` Source:
http://orgmode.org/worg/org-contrib/gsoc2012/student-projects/bugpile/

Unfortunately I did not find any usable documentation in the project
(README is empty) and I have no idea how/if it can be related to
org-debbugs in any way.

diff --git a/contrib/lisp/org-debbugs.el b/contrib/lisp/org-debbugs.el
index 9c31b2b..fe5430e 100644
--- a/contrib/lisp/org-debbugs.el
+++ b/contrib/lisp/org-debbugs.el
@@ -409,11 +409,11 @@ returned."
  hits))
 
 (defconst org-debbugs-mode-map
-  "Keymap for the `org-debbugs-mode' minor mode."
   (let ((map (make-sparse-keymap)))
 (define-key map (kbd "C-c # c") 'debbugs-gnu-send-control-message)
 (define-key map (kbd "C-c # d") 'debbugs-gnu-display-status)
-map))
+map)
+  "Keymap for the `org-debbugs-mode' minor mode.")

-- 
Nico.




Re: [O] org-debbugs.el

2013-10-11 Thread Thorsten Jolitz
Nicolas Richard  writes:

> Also, I heard recently on #org-mode about bugpile, which is an old (last
> updated more than a year ago) of Thorsten Jolitz and Eric Schulte. The
> doc says:

This wasn't implemented, unfortunately, but stay tuned ... its somehow
still in the pipeline.

-- 
cheers,
Thorsten




Re: [O] org-debbugs.el

2013-10-11 Thread Suvayu Ali
On Fri, Oct 11, 2013 at 01:55:56PM +0200, Nicolas Richard wrote:
> 
> Also, I heard recently on #org-mode about bugpile, which is an old (last
> updated more than a year ago) of Thorsten Jolitz and Eric Schulte. The
> doc says:
> ,
> |  The Bugpile project has two goals:
> | 
> | Develop a bugtracker (called Bugpile) for GNU Emacs Org-mode,
> | using Elisp, Elnode, Org-mode, and a dVCS.
> | As part of the engineering process, abstract out a web-framework
> | (iOrg) based on these GNU Emacs technologies.
> ` Source:
> http://orgmode.org/worg/org-contrib/gsoc2012/student-projects/bugpile/
> 
> Unfortunately I did not find any usable documentation in the project
> (README is empty) and I have no idea how/if it can be related to
> org-debbugs in any way.

As far as I recall, bugpile was a completely separate implementation of
a bug tracker.  Nothing to do with any existing ones.

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] org-debbugs.el

2013-10-11 Thread Michael Albinus


Nicolas Richard  writes:

> Hello Michael,

Hi Nicolas,

> While trying your package, I noticed that C-h m would not work because
> of a misplaced docstring. Here's the patch (but I'm not sure I have the
> latest version, sorry if this is already fixed).

Thanks. I've submitted a similar patch some days ago.

> Also, I heard recently on #org-mode about bugpile, which is an old (last
> updated more than a year ago) of Thorsten Jolitz and Eric Schulte. The
> doc says:
> ,
> |  The Bugpile project has two goals:
> | 
> | Develop a bugtracker (called Bugpile) for GNU Emacs Org-mode,
> | using Elisp, Elnode, Org-mode, and a dVCS.
> | As part of the engineering process, abstract out a web-framework
> | (iOrg) based on these GNU Emacs technologies.
> ` Source:
> http://orgmode.org/worg/org-contrib/gsoc2012/student-projects/bugpile/

No idea about the status either. However, org-debbugs has the advantage
to access Emacs' bug tracking system, which is not listed above. I
expect org related bugs arriving not only via `org-submit-bug-report',
but also via `report-emacs-bug'.

Anyway, if the org maintainers decide for another bug tracking system
but debbugs, it would also be OK for me. It just decreases the priority
of that package for me.

Best regards, Michael.




[O] [HTML export] How to display images side by side?

2013-10-11 Thread Alan Schmitt
Hello,

I'm trying to display a bunch of images side by side, as if they were
text (and would reflow when the window is too small). Following this
advice
http://stackoverflow.com/questions/12923124/tables-in-a-row-or-table-and-image-in-a-row-in-org-mode
I tried this (translated to the new exporter)

--8<---cut here---start->8---
#+attr_html: :style display:inline; :height 60px
[[http://www.google.com/][file:images/Google_Logo.png]]
#+attr_html: :style display:inline; :height 70px
[[http://www.janestreet.com/][file:images/Jane_Street_Logo.jpeg]]
#+attr_html: :style display:inline; :height 50px
[[https://research.microsoft.com/][file:images/MSR_Logo.jpg]]
--8<---cut here---end--->8---

Unfortunately, I don't get what I want. There is an extra "div" and a
"p" around the images, which prevent them from being inline:

#+begin_src html

http://www.google.com/"; style="display:inline;" height="60px">




http://www.janestreet.com/"; style="display:inline;" 
height="70px">




https://research.microsoft.com/"; style="display:inline;" 
height="50px">

#+end_src

What I want is simply:

#+begin_src html
http://www.google.com/";>
http://www.janestreet.com/";>
https://research.microsoft.com/";>
#+end_src

I guess my problem comes from using the new exporter, but I could not
find how to do this: only apply the attr_html to the image part, and do
not generate an extra "p" around the image. Any suggestion as how I
could do it?

Thanks,

Alan



Re: [O] [HTML export] How to display images side by side?

2013-10-11 Thread Alan Schmitt
Hello again,

alan.schm...@polytechnique.org writes:

> Hello,
>
> I'm trying to display a bunch of images side by side, as if they were
> text (and would reflow when the window is too small).

I found a way to do it using CSS. Here is the org file that is exported
to html (note that I no longer have the style attribute, and I give the
surrounding node to give the context assigning the class).

--8<---cut here---start->8---
** Sponsors
  :PROPERTIES:
  :HTML_CONTAINER_CLASS: sponsors
  :END:

The workshop is kindly sponsored by:

#+attr_html: :height 60px
[[http://www.google.com/][file:images/Google_Logo.png]]

#+attr_html: :height 70px
[[http://www.janestreet.com/][file:images/Jane_Street_Logo.jpeg]]

#+attr_html: :height 50px
[[https://research.microsoft.com/][file:images/MSR_Logo.jpg]]
--8<---cut here---end--->8---

To get the alignment working properly (with images aligned at the
center), I then put the following in my style.css:

#+begin_src css
.sponsors .figure {
display: inline;
}

.sponsors .figure p {
display: inline;
}

.sponsors .figure img {
vertical-align: middle;
}
#+end_src

If you simply want a vertical list of images, you can simply override
the setting for .figure p:

#+begin_src css
.sponsors .figure p {
text-align: left;
}
#+end_src

Alan



[O] How to display the image for links whose description is an image?

2013-10-11 Thread Alan Schmitt
Hello,

Is there a way to display images for links whose description is an
image? If I have a link of the form:

--8<---cut here---start->8---
[[http://www.google.com/][file:images/Google_Logo.png]]
--8<---cut here---end--->8---

and when I try to "org-display-inline-images" on it, it tells me there
is no image to display.

Thanks,

Alan



Re: [O] LaTeX math mode and export

2013-10-11 Thread Nicolas Goaziou
Hello,

Fabrice Popineau  writes:

> \[\begin{array}{c}
>   \begin{array}{|c|c|c|}
> \hline
> \delta_{1} & 0 &  1 \\
> \hline
> p & \{p, q\} & \{q\} \\
> \hline
> q & \{r\} & \{q, r\} \\
> \hline
> r & \{s\} & \{p\} \\
> \hline
> s & \{s\} & \{p\} \\
> \hline
>   \end{array}
> \]

This isn't correct syntax: "\begin{array}{|c|c|c|}...\end{array}" is
parsed as a latex environment, so it breaks the paragraph you started
the line before. You can use "\begin{equation}" instead of "\[".

> - \(\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.

> 2 - Quoting of {} may also happen in unwanted places. If I write a complex
> author line like :
>
> #+AUTHOR: \IEEEauthorblockN{Foo, Bar} \IEEEauthorblockA{ Somewhere\\ Over
> the Rainbow \\ Email: \{foo,bar\}@baz.fr } \and \IEEEauthorblockN{foobar}
> \IEEEauthorblockA{somewhere else \\ Email: foo...@baz.fr}

You cannot write raw non-math LaTeX in an Org buffer (unless it is also
an entity). You ought to use export snippets, i.e., @@latex:...@@.

> Another related question also : did anybody managed to hilghlight LaTeX
> equations inside org-mode ?

See `org-highlight-latex-and-related'.


Regards,

-- 
Nicolas Goaziou



Re: [O] "Recent items" Agenda view?

2013-10-11 Thread Eric S Fraga
Martin Beck  writes:

> Hi,
>
> I'm often having the problem that I want to quickly attach an information to
> an item I've created or I've been working on during the last days and then
> have to invoke a keyword search.
>
> How could I create an agenda with a list of headlines which have any
> timestamp in the last 7 days (as they were created, clocked, changed their
> status etc.?), sorted by the most recent timestamp?

I don't know how to do this in an agenda view (although I'm sure, given
that we are talking about org, that it is possible :-) but you can use a
sparse view (org-sparse-tree, C-c /) to get what you want for any given
file.

I found I needed to change the default date option to "all timestamps"
in the menu that comes up with org-sparse-tree to get the kind of output
I think you want.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.2.1-86-gbe3dad




Re: [O] [BUG?] Additional warning period in timestamp affects parsing

2013-10-11 Thread Nicolas Goaziou
Hello,

Thorsten Jolitz  writes:

> with tmp.org
>
> #+begin_src org
> * A
>   DEADLINE: <2013-10-11 Fr 06:33 +1m -3d>
>
> txt A
>
> * B
>   DEADLINE: <2013-10-11 Fr 22:00 +1m>
>
> txt B
> #+end_src
>
> calling `org-element-parse-buffer' results in the following parse-tree

[...]

> It looks as if the combination of repeater *and* special warning period
> prevents the parsing of both of them.

Actually, the parser doesn't support special warning period syntax at
all. I'll implement it when I have some spare time.

Regards,

-- 
Nicolas Goaziou



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

2013-10-11 Thread Jarmo Hurri
Karl Voit  writes:

> As a programmer, I do understand your objection. However, I tend to
> have following structure:
>
> * Events
> ** LUGG meetings  :LUGG:common:tags:
> 
>- common information about this event
> 
> *** <...> single occurrence
> *** <...> another occurrence
> [...]
>
> For other purposes, I am also using the following approach:
>
> * Events
> ** LUGG meetings  :LUGG:common:tags:
> 
>- common information about this event
>
>- <2013-09-30 Sun 18:00-20:00> 
>- <2013-10-06 Sun 18:00-20:00> 
>- [...]

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.)

Jarmo




[O] org babel before excute hook

2013-10-11 Thread Henning Redestig
I collaborate with different people on the same orgfile which contains many
source blocks that generate graphics by e.g. :results graphics abc.pdf

It can happen that I or someone else accidentally create another
independent source block that overwrites my abc.pdf which is of course very
bad.

I would like to add functionality so that org-babel-execute-src-block
checks if in :results graphics FILE, FILE is already referred to by another
source block and if so refuse to evaluate.

However, I only see a org-babel-after-execute-hook but no
org-babel-before-execute-hook

any reason for this? I could try to write a patch but thought I'd ask
first.

or if there is an even better approach to avoid overwriting output from
different source blocks..

//Henning


[O] org-store-link BUG for notmuch message

2013-10-11 Thread Ingo Lohmar
Hi all,

I am using org-notmuch to store links to individual messages, and recently
this has broken.  As far as I can see, it is due to the last 10 lines in
org.el's org-store-link: It looks to me like the "if" clause misses a progn:
the "true" clause is too short and does not store the link (both pushes are
in the "false" clause of the if form).

Since I only have the packaged version, I would be very grateful if someone
else could restore the working state --- I cannot check previous versions
right now.  Please let me know if you need any more info!

Thanks a lot, and best regards
Ingo




Re: [O] org babel before excute hook

2013-10-11 Thread John Kitchin
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.

John

John

---
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



On Fri, Oct 11, 2013 at 9:56 AM, Henning Redestig wrote:

> I collaborate with different people on the same orgfile which contains
> many source blocks that generate graphics by e.g. :results graphics abc.pdf
>
> It can happen that I or someone else accidentally create another
> independent source block that overwrites my abc.pdf which is of course very
> bad.
>
> I would like to add functionality so that org-babel-execute-src-block
> checks if in :results graphics FILE, FILE is already referred to by another
> source block and if so refuse to evaluate.
>
> However, I only see a org-babel-after-execute-hook but no
> org-babel-before-execute-hook
>
> any reason for this? I could try to write a patch but thought I'd ask
> first.
>
> or if there is an even better approach to avoid overwriting output
> from different source blocks..
>
> //Henning
>


Re: [O] "Recent items" Agenda view?

2013-10-11 Thread Samuel Wales
On 10/11/13, Martin Beck  wrote:
> I'm often having the problem that I want to quickly attach an information
> to
> an item I've created or I've been working on during the last days and then
> have to invoke a keyword search.
>
> How could I create an agenda with a list of headlines which have any
> timestamp in the last 7 days (as they were created, clocked, changed their
> status etc.?), sorted by the most recent timestamp?
>
> Thanks a lot,
> kind regards
>
> Martin

Something like this:

(setq org-agenda-inactive-leader "Inactive:  ")
(setq org-agenda-include-inactive-timestamps t)

Custom command:

  ("ip" "past 7d"
   ;; faster than tags
   agenda ""
   ((org-agenda-start-day "-7d")
(org-agenda-span 7)
(org-agenda-repeating-timestamp-show-all nil)
;; %s is only for agenda views
;; (org-agenda-prefix-format "%s")
;; maybe not make much difference ka
;; (org-agenda-use-tag-inheritance nil)
))

===

Samuel

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

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

Denmark: free Karina Hansen NOW.



Re: [O] LaTeX math mode and export

2013-10-11 Thread Fabrice Popineau
>  > \[\begin{array}{c}
> >   \begin{array}{|c|c|c|}
> > \hline
> > \delta_{1} & 0 &  1 \\
> > \hline
> > p & \{p, q\} & \{q\} \\
> > \hline
> > q & \{r\} & \{q, r\} \\
> > \hline
> > r & \{s\} & \{p\} \\
> > \hline
> > s & \{s\} & \{p\} \\
> > \hline
> >   \end{array}
> > \]
>
> This isn't correct syntax: "\begin{array}{|c|c|c|}...\end{array}" is
> parsed as a latex environment, so it breaks the paragraph you started
> the line before. You can use "\begin{equation}" instead of "\[".
>
>
I'm not sure why it is not correct : I guess you mean not correct Org
syntax?
(I broke my example by shortening it, one \end{array} is missing and there
used
to be other arrays below)
The problem as I feel it is that \[ \]  works sometimes, but not as  often
as with LaTeX,
which is disconcerting.

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 ?

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

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

#+begin_equation
 \begin{array}{c}
   \begin{array}{|c|c|c|}
   \hline
   \delta_{1} & 0 &  1 \\
   \hline
   p & \{p, q\} & \{q\} \\
   \hline
   q & \{r\} & \{q, r\} \\
   \hline
   r & \{s\} & \{p\} \\
   \hline
   s & \{s\} & \{p\} \\
   \hline
   \end{array}
  \vspace{1em} \\
  (\{p,q,r,s\}, \{0,1\},  \delta_{2}, p, \{q,s\})
  \end{array}
  #+end_equation

The last line but two is translated :

  (\{p,q,r,s\}, \{0,1\},  $\delta$$_{\text{2}}$, p, \{q,s\})

This time, given that we are in an equation environment, things should be
left as-is surely?

 > - \(\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?

>

> 2 - Quoting of {} may also happen in unwanted places. If I write a complex
> > author line like :
> >
> > #+AUTHOR: \IEEEauthorblockN{Foo, Bar} \IEEEauthorblockA{ Somewhere\\ Over
> > the Rainbow \\ Email: \{foo,bar\}@baz.fr } \and
> \IEEEauthorblockN{foobar}
> > \IEEEauthorblockA{somewhere else \\ Email: foo...@baz.fr}
>
> You cannot write raw non-math LaTeX in an Org buffer (unless it is also
> an entity). You ought to use export snippets, i.e., @@latex:...@@.


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.
Actually, it is only the second curly brace that gets backslashed, not even
the first
one.



> Another related question also : did anybody managed to hilghlight LaTeX
> > equations inside org-mode ?
>
> See `org-highlight-latex-and-related'.
>
>
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.

Thanks a lot for your help and your work,

-- 
Fabrice


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

2013-10-11 Thread Mike McLean

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.

Mike




Re: [O] org babel before excute hook

2013-10-11 Thread 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] using %(sexp) in capture templates

2013-10-11 Thread Manish
  >> 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.

cheers!
--manish