[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [babel] session initialization (was RE: python/babel inline imag
From: |
Eric Schulte |
Subject: |
Re: [O] [babel] session initialization (was RE: python/babel inline images) |
Date: |
Thu, 07 Jun 2012 16:44:20 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.97 (gnu/linux) |
"Mikhail Titov" <address@hidden> writes:
>> -----Original Message-----
>> From: address@hidden [mailto:emacs-orgmode-
>> address@hidden On Behalf Of Mikhail Titov
>> Sent: Wednesday, June 06, 2012 6:06 PM
>> To: 'Eric Schulte'
>> Cc: address@hidden
>> 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?
>
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.
--
Eric Schulte
http://cs.unm.edu/~eschulte
- Re: [O] python/babel inline images, (continued)
Re: [O] python/babel inline images, Mikhail Titov, 2012/06/05
- Re: [O] python/babel inline images, Eric Schulte, 2012/06/06
- [O] [babel] session initialization (was RE: python/babel inline images), Mikhail Titov, 2012/06/06
- Re: [O] [babel] session initialization (was RE: python/babel inline images), Eric Schulte, 2012/06/06
- Re: [O] [babel] session initialization (was RE: python/babel inline images), Mikhail Titov, 2012/06/06
- Re: [O] [babel] session initialization (was RE: python/babel inline images), Mikhail Titov, 2012/06/06
- Re: [O] [babel] session initialization (was RE: python/babel inline images), Mikhail Titov, 2012/06/07
- Re: [O] [babel] session initialization (was RE: python/babel inline images),
Eric Schulte <=
- Re: [O] [babel] session initialization (was RE: python/babel inline images), Mikhail Titov, 2012/06/07
- Re: [O] [babel] session initialization (was RE: python/babel inline images), Mikhail Titov, 2012/06/07
- Re: [O] [babel] session initialization (was RE: python/babel inline images), Eric Schulte, 2012/06/07
Re: [O] [babel] session initialization (was RE: python/babel inline images), Eric Schulte, 2012/06/07