> -----Original Message----- > From: [email protected] [mailto:emacs-orgmode- > [email protected]] On Behalf Of Mikhail Titov > Sent: Wednesday, June 06, 2012 6:06 PM > To: 'Eric Schulte' > Cc: [email protected] > 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 (buffer-file-name (other-buffer))) > > At this point, (current-buffer) refers to the one with inferior process.
So I ended up using the following in session initialization for inferior process to get a current folder of a document from where calculations initiated (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? M.
