Re: [O] org mode capture to headline at point

2016-05-27 Thread Xebar Saram
Thx ian

this is very useful!

i wonder if any of the elisp gurus would know a workaround the fact that
the point needs to be on the starting asterix? it would be cool to just not
worry where the point is in the current header and have the capture add
another same level header below

best

Z

On Tue, May 24, 2016 at 6:27 PM, Ian McB  wrote:

> Xebar Saram  gmail.com> writes:
>
> >
> > Hi all
> > any one knows how to launch a capture (thats pre defined) but auto refile
> that capture to the/beneath the current header at point?
> >
> > thx
> >
> > Z
> >
>
>
> A while back I stumbled onto this thread looking for the same problem. Like
> Phil Hudson suggested I created a capture template using a custom function.
> I'll share my solution below.
>
> one of the capture templates using the function:
>  ("ss" "Future subtask" entry
>   (function my-org-move-point-to-capture)
>   "* TODO %?
>   :PROPERTIES:
>   :Created: %U
>   :END:")
>
> the necessary function
> (defun my-org-move-point-to-capture ()
>   (cond ((org-at-heading-p) (org-beginning-of-line))
> (t (org-previous-visible-heading 1
>
> So pretty simple all in all. Keep in mind I'm pretty new to Elisp, Emacs
> and
> org-mode. One gotcha in writing the function which I didn't find easily
> documented was that (point) needs to end up over the asterisk starting a
> headline to result in the capture being a subheading of that headline. The
> behaviour to end up at that asterisk is different depending on whether
> point
> is in the body of the heading or on the headline itself at the time of
> capturing.
>
> Hope this is useful. I've been wanting to subscribe to this list for a
> while
> now, to ask about some bugs and strange behaviours.
>
>
>


Re: [O] add some babel supports (PHP, Lua, Redis)

2016-05-27 Thread numbch...@gmail.com
I see, I will check out them, and merge them if possible.
I will PR after they are good enough.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, May 28, 2016 at 12:52 AM, Rasmus  wrote:

> Hi,
>
>
> "numbch...@gmail.com"  writes:
>
> > I modified most part of my files.
>
> Thanks.
>
> > - There are some places I can't improve because I'm not good at elisp.
> > (maybe other  people can improve it later) Like ob-redis.el implement
> > ob-sql style configuration. and ob-lua.el make use of lua-mode's running
> > process.
>
> OK.
>
> > - I guess ob-php.el is the only one branch can be merged.
>
> Maybe we should wait until it is a bit less bare-bone or there’s a
> copyright assignment in place.
>
> BTW there’s also this ob-php,
>
>   https://github.com/steckerhalter/ob-php
>
> > - Anyway, check out my updates, if no one can be merged, I will still
> keep
> > my github repositories.
>
> Note that there was already one ob-lua.el that was never commiteed for
> some reason...
>
>
> https://lists.gnu.org/archive/html/emacs-orgmode/2014-05/msg01149.html
>
> Rasmus
>
> --
> Slowly unravels in a ball of yarn and the devil collects it
>
>
>


[O] problem with org-table-export

2016-05-27 Thread Andreas Amann
Hi list,

whenever I use

M-x org-table-export

inside a table, the buffer is marked "modified".  

This is even the case if no modifications are done to the buffer by
exporting the table.  

This problem happens since at least two years and possibly longer and
persists with the current git version of org-mode.

As it is quite annoying in my workflow, I tried to investigate the
problem.  Looking at the definition of org-table-export in
lisp/org-table.el the problem seems to be that the line

   (org-table-align) ; Make sure we have everything we need.


which seems to always set the modified flag, irrespective of real
changes being done. When I comment out this line or surround it with
(org-with-silent-modifications  ... ), then the buffer remains clean.
However both solutions likely introduce other problems.

I guess the proper solution would be to improve org-table-align to not
unnecessarily set the "modified" flag, but I would not know how to do
this.

Regards,
Andreas



Re: [O] add some babel supports (PHP, Lua, Redis)

2016-05-27 Thread Rasmus
Hi,


"numbch...@gmail.com"  writes:

> I modified most part of my files.

Thanks.

> - There are some places I can't improve because I'm not good at elisp.
> (maybe other  people can improve it later) Like ob-redis.el implement
> ob-sql style configuration. and ob-lua.el make use of lua-mode's running
> process.

OK.

> - I guess ob-php.el is the only one branch can be merged.

Maybe we should wait until it is a bit less bare-bone or there’s a
copyright assignment in place.

BTW there’s also this ob-php,

  https://github.com/steckerhalter/ob-php

> - Anyway, check out my updates, if no one can be merged, I will still keep
> my github repositories.

Note that there was already one ob-lua.el that was never commiteed for
some reason...

 https://lists.gnu.org/archive/html/emacs-orgmode/2014-05/msg01149.html

Rasmus

-- 
Slowly unravels in a ball of yarn and the devil collects it




Re: [O] [ox-publish, patch] More flexible sitemaps

2016-05-27 Thread Rasmus
Hi,

Thanks for the comments.

Nicolas Goaziou  writes:

>> (org-publish-find-subtitle): New function.
>> (org-publish-org-sitemap-as-tree): New function.
>> (org-publish--find-property): Find arbirary property.
>> (org-publish-project-alist): Document changes.
>> * doc/org.texi (Sitemap): Update documentation.
>
> All in all, I think this deserves to be split into 3 patches: one for
> the preamble-postamble feature, another one for implementing
> `org-publish--find-property' and associated refactoring, and the latter
> for the sitemap itself.

This was by far the hardest part...

>> +(autoload 'message-flatten-list "message")
>> +(autoload 'dired-tree-lessp "dired-aux")
>
> I hope we can avoid these. In particular, why are you using
> `dired-tree-lessp' instead of `org-publish-compare-directory-files'?


AFAIK, org-publish-compare-directory-files can’t be used on its own.  It
requires variables to be bound around it,
e.g. org-publish-sitemap-ignore-case.  See org-publish-get-base-files.
(I don’t know why the project plist isn’t being passed around.)

Anyway, I’m not using neither of these files anymore.

Aside: the way ox-publish order files is not super, IMO, as it takes
directory into account even if one use a flat list and chronological
ordering.  That’s a problem for another day, though.

>> +(defun org-publish--tree-assoc (key tree)
>> +(defun org-pubish--order-files-by-dir-tree (files)
>
> I don't understand why you need the 2 functions above. You are working
> with plain lists, not nested ones. Besides, once the file name are
> standardized, isn't tree order equivalent to lexicographic one?

Removed.

>> +(defun org-publish-find-subtitle (file  reset)
>> +  "Find the title of FILE in project."
>> +  (org-publish--find-property file :subtitle reset))
>
> I don't think this would work. :subtitle is not defined in default
> export properties, it is back-end specific. `org-export-get-environment'
> without any argument, doesn't catch these. You need to somehow provide
> it the back-end.

You are right.  The "problem" is that the sitemap is done in a before the
backend is known.  So we can’t do (org-export-get-environment BACKEND).

OTOH, only allowing ox.el keywords is too limiting IMO.  E.g. a blog
sitemap wouldn’t be able to include keywords, though a desirable format
for each entry is

TITLE
DATE KEYWORDS
#+INCLUDE: "file.org::lead"

But KEYWORDS is specific to ox-html...

A couple of workarounds:

1. Guess the backend(s) from the name of :publishing-function.  This is
   not very robust...
2. Find the keyword by search in the file, thus sidestepping
   org-export-get-environment.  It is is not without problems.  E.g. if my
   file contains this, I’d probably only key1.
  #+Keywords: key1
  #+Keywords: key2
3. Go through backend for org-export-get-environment until something is
   Found.  I do this now.

Rasmus

-- 
This is the kind of tedious nonsense up with which I will not put
>From 4e18d9141c509b03cc5579517547f6e7e73088f3 Mon Sep 17 00:00:00 2001
From: Rasmus 
Date: Fri, 27 May 2016 16:46:14 +0200
Subject: [PATCH 1/6] ox-publish: Tiny refactor

* lisp/ox-publish.el: (org-publish-compare-directory-files):
(org-publish-get-base-files-1): Change test.
* lisp/ox-publish.el (org-publish-initialize-cache): Tiny fix.
---
 lisp/ox-publish.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index 8ccba99..d60562b 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -467,7 +467,7 @@ matching the regexp SKIP-DIR when recursing through BASE-DIR."
 		  (and skip-file (string-match skip-file fnd))
 		  (not (file-exists-p (file-truename f)))
 		  (not (string-match match fnd)))
-	(cl-pushnew f org-publish-temp-files)))
+	(cl-pushnew f org-publish-temp-files :test #'file-equal-p)))
 
 (defun org-publish-get-base-files (project  exclude-regexp)
   "Return a list of all files in PROJECT.
@@ -511,7 +511,7 @@ matching filenames."
 (setq org-publish-temp-files nil)
 (when org-publish-sitemap-requested
   (cl-pushnew (expand-file-name (concat base-dir sitemap-filename))
-		  org-publish-temp-files))
+		  org-publish-temp-files :test #'file-equal-p))
 (org-publish-get-base-files-1 base-dir recurse match
   ;; FIXME distinguish exclude regexp
   ;; for skip-file and skip-dir?
@@ -1172,7 +1172,7 @@ If FREE-CACHE, empty the cache."
 
   (if cexists (load-file cache-file)
 	(setq org-publish-cache
-	  (make-hash-table :test 'equal :weakness nil :size 100))
+	  (make-hash-table :test #'equal :weakness nil :size 100))
 	(org-publish-cache-set ":project:" project-name)
 	(org-publish-cache-set ":cache-file:" cache-file))
   (unless cexists (org-publish-write-cache-file nil
-- 
2.8.3

>From 410dc552de2e846f7eed9f98275acffba45f5be0 Mon Sep 17 00:00:00 2001
From: Rasmus 
Date: Fri, 27 May 2016 15:46:31 +0200

Re: [O] BUG: in beamer export non-beamer tags exported as part of header

2016-05-27 Thread Rainer M Krug
Nicolas Goaziou  writes:

> Hello,
>
> Rainer M Krug  writes:
>
>> When I generate a pdf, the tags are in the TOC - but tags:not-in-toc
>> means that the tags are *not* in the toc - possibly only in the headers
>> itself? I don't know.
>>
>> Just checked, the tags are also in the toc in html export.
>>
>> According to the documentation:
>>
>> ,
>> | If this is the symbol ‘not-in-toc’, tags will be removed from
>> | table of contents entries, but still be shown in the headlines of
>> | the document.
>> `
>>
>> This is not working anymore.
>
> I cannot reproduce it, at least on HTML, LaTeX, and ASCII export. Could
> you show an ECM ?

OK. Here it is:

--8<---cut here---start->8---
#+TITLE: An Example
#+EMAIL: rai...@krugs.de

#+OPTIONS:   tags:not-in-toc

#+LATEX_CLASS: beamer
#+OPTIONS:   H:2 toc:t

* Level 1   :andHereIsTheTag:
** A Frame
#+begin_example
Org-mode version 8.3.4 (release_8.3.4-850-g9dbeaa @ 
/Users/rainerkrug/.emacs.d/org-mode/lisp/)
GNU Emacs 25.0.94.1 (x86_64-apple-darwin15.4.0, Carbon Version 157 AppKit 
1404.46) of 2016-05-24
#+end_example
--8<---cut here---end--->8---


The problem is beamer - with the other exports it works. With beamer,
I get the pdf at [[https://www.dropbox.com/s/fc6z9wszxl5vv9i/text.pdf?dl=0]]

Cheers,

Rainer

>
> Regards,

-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


signature.asc
Description: PGP signature


Re: [O] Inquiry about ical2org

2016-05-27 Thread John Hendy
On Fri, May 27, 2016 at 2:50 AM, Eric S Fraga  wrote:
> On Thursday, 26 May 2016 at 20:04, John Hendy wrote:
>
> [...]
>
>> Anyway, the point is that the repeater is built if there's any
>> repetition frequency/interval. You also capture the "until" into
>> rrend. So, the first date is going to feature a +unit, and this code
>> adds the end:
>>
>> else if (rrend != "")
>> date = date ">--<" rrend
>>
>> I just commented out both sections that add a "-- ", the other
>> checking for time2 being "". Is that the correct way to go about this?
>
> Well, I would simply not add the end information as org does not
> understand an end date for a repeating item.  In other words, for a
> repeating item I would simply have the start date including the repeat
> directive.
>

Cool. Commenting has accomplished this for me and I don't get
repeating entries anymore.

>> Out of curiosity, how *is* the rrend code supposed to be handling
>> these? Or what's the use case for building a --?
>
> I should say that the awk codes have diverged.  My own version now
> differs significantly from what is on Worg, which is where I assume you
> got your copy.  I implemented repeating entries differently, it would
> seem.

Ah, that makes more sense. I was confused about agreeing that an end
date wasn't proper but the code having it. Is your original version
anywhere handy? I tried searching but don't seem to find it.


Thanks,
John

>
> HTH,
> eric
>
> --
> : Eric S Fraga (0xFFFCF67D), Emacs 25.0.94.1, Org release_8.3.4-869-gf2c421



Re: [O] radio tables centered AND vertical lines

2016-05-27 Thread Nicolas Goaziou
Uwe Brauer  writes:

 "Nicolas" == Nicolas Goaziou  writes:
>
>> Hello,
>> Uwe Brauer  writes:
>
>> Try
>
>>   | / | <>   | <>   |
>>   |   |   |   |
>>   |   | this | today|
>>   |   | that | tomorrow |
>
>
> Thanks very much! Works perfect, maybe add something about it in the
> documentation?

It is already in the documentation.  belongs to part 3.2 "Column
width and alignment" and <> belongs to part 3.3 "Column groups".

Regards,



Re: [O] radio tables centered AND vertical lines

2016-05-27 Thread Uwe Brauer
>>> "Nicolas" == Nicolas Goaziou  writes:

   > Hello,
   > Uwe Brauer  writes:

   > Try

   >   | / | <>   | <>   |
   >   |   |   |   |
   >   |   | this | today|
   >   |   | that | tomorrow |


Thanks very much! Works perfect, maybe add something about it in the
documentation?

Uwe 




Re: [O] BUG: in beamer export non-beamer tags exported as part of header

2016-05-27 Thread Nicolas Goaziou
Hello,

Rainer M Krug  writes:

> When I generate a pdf, the tags are in the TOC - but tags:not-in-toc
> means that the tags are *not* in the toc - possibly only in the headers
> itself? I don't know.
>
> Just checked, the tags are also in the toc in html export.
>
> According to the documentation:
>
> ,
> | If this is the symbol ‘not-in-toc’, tags will be removed from
> | table of contents entries, but still be shown in the headlines of
> | the document.
> `
>
> This is not working anymore.

I cannot reproduce it, at least on HTML, LaTeX, and ASCII export. Could
you show an ECM ?

Regards,

-- 
Nicolas Goaziou



Re: [O] radio tables centered AND vertical lines

2016-05-27 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> | / |   |   |
> |   | this | today|
> |   | that | tomorrow |
> \end{comment}

Try

  | / | <>   | <>   |
  |   |   |   |
  |   | this | today|
  |   | that | tomorrow |


Regards,

-- 
Nicolas Goaziou



Re: [O] Expansion of macros conditional on export type

2016-05-27 Thread Eric S Fraga
On Friday, 27 May 2016 at 10:26, Giacomo M wrote:
> For chunks of text like institute affiliations, may I ask if you use 
> different BEGIN_EXPORT blocks or sth else?

Depends.  Most often a sequence of #+latex_header: lines as my eventual
target for export is almost always LaTeX for submission to journals.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.94.1, Org release_8.3.4-869-gf2c421



Re: [O] Expansion of macros conditional on export type

2016-05-27 Thread Giacomo M

Il 27/05/2016 12:17, Eric S Fraga ha scritto:

I know one way would be to use @@latex: ... @@ w/ ascii counterpart
each time, but I would rather envision a single macro, which then gets
defined in different way depending on the export, in order to reduce
redundancy.

You can put all the different alternatives together?  I do the following
for degrees Celsius:

#+macro: degc @@odt:°Clatex:\(^{\circ}\)C@@

Looks ugly but I don't have to look at it often.  In text, I simply have
{{{degc}}}.

(minor aside: I wish macros had been defined to be used with [[[degc]]]
instead as much easier to type than {{{degc}}})



Perfect! Actually I hadn't tried to combine them.
For chunks of text like institute affiliations, may I ask if you use 
different BEGIN_EXPORT blocks or sth else?


Thanks a lot,

Giacomo





Re: [O] Expansion of macros conditional on export type

2016-05-27 Thread Eric S Fraga
> I know one way would be to use @@latex: ... @@ w/ ascii counterpart
> each time, but I would rather envision a single macro, which then gets
> defined in different way depending on the export, in order to reduce
> redundancy.

You can put all the different alternatives together?  I do the following
for degrees Celsius:

#+macro: degc @@odt:°Clatex:\(^{\circ}\)C@@

Looks ugly but I don't have to look at it often.  In text, I simply have
{{{degc}}}.

(minor aside: I wish macros had been defined to be used with [[[degc]]]
instead as much easier to type than {{{degc}}})

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.94.1, Org release_8.3.4-869-gf2c421



[O] radio tables centered AND vertical lines

2016-05-27 Thread Uwe Brauer
Hello

Please look at the following two examples

\documentclass[12pt]{article}
\usepackage{amssymb,amsfonts,amsmath,amsthm}
\begin{document}


% BEGIN RECEIVE ORGTBL test
\begin{tabular}{|l|l|}
this & today\\ \hline
that & tomorrow\\ \hline
\end{tabular}
% END RECEIVE ORGTBL test
\begin{comment}
#+ORGTBL: SEND test orgtbl-to-latex  :lend " \\hline" :environment tabular
| / | <>   | <>   |
|   | this | today|
|   | that | tomorrow |
\end{comment}





% BEGIN RECEIVE ORGTBL test2
\begin{tabular}{cc}
this & today\\ \hline
that & tomorrow\\ \hline
\end{tabular}
% END RECEIVE ORGTBL test2
\begin{comment}
#+ORGTBL: SEND test2 orgtbl-to-latex  :lend " \\hline" :environment tabular
| / |   |   |
|   | this | today|
|   | that | tomorrow |
\end{comment}

\end{document}

The first one nicely generates
\begin{tabular}{|l|l|}
but the second one

\begin{tabular}{cc}

How can I achieve

\begin{tabular}{|c|c|}

thanks

Uwe Brauer 




[O] Expansion of macros conditional on export type

2016-05-27 Thread Giacomo M

  
  
Dear all,
I'm working on a paper where some co-authors use word and some
  (myself included) latex. Org seems the perfect way to mantain a
  central version. How do I deal with constructs that should be
  exported in different ways, e.g. \textdegree{} in latex vs
  corresponding symbol in odt, or \ce{CO2} vs CO_2? For citations
  I'm using org-add-link-type as found in reddit,
  but it looks cumbersome to create specific alternatives via links
  each time. Another issue seems to declare institutes along with
  authors in latex vs odt in the title section.
I know one way would be to use @@latex: ... @@ w/ ascii
  counterpart each time, but I would rather envision a single macro,
  which then gets defined in different way depending on the export,
  in order to reduce redundancy.

Any ideas on where I can find related best practices?
Thanks,
Giacomo M

  




Re: [O] BUG: in beamer export non-beamer tags exported as part of header

2016-05-27 Thread Rainer M Krug
Nicolas Goaziou  writes:

> Hello,
>
> Rainer M Krug  writes:
>
>> Makes sense - I just wasn't aware of the tags:nil property. Probably it
>> should be added to the beamer template headers (C-ce#)?
>
> It belongs to the default template, since this is a generic option.
> I don't think it's a good idea to add duplicates in templates.
>
>> I had
>>
>> #+OPTIONS: tags:not-in-toc
>>
>> in my org file, but the tags were still in the toc of the beamer
>> export.
>
> From your document, adding tags:not-in-toc, I get
>
>   \begin{document}
>
>   \begin{frame}{Outline}
>   \tableofcontents
>   \end{frame}
>
>
>   \section[Level 1]{Level 1\hfill{}\textsc{presentation}}
>   \label{sec:org057dfd7}
>   \begin{frame}[label={sec:org1551704}]{Frame 1}
>   Some Text
>   \end{frame}
>   \end{document}
>
> Do you know what should be generated instead?

When I generate a pdf, the tags are in the TOC - but tags:not-in-toc
means that the tags are *not* in the toc - possibly only in the headers
itself? I don't know.

Just checked, the tags are also in the toc in html export.

According to the documentation:

,
| If this is the symbol ‘not-in-toc’, tags will be removed from
| table of contents entries, but still be shown in the headlines of
| the document.
`

This is not working anymore.

Cheers,


Rainer


>
> Regards,

-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


signature.asc
Description: PGP signature


Re: [O] Inquiry about ical2org

2016-05-27 Thread Eric S Fraga
On Thursday, 26 May 2016 at 20:04, John Hendy wrote:

[...]

> Anyway, the point is that the repeater is built if there's any
> repetition frequency/interval. You also capture the "until" into
> rrend. So, the first date is going to feature a +unit, and this code
> adds the end:
>
> else if (rrend != "")
> date = date ">--<" rrend
>
> I just commented out both sections that add a "-- ", the other
> checking for time2 being "". Is that the correct way to go about this?

Well, I would simply not add the end information as org does not
understand an end date for a repeating item.  In other words, for a
repeating item I would simply have the start date including the repeat
directive.

> Out of curiosity, how *is* the rrend code supposed to be handling
> these? Or what's the use case for building a --?

I should say that the awk codes have diverged.  My own version now
differs significantly from what is on Worg, which is where I assume you
got your copy.  I implemented repeating entries differently, it would
seem.

HTH,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.94.1, Org release_8.3.4-869-gf2c421



Re: [O] Export to pdf when path name has ~

2016-05-27 Thread Rasmus
Nicolas Goaziou  writes:

> Hello,
>
> Stig Brautaset  writes:
>
>> And, indeed, running pdflatex on that file works perfectly fine from the 
>> shell:
>>
>> #+BEGIN_EXAMPLE
>> 17:37:57 /tmp> /Library/TeX/texbin/pdflatex ~/Org/TODO.tex
>> This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded 
>> format=pdflatex)
>>  restricted \write18 enabled.
>> entering extended mode
>> (/Users/stig/Org/TODO.tex
>> LaTeX2e <2015/01/01>
>>
>> [...]
>>
>> Output written on TODO.pdf (10 pages, 206446 bytes).
>> Transcript written on TODO.log.
>> #+END_EXAMPLE
>>
>>
>> ... except if you use the full path (rather than the symlink), in which case
>> pdflatex chockes on the filename:
>>
>> #+begin_example
>> 17:27:25 /tmp> pdflatex "/Users/stig/Library/Mobile 
>> Documents/com~apple~CloudDocs/Org/TODO.tex"
>> This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded 
>> format=pdflatex)
>>  restricted \write18 enabled.
>> entering extended mode
>> ! I can't find file `"/Users/stig/Library/Mobile Documents/com"'.
>>  
>>\protect 
>> <*> "/Users/stig/Library/Mobile Documents/com~
>>   apple~CloudDocs/Org/TODO.tex"
>
> Indeed. It seems pdflatex doesn't like the ~ sign excepted at the
> beginning of the filename. It doesn't seem to be Org related though.
>
> In any case, I'm wondering if we really need to send the full canonical
> path (as returned by `file-truename') of the tex file to the pdflatex
> process.
>
> For example, we could set `default-directory' to the directory of the
> tex file and provide only relative filename with %f. If needed, %F may
> be used for the full path. I don't think it would introduce
> incompatibilities.
>
> WDYT?

It would make sense to run the process starting from the path of the
compiling org document (in Stig’s example from the Org folder).  AFAIK
this is what AUCTeX does (modulus the value of TeX-master) and I think the
build in TeX compiler as well.

I also agree that the best way would be to change the meaning of %f.

Rasmus



-- 
I hear there's rumors on the, uh, Internets. . .