gnu-emacs-sources
[Top][All Lists]
Advanced

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

Re: tex-mode.el/`tex-view' (diff)


From: Stefan Monnier
Subject: Re: tex-mode.el/`tex-view' (diff)
Date: Mon, 18 Oct 2004 14:18:48 GMT
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

> (defun set-tex-dvi-view-command ()
>   (setq tex-dvi-view-command
>       (concat "dvips -o tex-output.ps * && "
>               (if (with-temp-buffer (insert (shell-command-to-string "ps -a"))
>                                     (goto-char (point-min))
>                                     (search-forward-regexp "gv$" nil t))
>                   (concat "ratpoison -c \"select "
>                           (with-temp-buffer (insert (shell-command-to-string 
> "ratpoison -c windows"))
>                                             (goto-char (point-min))
>                                             (search-forward-regexp 
> "\\([0-9]+\\)[-+*]gv.*" nil t)
>                                             (let ((matched (match-string 1)))
>                                               matched))
>                           "\"")
>                 "gv -watch tex-output.ps"))))

Why not create a script like

    #!/bin/sh
    winnum=$(ratpoison -c windows | sed -n -e 's/\([0-9]+\)[-+*]gv.*/\1/p')
    if [ "$winnum" = "" ]; then
        gv -watch "$1"
    else
        ratpoison -c "select $winnum"
    fi

and then use it in tex-dvi-view-command ?
It has the advantage of also working in tex-compile-commands without having
to additionally hack that code.


        Stefan


reply via email to

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