GNU bug report logs - #70307
[PATCH] Allow preview to work in non-file buffers

Previous Next

Package: auctex;

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>

To reply to this bug, email your comments to 70307 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-auctex <at> gnu.org:
bug#70307; Package auctex. (Tue, 09 Apr 2024 10:45:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Nelson <ultrono <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-auctex <at> gnu.org. (Tue, 09 Apr 2024 10:45:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Nelson <ultrono <at> gmail.com>
To: bug-auctex <at> gnu.org
Subject: [PATCH] Allow preview to work in non-file buffers
Date: Tue, 9 Apr 2024 12:44:14 +0200
[Message part 1 (text/plain, inline)]
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
[0001-Allow-preview-to-work-in-non-file-buffers.patch (application/octet-stream, attachment)]

Information forwarded to bug-auctex <at> gnu.org:
bug#70307; Package auctex. (Wed, 10 Apr 2024 08:44:05 GMT) Full text and rfc822 format available.

Message #8 received at 70307 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Paul Nelson <ultrono <at> gmail.com>, David Kastrup <dak <at> gnu.org>, Ikumi
 Keita <ikumi <at> ikumi.que.jp>
Cc: 70307 <at> debbugs.gnu.org
Subject: Re: bug#70307: [PATCH] Allow preview to work in non-file buffers
Date: Wed, 10 Apr 2024 10:43:20 +0200
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




Information forwarded to bug-auctex <at> gnu.org:
bug#70307; Package auctex. (Thu, 11 Apr 2024 16:49:02 GMT) Full text and rfc822 format available.

Message #11 received at 70307 <at> debbugs.gnu.org (full text, mbox):

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Arash Esbati <arash <at> gnu.org>
Cc: David Kastrup <dak <at> gnu.org>, 70307 <at> debbugs.gnu.org,
 Paul Nelson <ultrono <at> gmail.com>
Subject: Re: bug#70307: [PATCH] Allow preview to work in non-file buffers
Date: Fri, 12 Apr 2024 01:47:52 +0900
Hi Arash,

>>>>> Arash Esbati <arash <at> gnu.org> 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.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW




Reply sent to Arash Esbati <arash <at> gnu.org>:
You have taken responsibility. (Thu, 11 Apr 2024 18:10:02 GMT) Full text and rfc822 format available.

Notification sent to Paul Nelson <ultrono <at> gmail.com>:
bug acknowledged by developer. (Thu, 11 Apr 2024 18:10:02 GMT) Full text and rfc822 format available.

Message #16 received at 70307-done <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: David Kastrup <dak <at> gnu.org>, 70307-done <at> debbugs.gnu.org,
 Paul Nelson <ultrono <at> gmail.com>
Subject: Re: bug#70307: [PATCH] Allow preview to work in non-file buffers
Date: Thu, 11 Apr 2024 20:09:15 +0200
Ikumi Keita <ikumi <at> ikumi.que.jp> writes:

>>>>>> Arash Esbati <arash <at> gnu.org> 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




This bug report was last modified 22 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.