Hello Ikumi

> At last I managed to try your updated patch. It works with preview-latex
> for plain cases, but still doesn't work for file name with space, e.g.
> "abc def.tex", unfortunately.
>
Thanks for testing this.

I was trying to make preview-region work when `TeX-region` has a sub-directory, 
but inadvertently broke the behaviour in the case you mentioned. I now fixed 
the "fix" and the new patch (in the same location) should work for filenames 
with spaces.

>
> Also, I wonder whether it can be simplified or not. Is it really
> necessary to introduce a new variable TeX-command-file-function and
> tweak the argument of TeX-save-document? It seems that Mosè's approach
> doesn't need such complexity. Are TeX-active-master function and
> TeX-current-process-region-p variable deficient for those purposes?
I agree that introducing the new variable is excessive. However, I was trying 
to conform to the implementation of TeX-save-document which accepts the name of 
the document instead of using TeX-active-master or TeX-master-file and the 
implementation of TeX-command which accepts the filename along with a file 
function. I could certainly instead call TeX-active-master instead, but then 
(at least in theory) TeX-command or TeX-save-document might be called with a 
filename or a file-function that is different from TeX-master-file and 
TeX-region-file and their outputs (I thought that was the reason these 
functions accept such arguments) and then my code would break or have an 
unintended behaviour.

Best regards,
-- Al

Reply via email to