[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#30999: 12.1.1; Forward search view command needs quotes around sourc
From: |
Arash Esbati |
Subject: |
bug#30999: 12.1.1; Forward search view command needs quotes around source file name |
Date: |
Mon, 02 Apr 2018 16:05:19 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 |
address@hidden 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#30999: 12.1.1; Forward search view command needs quotes around source file name,
Arash Esbati <=