GNU bug report logs -
#70307
[PATCH] Allow preview to work in non-file buffers
Previous Next
Reported by: Paul Nelson <ultrono <at> gmail.com>
Date: Tue, 9 Apr 2024 10:45:04 UTC
Severity: normal
Tags: patch
Done: Arash Esbati <arash <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Paul Nelson <ultrono <at> gmail.com> writes:
> This patch allows preview.el to work in LaTeX-mode non-file buffers
> for which TeX-master has been set to the name of a valid tex file.
>
> This patch might appear to be adding a new feature, but if I
> understand correctly, it's really fixing an ancient bug. From what I
> can tell, preview.el was carefully designed to support non-file
> buffers, but this support was broken unintentionally in the commit
> 3651776f5a57283f97af54a53a6106519bef41b0.
>
> In more detail, when preview-region is called on a non-file buffer,
> the file name "<none>" is passed along to TeX-region-create. Since
> that commit, the file name is subsequently relativized to the master
> file, even when it is "<none>". As a result, in
> preview-parse-messages, the checks (string= file "<none>") fail in
> cases where they should succeed. This patch makes it so that
> TeX-region-create only relativizes the file name when it is not equal
> to "<none>", so that the checks in question succeed, as was intended.
>
> As motivation, I have been using something equivalent to this patch
> for a while, and have found it very useful in, e.g., indirect org-mode
> source blocks.
Paul, thanks for the patch, the motivation and the change sound
reasonable to me.
@David and Keita: WDYT, any comments?
Best, Arash
This bug report was last modified 1 year and 99 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.