emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [babel] session initialization (was RE: python/babel inline imag


From: Mikhail Titov
Subject: Re: [O] [babel] session initialization (was RE: python/babel inline images)
Date: Thu, 7 Jun 2012 18:02:53 -0500

> -----Original Message-----
> From: address@hidden [mailto:emacs-orgmode-
> address@hidden On Behalf Of Eric Schulte
> Sent: Thursday, June 07, 2012 5:44 PM
> To: Mikhail Titov
> Cc: address@hidden; 'Eric Schulte'
> Subject: Re: [O] [babel] session initialization (was RE: python/babel
inline
> images)
> 
> >> ...
> >>
> >> How would I reliably refer to the org doc buffer from where everything
was
> >> called? The following works just fine in session initialization code
for
> >> Matlab but not for Octave
> >>
> >
> > (file-name-directory
> >    (car (delq nil (mapcar #'buffer-file-name (buffer-list)))))
> >
> > It works. But I have a feeling that it is not a reliable method. Any
> > suggestions?
> >
> 
> I would recommend using the `default-directory' variable.  That should
> hold the value of the directory of the Org-mode file or the value of the
> :dir header argument if present.

Huh... now it works... I remember I've tried before but for some reason it
was nil.. maybe typo though I have AC.

The only trick [1] is to use (file-truename default-directory) as Matlab
does not like ~.

Thanks!

M. 

[1]
http://stackoverflow.com/questions/291976/relative-path-to-absolute-path-in-
elisp





reply via email to

[Prev in Thread] Current Thread [Next in Thread]