texmacs-dev
[Top][All Lists]
Advanced

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

Re: [Texmacs-dev] arguments to sessions


From: Michael Lachmann
Subject: Re: [Texmacs-dev] arguments to sessions
Date: Wed, 3 Oct 2012 23:06:37 +0200

The change for accomplishing what I described below is actually trivial.
in progs/utils/plugins/plugin-eval.scm plugin-start should be:

(define (plugin-start lan ses)
  (when (!= lan "scheme")
    (plugin-set-author lan ses)
    (setenv "TEXMACS-SESSION-ARG" (get-env "session-arg"))
    (connection-start lan ses)))

With this, sessions can remember data across relaunch.

allowed?

Michael


On 3 October 2012 12:17, Michael Lachmann <address@hidden> wrote:
> Hi,
>
> As I mentioned a couple of times before, it is convenient for me to
> have several different R sessions in a document - for example, one for
> the local host, and one for a remote host.
> I haven't managed to make it work well, yet.
>
> What I do now is that I defined:
> (kbd-map ("R 2 ."
>     (setenv "TEXMACS_R_SESSION" "bionc02")
>     (setenv "TEXMACS_CMD" "ssh -t bionc02 R")
>     (make-session "r" "default2")
> ))
>
> Then I press 'R2.', and get an R session on a remote host.
> The R interface tm_r knows to read the environment variables
> TEXMACS_R_SESSION and TEXMACS_CMD
> This works nicely. Except when I exit and load the document. Because
> the arguments to the session
> where defined by pressing some keys, the session knows nothing about
> it, so when I enter that session,
> a new session, without these environment variables is started.
>
> Now, I know that this is not the right way to do it.. I just haven't
> found a good way to send arguments to a session.
>
> One suggestion is the following:
> What if a session can have an environment variable called something
> like "session-env" or some such, and when a session
> starts, this environment variable is put in a system environment
> variable TEXMACS_SESSION_ARG or something like that.
> This way program interfaces would have an easy way to store data for a
> certain session.
>
> If this looks ok, I could try to code it.
>
> Michael
>
>
>
>
> Michael
>
> --
>
> Michael Lachmann, Max Planck Institute for Evolutionary Anthropology
> Deutscher Platz 6, 04107 Leipzig, Germany.



reply via email to

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