Jason (jcreed) wrote,
Jason
jcreed

Debian discovery of the day: old-ass programs that try to access /dev/dsp (such as xmms, which I was able to obtain by adding "deb http://www.pvv.ntnu.no/~knuta/xmms/lenny ./" to my /etc/apt/sources.list — anyone know if there's a more canonical linux mp3 player that the kids are using these days?) can be placated by installing package oss-compat.

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.
Tags: debian, emacs, linux, tex
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 3 comments