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: Wed, 6 Jun 2012 18:06:08 -0500

> -----Original Message-----
> From: address@hidden [mailto:emacs-orgmode-
> address@hidden On Behalf Of Mikhail Titov
> Sent: Wednesday, June 06, 2012 2:42 PM
> To: 'Eric Schulte'
> Cc: address@hidden
> Subject: Re: [O] [babel] session initialization (was RE: python/babel
inline
> images)
> 
> > -----Original Message-----
> > From: address@hidden [mailto:emacs-orgmode-
> > address@hidden On Behalf Of Eric Schulte
> > Sent: Wednesday, June 06, 2012 2:02 PM
> > To: Mikhail Titov
> > Cc: address@hidden; 'henry atting'; 'Eric Schulte'
> > Subject: Re: [O] [babel] session initialization (was RE: python/babel
> inline
> > images)
> >
> > > Right now I have something like the following in that function
> > >
> > >     (comint-send-string
> > >      (get-buffer-process (current-buffer))
> > >                          "set(0, 'defaultfigurevisible', 'off');\n")
> > >
> > > I do it there as it does not make sense to call for each block. I was
> about
> > > to write that ob-R does show stuff but I believe it was in earlier
> versions
> > > of ob-R.el or something as I've checked and indeed nothing appears on
> screen
> > > as code being wrapped in a device output block.
> > >
> >
> > I'm not aware of a way to run code on the start of a session.  I do see
> > how this could be a useful addition.
> 
> So the fragment above does look legitimate to you? I just add
> 
> (format "cd('%s');\n" (file-name-directory (buffer-file-name)))
> 
> and problem solved? Well... for sessions. I don't know if it is common to
> use non-session based calculations...

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.

M.




reply via email to

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