omar.anto...@gmail.com writes:

> I'm using AucTeX on windows with the SumatraPDF viewer and noticed a
> problem with forward search. I'm editing a file whose name contains
> spaces and the view command AucTeX generates is:
>
> SumatraPDF -reuse-instance -forward-search file name.tex 426 "file name.pdf"
>
> This confuses SumatraPDF (I think it thinks the file is "file", the line
> number is "name.tex" and then additionally tries to open a file named
> "426"). With quotes around "file name.tex" it works correctly:
>
> SumatraPDF -reuse-instance -forward-search "file name.tex" 426 "file name.pdf"
>
> I think that maybe the %b placeholder, which expands to a file name
> relative to the master file's directory, should always be surrounded in
> quotes. (I'm not sure that's actually the best fix for this.) So, as a
> workaround, I've added this to my configuration:
>
> (setq TeX-expand-list
>  '(("%b" (lambda () (format "\"%s\"" 
> (TeX-current-file-name-master-relative))))))

Hi Omar,

thanks for this report.  I can reproduce this on Windows.  Before
patching `TeX-expand-list-builtin', I would like to know if people can
reproduce this on other OSes than windows.  Another idea would be to add
something like this to your init file:

    (setq TeX-view-program-list
          '(("SumatraPDF"
             ("SumatraPDF -reuse-instance"
              (mode-io-correlate " -forward-search \"%b\" %n") " %o")
             "SumatraPDF")))

Note the quotes around %b.  It fixes the issue only for SumatraPDF
without touching the rest.

Best, Arash



_______________________________________________
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex

Reply via email to