unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Re: tex-mode.el/`tex-view' (diff)
       [not found] <mailman.3714.1098057205.2017.gnu-emacs-sources@gnu.org>
@ 2004-10-18 14:18 ` Stefan Monnier
  0 siblings, 0 replies; only message in thread
From: Stefan Monnier @ 2004-10-18 14:18 UTC (permalink / raw)


> (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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-18 14:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.3714.1098057205.2017.gnu-emacs-sources@gnu.org>
2004-10-18 14:18 ` tex-mode.el/`tex-view' (diff) Stefan Monnier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).