[Tex/LaTex] Change view-command in Emacs and AUCTeX (pdf mode)

auctexemacsforward-inverse-searchpdf

My version of Emacs and AUCTeX[1] uses

TeX-evince-sync-view

for viewing pdf.

This command is not working for some reason. Evince is launched but Emacs freezes and I have an error

Couldn't find the Evince instance for file XXX

I don't have the time to debug it and, moreover, I don't need the sync feature.

So, I'm trying to view pdf in a old-fashioned (simple) way (without sync). I tried this code (which used to work several years ago):

(setq TeX-view-program-list '(("Evince" "evince --page-index=%(outpage) %o")))
(setq TeX-view-program-selection '((output-pdf "Evince")))

But there is no change in Emacs. (I still have the problematic command

TeX-evince-sync-view

as default command.)

I tried to do the same but with the graphical interface (Tools>customize AUCTeX>Tex Command>TeX view>Tex-view-program-selection selecting "just" Evince) but no change.

How can I set Evince without sync as the default command for viewing pdf?

[1]Emacs 23.4.1 and AUCTeX 11.85-1 but I have the same problem with emacs-snapshot 24.3.50.1.

Best Answer

Solution: to use `TeX-view-program-list' in order to define a new viewer description (which contains an Evince command without sync). This new command will override the description of Evince defined in `TeX-view-program-list-builtin' (which contains the problematic command TeX-evince-sync-view).

To do so :

M-x customize-variable <RET> TeX-view-program-list <RET>
  <INS>
    Name = Evince
    Command = evince --page-index=%(outpage) %o

I have no idea why this code in .emacs does not work:

(setq TeX-view-program-list '(("Evince" "evince --page-index=%(outpage) %o")))
Related Question