Subject: bug#70307: closed (Re: bug#70307: [PATCH] Allow preview to work in non-file buffers)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 11 Apr 2024 18:10:02 +0000

Your bug report

#70307: [PATCH] Allow preview to work in non-file buffers

which was filed against the auctex package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
70307: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70307
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#70307: [PATCH] Allow preview to work in non-file buffers
From: Arash Esbati <[email-masked]>
To: Ikumi Keita <[email-masked]>
Cc: David Kastrup <[email-masked]>, [email-masked], Paul Nelson <[email-masked]>
Date: Thu, 11 Apr 2024 20:09:15 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Ikumi Keita <[email-masked]> writes:

>>>>>> Arash Esbati <[email-masked]> writes:
>> @David and Keita: WDYT, any comments?
>
> This makes difference only when the file name is "<none>", so it
> wouldn't affect almost all regular usage. Thus I'm fine with applying
> this change.

Gents, thanks for preparing and commenting this change which I just
installed.  Therefore I'm closing this report.

Best, Arash

Subject: [PATCH] Allow preview to work in non-file buffers
From: Paul Nelson <[email-masked]>
To: [email-masked]
Date: Tue, 9 Apr 2024 12:44:14 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

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.

Thanks, best,

Paul