[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] showing xdvi messages
From: |
Ralf Angeli |
Subject: |
Re: [AUCTeX] showing xdvi messages |
Date: |
Wed, 28 Dec 2005 10:17:25 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
* Werner LEMBERG (2005-12-28) writes:
>> Maybe xdvi aborts
>> because it cannot write to stdout?
>
> I have no idea :-) What do you think about contacting the emacs-devel
> list? They can probably help...
I guess I should read something about `fork' before asking there and
wasting people's time. Meanwhile I found the following code snippet
while grepping through xdvik's sources in xdvi-search.el:
(if (xdvi-has-nofork (car xdvi-version-info) (car (cdr xdvi-version-info)))
(progn
(setq proc
(start-process "xdvi" "*xdvi output*"
xdvi-bin
"-nofork"
"-sourceposition"
(concat (int-to-string curr-line) " " filename)
dvi-file))
(set-process-sentinel proc 'xdvi-process-sentinel))
;;;
;;; More complicated if we don't have nofork: start a
;;; subshell, since otherwise there's no way of viewing
;;; the stderr/stdout output of the xdvi child process
;;; without having either xdvi freezing, Emacs freezing,
;;; or Emacs killing the xdvi child process (which is
;;; forked when running with -sourceposition).
;;;
;;; Obtain the type of I/O-redirection needed for current shell:
(let* ((default-shell
(or (and (boundp 'explicit-shell-file-name)
explicit-shell-file-name)
(getenv "ESHELL")
(getenv "SHELL")
[...]
That means we could work around the problem by calling xdvi with
-nofork. I just have to check for how long this option has been
supported in xdvik and if the non-k xdvi supports it, too. Then we
can decide if we simply have to add -nofork to the xdvi call and are
done.
I don't know how common it is that applications which fork and write
stuff to stdout are called from within Emacs. But if this happens on
a frequent basis it would be interesting to know if Emacs could
support this. That could be asked on emacs-devel, but if possible
with an easier testcase than calling xdvi with -sourceposition.
--
Ralf