Emacs discovery of the day:
(defun jcreed-tex-file () (interactive) (let ((b (get-buffer "thesis.tex"))) (when b (set-buffer b))) (tex-file) (jcreed-tex-signal) ) (defun jcreed-tex-signal () (interactive) (save-excursion (let* ((proc (tex-shell-proc)) (buf (process-buffer proc)) (string (concat "kill -USR1 " (number-to-string (process-id (get-process "xdvi")))))) ;; Switch to buffer before checking for subproc output in it. (set-buffer buf) (goto-char (process-mark proc)) (insert string) (comint-send-input))))
Seems to accomplish what I want in terms of xdvi updating right away when I TeX a file. In my previous life as a one-screen computer user, this never mattered, since X11 refresh events (occurring as I paged down to it in fvwm2) were enough to tell xdvi that it might want to check whether the file it's visiting is fresh. Now it's just sitting there placidly on the other monitor, and I have to tell it explicitly. Just doing
(signal-process (process-id (get-process "xdvi")) 'usr1)
directly in jcreed-tex-signal wasn't enough, since the signal would get sent before the tex background job had finished. I wonder if there's a nice way of setting up an "after this shell command is done hook" in comint.