texmacs-dev
[Top][All Lists]
Advanced

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

[Texmacs-dev] Problem with invoking unix command from TeXmacs experiment


From: Krzysztof Retel
Subject: [Texmacs-dev] Problem with invoking unix command from TeXmacs experimental plugin
Date: Fri, 01 Jun 2007 11:22:04 +0100
User-agent: Thunderbird 1.5.0.9 (X11/20070102)

Hello Developers,

I'm writing a plugin in which I invoke external unix command from TeXmacs. In the plugin I use bits of Scheme source code (written originally by Henri and/or Chad Brown):

;; UNIX commands. To invoke a command from TeXmacs.
(begin
  (use-modules (ice-9 popen))
  (define (unix-command cmd)
     (let* ((p (open-input-pipe cmd))
           (out (read-delimited "" p)))
       (if (eof-object? out) "" (string-split out #\newline)))))

I use it like that:
(unix-command "dot -Tps temp.mathlang.dra2dg.dot -o temp.mathlang.dra2dg.ps")
(unix-command "gv temp.mathlang.dra2dg.ps")

However, I can't do much of the viewed file with gv, e.g. I can't resize the gv window, or even go back and work within TeXmacs, unless I close the window. I guess the problem is with the opened-pipe ((open-input-pipe cmd)) and (eof-object? out). I tried to close the pipe with command (close-pipe) but it didn't work.

Hope I was clear and somebody could help me with that.

Kind Regards,
Krzysztof Retel






reply via email to

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