Subject: Re: bug#73854: 29.4; tex-mode: unexpected and inconsistent behaviour of `tex-compile`, `tex-file`, and `tex-view`

From: Eli Zaretskii <[email-masked]>
Date: Mon, 21 Oct 2024 12:55:01 +0300

> From: Stephen Berman <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  [email-masked],
>   [email-masked]
> Date: Mon, 21 Oct 2024 11:22:02 +0200
> 
> > diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
> > index 6fc49800018..f27bd1620e1 100644
> > --- a/lisp/textmodes/tex-mode.el
> > +++ b/lisp/textmodes/tex-mode.el
> > @@ -2212,6 +2212,7 @@ tex-compile-commands
> >       t "%r.dvi")
> >      ("xdvi %r &" "%r.dvi")
> >      ("\\doc-view \"%r.pdf\"" "%r.pdf")
> > +    ("evince %r.pdf &" "%r.pdf")
> >      ("xpdf %r.pdf &" "%r.pdf")
> >      ("gv %r.ps &" "%r.ps")
> >      ("yap %r &" "%r.dvi")
> 
> Indeed, with a suitable entry for viewing a PDF, typing `C-c C-c' twice
> does the job.  In my case, however, a suitable entry is not evince,
> since I don't have that program installed here, but I do have mupdf and
> with an entry for it, `C-c C-c' calls it and the PDF is displayed.  So
> this raises the question of whether tex-compile-commands should be
> enhanced with all known free software PDF viewers, or, more
> maintainer-friendly, turned into a defcustom, so users can just added
> their preferred entries.  But that's a complementary issue to the
> present bug report, since without my patch for tex-compile even with a
> suitable entry in tex-compile-commands, `C-c C-v' (tex-view) still
> complains "No appropriate ‘.dvi’ file could be found" and does not call
> the program specified by tex-dvi-view-command to display the PDF.  So
> should I just go ahead and install my patch?  And if so, to master or to
> emacs-30 (which has the same issue)?

Please install on master, and thanks.

As for the patch to tex-compile-commands, I think both evince and
mupdf entries should be added to it.  Whether to make it a defcustom
is a separate issue, with much wider consequences, and I wouldn't do
that at this time.