GNU bug report logs - #62445
13.1.10; bug in preview-region applied to repeated math environments

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: auctex; Reported by: Paul Nelson <ultrono@HIDDEN>; dated Sat, 25 Mar 2023 16:16:01 UTC; Maintainer for auctex is bug-auctex@HIDDEN.

Message received at 62445 <at> debbugs.gnu.org:


Received: (at 62445) by debbugs.gnu.org; 25 Mar 2023 16:46:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 25 12:46:13 2023
Received: from localhost ([127.0.0.1]:43338 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg71w-00042A-9z
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 12:46:12 -0400
Received: from mail-qk1-f179.google.com ([209.85.222.179]:36379)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ultrono@HIDDEN>) id 1pg71u-00041l-AY
 for 62445 <at> debbugs.gnu.org; Sat, 25 Mar 2023 12:46:11 -0400
Received: by mail-qk1-f179.google.com with SMTP id q2so1332553qki.3
 for <62445 <at> debbugs.gnu.org>; Sat, 25 Mar 2023 09:46:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679762764;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=SE8WPAVmsvXFIEilAwVlQaMFGYocSb0fximViLmPJto=;
 b=CsJtAnNr65KG3YL3Su5kxZw+PBxM5Rb9corDokmZTOpu56DMBuAzkbIE4Qjm33KbkF
 JI5NPDFHs4/xynf5QwxHV5ECfugQzAzoOaBtiXDJuw8LmnYe/UF56GyUBuMaG+QMbiHH
 M09yzkoJpICEZB73AIoOzrt9nED4yySJcCPkmQhM6OUEeZ7NNaUxm70K9HBAu4yZk8ID
 MjPiPVE5i7JXmR5rxWW222vzI8SNGTOSA0usGOfu9rJ4SE6bWhkRXT/sF5KmPsknn6cb
 6PyjeiC2FmHIkGbl+ZrfO2xs8J0nvY5aI3uFqKkS0tkDgWpWvEMK6IFHWvkxt7oTjcoO
 2ZEA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679762764;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=SE8WPAVmsvXFIEilAwVlQaMFGYocSb0fximViLmPJto=;
 b=Op83NilF5pqNK9yr335udGGtbnHmgByouJXeuBqKjkI8GHJb2ptbszh4B3BU8vp3fl
 97Ie4zo0wKxuqgwboj1UJJeCz+Gcewijb97DGqfQxmTxf+TwM7HgU50Kjj50b9Sg/J/S
 db6V533EZJFTrBEKMiLtTxsXwOTZqxJP+JlOWqP8OXnoP08iAaEYtgL2v94z7CVwIZ2a
 Tkp7Yar604kbMZrrIzmw06nIkbGA4zzhu77xfZA1OSGZ67Wb5BtHw/RimkdxVRPVqlc2
 M7wWtx5Snj/OcxEzABGHmd3OrY7JChJnOYIvYbfmZygupYC2CgwT2Xqy3G2A5I/4L/bX
 iymQ==
X-Gm-Message-State: AO0yUKV6CdxxiRuAkKfbVvm9lTBUlG5p6YOie00ZI0t8KR+lGKMGN+Gs
 YeueV3c2lF0cHSpK1fM5hS8n0CyATIwa4HeSEIi9jxUF/Uw=
X-Google-Smtp-Source: AK7set+O2ipGcjlA9wsngQBRH97njZJ2hhA9d0kY2i5kwlHl0Lo+o7n5IeMenDyNm2NoIMNcgXNW+ho0crXbFuimUyo=
X-Received: by 2002:a05:620a:178d:b0:742:9e15:3e0 with SMTP id
 ay13-20020a05620a178d00b007429e1503e0mr1629947qkb.5.1679762764420; Sat, 25
 Mar 2023 09:46:04 -0700 (PDT)
MIME-Version: 1.0
References: <CAOA-32OT5u8cgYUT2qFDMiK3Sj9=JTsohiu62yswkj0SEatc-w@HIDDEN>
 <87h6u8lr6p.fsf@HIDDEN>
In-Reply-To: <87h6u8lr6p.fsf@HIDDEN>
From: Paul Nelson <ultrono@HIDDEN>
Date: Sat, 25 Mar 2023 17:45:52 +0100
Message-ID: <CAOA-32O29CDUVoaRQfCjETLy5fvVNQz6VnFYBkp8LdVgjGG7QQ@HIDDEN>
Subject: Re: bug#62445: 13.1.10; bug in preview-region applied to repeated
 math environments
To: David Kastrup <dak@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000e159d805f7bc3eea"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 62445
Cc: 62445 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000e159d805f7bc3eea
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thanks for your response.  Here is my complete *_region_ output* for the
example I described.  -file-line-error already seems to be included.
Please let me know if I missed something.

Running `Preview-LaTeX' on `~/doit/_region_' with ``pdflatex
 -file-line-error   --synctex=3D1
"\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview=
}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,float=
s,graphics,textmath,sections,footnotes,showlabels]{preview}[2004/11/05]\fi}=
"
"\input" "\detokenize{" _region_.tex "}"''
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded
format=3Dpdflatex)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06>
No auxiliary output files.

(./_region_.tex  !name(test.tex)
(/usr/local/texlive/2020/texmf-dist/tex/latex/amscls/amsart.cls
Document Class: amsart 2017/10/31 v2.20.4
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.d=
ef)
No file _region_.aux.
(/Users/paulnelson/.emacs.d/elpa/auctex-13.1.10/latex/preview.sty
(/usr/local/texlive/2020/texmf-dist/tex/generic/luatex85/luatex85.sty)
(/Users/paulnelson/.emacs.d/elpa/auctex-13.1.10/latex/prtightpage.def)
(/Users/paulnelson/.emacs.d/elpa/auctex-13.1.10/latex/prauctex.def
No auxiliary output files.


(/Users/paulnelson/.emacs.d/elpa/auctex-13.1.10/latex/prauctex.cfg))
(/Users/paulnelson/.emacs.d/elpa/auctex-13.1.10/latex/prfootnotes.def)
(/Users/paulnelson/.emacs.d/elpa/auctex-13.1.10/latex/prshowlabels.def)
Preview: Fontsize 10pt
Preview: PDFoutput 1
) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/umsb.fd)
 !name(test.tex) !offset(-2)
./_region_.tex:5: Preview: Snippet 1 started.
<-><->

l.5 $
     x$
Preview: Tightpage -32891 -32891 32891 32891
./_region_.tex:5: Preview: Snippet 1 ended.(282168+0x374556).
<-><->

l.5 $x$

[1{/usr/local/texlive/2020/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
 !name(test.tex) !offset(-4)
\newlabel{tocindent-1}{0pt}
\newlabel{tocindent0}{0pt}
\newlabel{tocindent1}{0pt}
\newlabel{tocindent2}{0pt}
\newlabel{tocindent3}{0pt}
 )
(see the transcript file for additional
information)</usr/local/texlive/2020/texmf-dist/fonts/type1/public/amsfonts=
/cm/cmmi10.pfb>
Output written on _region_.pdf (1 page, 8292 bytes).
SyncTeX written on _region_.synctex.gz.
Transcript written on _region_.log.

TeX Output exited as expected with code 1 at Sat Mar 25 17:42:58
Running `Preview-PDF2DSC' with ``pdf2dsc _region_.pdf
_region_.prv/tmpAnnFJy/preview.dsc''

Preview-PDF2DSC finished at Sat Mar 25 17:42:58
Running `Preview-Ghostscript' with ``/usr/local/bin/gs
-sOutputFile\=3D_region_.prv/tmpAnnFJy/pr1-\%d.pbm -q -dNOPAUSE -dNOSAFER
-DNOPLATFONTS -dPrinted -dTextAlphaBits\=3D4 -dGraphicsAlphaBits\=3D4
-sDEVICE\=3Dpnmraw -r238.169x239.282''

Preview-Ghostscript finished at Sat Mar 25 17:42:58

On Sat, Mar 25, 2023 at 5:41=E2=80=AFPM David Kastrup <dak@HIDDEN> wrote:

> Paul Nelson <ultrono@HIDDEN> writes:
>
> > Emacs  : GNU Emacs 29.0.50 (build 3, x86_64-apple-darwin21.6.0, NS
> > appkit-2113.60 Version 12.6 (Build 21G115))
> >  of 2022-11-06
> > Package: 13.1.10
> >
> > Take the following document:
> >
> > #+begin_src latex
> > \documentclass{amsart}
> > \begin{document}
> >  $x$ $x$
> > \end{document}
> > #+end_src
> >
> >
> > Run ~preview-region~ on the region consisting of the first $x$.  This
> works
> > as expected.
> >
> > Next, run ~preview-region~ on the region consisting of just the second
> > $x$.  This does not preview the second $x$.  Instead, it refreshes the
> > overlay on the first $x$.
> >
> > The relevant output:
> >
> > #+begin_quote
> > ./_region_.tex:5: Preview: Snippet 1 started.
> > <-><->
> >
> > l.5 $
> >      x$
> > Preview: Tightpage -32891 -32891 32891 32891
> > ./_region_.tex:5: Preview: Snippet 1 ended.(282168+0x374556).
> > <-><->
> >
> > l.5 $x$
> >
> > #+end_quote
> >
> >
> > The issue here is that there's not enough context for
> > ~preview-parse-messages~ to determine which $x$ to overlay.
>
> I'd just add -file-line-error to the options you are calling TeX with.
> That makes for more reliable error message interpretation.
>
> --
> David Kastrup
>

--000000000000e159d805f7bc3eea
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thanks for your response.=C2=A0 Here is my complete *_regi=
on_ output* for the example I described.=C2=A0 -file-line-error already see=
ms to be included.=C2=A0 Please let me know if I missed something.<div></di=
v><div><br></div><div>Running `Preview-LaTeX&#39; on `~/doit/_region_&#39; =
with ``pdflatex =C2=A0-file-line-error =C2=A0 --synctex=3D1 &quot;\nonstopm=
ode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginD=
ocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics=
,textmath,sections,footnotes,showlabels]{preview}[2004/11/05]\fi}&quot; &qu=
ot;\input&quot; &quot;\detokenize{&quot; _region_.tex &quot;}&quot;&#39;&#3=
9;<br>This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (prelo=
aded format=3Dpdflatex)<br>=C2=A0restricted \write18 enabled.<br>entering e=
xtended mode<br>LaTeX2e &lt;2020-02-02&gt; patch level 5<br>L3 programming =
layer &lt;2020-03-06&gt;<br>No auxiliary output files.<br><br>(./_region_.t=
ex =C2=A0!name(test.tex) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsc=
ls/amsart.cls<br>Document Class: amsart 2017/10/31 v2.20.4<br>(/usr/local/t=
exlive/2020/texmf-dist/tex/latex/amsmath/amsmath.sty<br>For additional info=
rmation on amsmath, use the `?&#39; option.<br>(/usr/local/texlive/2020/tex=
mf-dist/tex/latex/amsmath/amstext.sty (/usr/local/texlive/2020/texmf-dist/t=
ex/latex/amsmath/amsgen.sty)) (/usr/local/texlive/2020/texmf-dist/tex/latex=
/amsmath/amsbsy.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/=
amsopn.sty)) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/umsa.fd=
) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/u=
sr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def)=
<br>No file _region_.aux.<br>(/Users/paulnelson/.emacs.d/elpa/auctex-13.1.1=
0/latex/preview.sty (/usr/local/texlive/2020/texmf-dist/tex/generic/luatex8=
5/luatex85.sty) (/Users/paulnelson/.emacs.d/elpa/auctex-13.1.10/latex/prtig=
htpage.def) (/Users/paulnelson/.emacs.d/elpa/auctex-13.1.10/latex/prauctex.=
def<br>No auxiliary output files.<br><br><br>(/Users/paulnelson/.emacs.d/el=
pa/auctex-13.1.10/latex/prauctex.cfg)) (/Users/paulnelson/.emacs.d/elpa/auc=
tex-13.1.10/latex/prfootnotes.def) (/Users/paulnelson/.emacs.d/elpa/auctex-=
13.1.10/latex/prshowlabels.def)<br>Preview: Fontsize 10pt<br>Preview: PDFou=
tput 1<br>) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/umsa.fd)=
 (/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/umsb.fd) =C2=A0!nam=
e(test.tex) !offset(-2) <br>./_region_.tex:5: Preview: Snippet 1 started.<b=
r>&lt;-&gt;&lt;-&gt;<br>=C2=A0 =C2=A0 =C2=A0 <br>l.5 $<br>=C2=A0 =C2=A0 =C2=
=A0x$<br>Preview: Tightpage -32891 -32891 32891 32891<br>./_region_.tex:5: =
Preview: Snippet 1 ended.(282168+0x374556).<br>&lt;-&gt;&lt;-&gt;<br>=C2=A0=
 =C2=A0 =C2=A0 <br>l.5 $x$<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0<br>[1{/usr/local/=
texlive/2020/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] =C2=A0!name(tes=
t.tex) !offset(-4) <br>\newlabel{tocindent-1}{0pt}<br>\newlabel{tocindent0}=
{0pt}<br>\newlabel{tocindent1}{0pt}<br>\newlabel{tocindent2}{0pt}<br>\newla=
bel{tocindent3}{0pt}<br>=C2=A0)<br>(see the transcript file for additional =
information)&lt;/usr/local/texlive/2020/texmf-dist/fonts/type1/public/amsfo=
nts/cm/cmmi10.pfb&gt;<br>Output written on _region_.pdf (1 page, 8292 bytes=
).<br>SyncTeX written on _region_.synctex.gz.<br>Transcript written on _reg=
ion_.log.<br><br>TeX Output exited as expected with code 1 at Sat Mar 25 17=
:42:58<br>Running `Preview-PDF2DSC&#39; with ``pdf2dsc _region_.pdf _region=
_.prv/tmpAnnFJy/preview.dsc&#39;&#39;<br><br>Preview-PDF2DSC finished at Sa=
t Mar 25 17:42:58<br>Running `Preview-Ghostscript&#39; with ``/usr/local/bi=
n/gs -sOutputFile\=3D_region_.prv/tmpAnnFJy/pr1-\%d.pbm -q -dNOPAUSE -dNOSA=
FER -DNOPLATFONTS -dPrinted -dTextAlphaBits\=3D4 -dGraphicsAlphaBits\=3D4 -=
sDEVICE\=3Dpnmraw -r238.169x239.282&#39;&#39;<br><br>Preview-Ghostscript fi=
nished at Sat Mar 25 17:42:58<br></div></div><br><div class=3D"gmail_quote"=
><div dir=3D"ltr" class=3D"gmail_attr">On Sat, Mar 25, 2023 at 5:41=E2=80=
=AFPM David Kastrup &lt;<a href=3D"mailto:dak@HIDDEN">dak@HIDDEN</a>&gt; =
wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Paul Nels=
on &lt;<a href=3D"mailto:ultrono@HIDDEN" target=3D"_blank">ultrono@gmail=
.com</a>&gt; writes:<br>
<br>
&gt; Emacs=C2=A0 : GNU Emacs 29.0.50 (build 3, x86_64-apple-darwin21.6.0, N=
S<br>
&gt; appkit-2113.60 Version 12.6 (Build 21G115))<br>
&gt;=C2=A0 of 2022-11-06<br>
&gt; Package: 13.1.10<br>
&gt;<br>
&gt; Take the following document:<br>
&gt;<br>
&gt; #+begin_src latex<br>
&gt; \documentclass{amsart}<br>
&gt; \begin{document}<br>
&gt;=C2=A0 $x$ $x$<br>
&gt; \end{document}<br>
&gt; #+end_src<br>
&gt;<br>
&gt;<br>
&gt; Run ~preview-region~ on the region consisting of the first $x$.=C2=A0 =
This works<br>
&gt; as expected.<br>
&gt;<br>
&gt; Next, run ~preview-region~ on the region consisting of just the second=
<br>
&gt; $x$.=C2=A0 This does not preview the second $x$.=C2=A0 Instead, it ref=
reshes the<br>
&gt; overlay on the first $x$.<br>
&gt;<br>
&gt; The relevant output:<br>
&gt;<br>
&gt; #+begin_quote<br>
&gt; ./_region_.tex:5: Preview: Snippet 1 started.<br>
&gt; &lt;-&gt;&lt;-&gt;<br>
&gt;<br>
&gt; l.5 $<br>
&gt;=C2=A0 =C2=A0 =C2=A0 x$<br>
&gt; Preview: Tightpage -32891 -32891 32891 32891<br>
&gt; ./_region_.tex:5: Preview: Snippet 1 ended.(282168+0x374556).<br>
&gt; &lt;-&gt;&lt;-&gt;<br>
&gt;<br>
&gt; l.5 $x$<br>
&gt;<br>
&gt; #+end_quote<br>
&gt;<br>
&gt;<br>
&gt; The issue here is that there&#39;s not enough context for<br>
&gt; ~preview-parse-messages~ to determine which $x$ to overlay.<br>
<br>
I&#39;d just add -file-line-error to the options you are calling TeX with.<=
br>
That makes for more reliable error message interpretation.<br>
<br>
-- <br>
David Kastrup<br>
</blockquote></div>

--000000000000e159d805f7bc3eea--




Information forwarded to bug-auctex@HIDDEN:
bug#62445; Package auctex. Full text available.

Message received at 62445 <at> debbugs.gnu.org:


Received: (at 62445) by debbugs.gnu.org; 25 Mar 2023 16:41:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 25 12:41:39 2023
Received: from localhost ([127.0.0.1]:43333 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg6xT-0003tc-13
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 12:41:39 -0400
Received: from [209.51.188.92] (port=39382 helo=eggs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dak@HIDDEN>) id 1pg6xN-0003tC-3q
 for 62445 <at> debbugs.gnu.org; Sat, 25 Mar 2023 12:41:33 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <dak@HIDDEN>)
 id 1pg6x9-0001lg-SQ; Sat, 25 Mar 2023 12:41:15 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=nZ87OYga/0hoh1+otHgAbooVLL7tuKWcWL1wqWKKhjw=; b=nZrHR+oC4DRV6/IHsWr/
 ueeD95QiEr9dvlsu66DXw4xc9vuV7VVzPrGyqIuPv4BSD3rUJuKzeq1UQoQ9zh/gjgtuRffDfc8Ff
 CRWm+4U9gUUAnJdCr14GSB7MT8SD214UwmQk/HQL1EM7lCdysb1Y1b7C/1gRLdFRCus4dP7tLIFOe
 +vGznxRS9wMN7V0vBdFYQanb7WyyffxBDXRkGSyH/JV7ItKaT7/W5r8mBUZi+qmFJISwwUIEzgOrH
 GDlG5TqGR0llniSWzDUeeafs2YLInYoxzO5DZedAB5QzAIi7HC/36hsYzn6qaRVySrvK0/DOEmFlw
 tgClciCnu0LAQA==;
Received: from dynamic-078-049-004-142.78.49.pool.telefonica.de ([78.49.4.142]
 helo=lola)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <dak@HIDDEN>)
 id 1pg6x7-0006zD-Aj; Sat, 25 Mar 2023 12:41:13 -0400
From: David Kastrup <dak@HIDDEN>
To: Paul Nelson <ultrono@HIDDEN>
Subject: Re: bug#62445: 13.1.10; bug in preview-region applied to repeated
 math environments
In-Reply-To: <CAOA-32OT5u8cgYUT2qFDMiK3Sj9=JTsohiu62yswkj0SEatc-w@HIDDEN>
 (Paul Nelson's message of "Sat, 25 Mar 2023 17:14:48 +0100")
References: <CAOA-32OT5u8cgYUT2qFDMiK3Sj9=JTsohiu62yswkj0SEatc-w@HIDDEN>
Date: Sat, 25 Mar 2023 17:41:02 +0100
Message-ID: <87h6u8lr6p.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.0 (-)
X-Debbugs-Envelope-To: 62445
Cc: 62445 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.0 (--)

Paul Nelson <ultrono@HIDDEN> writes:

> Emacs  : GNU Emacs 29.0.50 (build 3, x86_64-apple-darwin21.6.0, NS
> appkit-2113.60 Version 12.6 (Build 21G115))
>  of 2022-11-06
> Package: 13.1.10
>
> Take the following document:
>
> #+begin_src latex
> \documentclass{amsart}
> \begin{document}
>  $x$ $x$
> \end{document}
> #+end_src
>
>
> Run ~preview-region~ on the region consisting of the first $x$.  This works
> as expected.
>
> Next, run ~preview-region~ on the region consisting of just the second
> $x$.  This does not preview the second $x$.  Instead, it refreshes the
> overlay on the first $x$.
>
> The relevant output:
>
> #+begin_quote
> ./_region_.tex:5: Preview: Snippet 1 started.
> <-><->
>
> l.5 $
>      x$
> Preview: Tightpage -32891 -32891 32891 32891
> ./_region_.tex:5: Preview: Snippet 1 ended.(282168+0x374556).
> <-><->
>
> l.5 $x$
>
> #+end_quote
>
>
> The issue here is that there's not enough context for
> ~preview-parse-messages~ to determine which $x$ to overlay.

I'd just add -file-line-error to the options you are calling TeX with.
That makes for more reliable error message interpretation.

-- 
David Kastrup




Information forwarded to bug-auctex@HIDDEN:
bug#62445; Package auctex. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Mar 2023 16:15:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 25 12:15:07 2023
Received: from localhost ([127.0.0.1]:43302 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg6Xq-00035J-Ge
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 12:15:07 -0400
Received: from lists.gnu.org ([209.51.188.17]:47478)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ultrono@HIDDEN>) id 1pg6Xo-000359-Oj
 for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 12:15:05 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ultrono@HIDDEN>) id 1pg6Xo-0001TF-A1
 for bug-auctex@HIDDEN; Sat, 25 Mar 2023 12:15:04 -0400
Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ultrono@HIDDEN>) id 1pg6Xm-0000HA-DP
 for bug-auctex@HIDDEN; Sat, 25 Mar 2023 12:15:04 -0400
Received: by mail-qk1-x733.google.com with SMTP id o82so1311752qka.11
 for <bug-auctex@HIDDEN>; Sat, 25 Mar 2023 09:15:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679760900;
 h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=oR23v2nLRczpC5td1mkDLtBQN4CfteWV7zKJg0Yz/YQ=;
 b=SC8arunPX2HwiKy92CUZAaYoHea0NZvVrvFHOt7BeYXKJVRGwxWUfMZWkJX/Igsia/
 XrLV0yiauIq5CVmy87xh2EM2m1UxOvX/w8bwG9Dmkws+4fi61hMLlMvk8yZmHcPCfOey
 LF4ODFj9XEcVTurKq0PjXDgp/ZkPepqUCrVP65ZaRf/xrGgDNR8bLWKMTeNYid0eDsh/
 pvImG0diH//Z/ZTY4aOhnMFW1rNdnlusDKTbesPO6/8muymI/EoDtdFSfhgT5OWGinC3
 UT1FfoLiLGgWrtzquf/CWK++PJhjJpjURQdOV5UAeoKF9Tw1ovvAFXz2gdwfCqxI6AQc
 cF2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679760900;
 h=to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=oR23v2nLRczpC5td1mkDLtBQN4CfteWV7zKJg0Yz/YQ=;
 b=pZKo6fYe2S6RrB5V48aoobHT4wlD2CuFqRAkaRhEAVY+IHQ5Q4PhtZ7JzWU7c0CvSX
 Sr7+dZV/qVCAxt4LPTKdHkT5BP3Kjjv4pRpS/IZ2/FE2+rcAE/jaXyWmwnayI0ysppdD
 a7IsZgg/NnVdBxJcjE/O8sn2ID77JmuHbVlq0IiwK5nFZ7pbDZDzVU/XhB265Vx21Gta
 PPGircrgTpP0O1mWlQGfeWO7fsjtdGrv/n6fyUsk8d6S9acH8hY/TTKdvQAufIAuppF2
 Tw+zfIL54ae2AEtC8MqhaLuUJZ/t+JoaYJIuyBN/+1uxsLPmWp2xnCo9oDnvERklsnmD
 mBAw==
X-Gm-Message-State: AO0yUKXa5cvAmONvoYHAPywB3gJTvZCG+0fKX6Q18ySWEGSwkQ03z+nA
 0CUDEWXLikU33rtam7iGBLN4bn4cxbxHLGpV4Vi1igbuVUo=
X-Google-Smtp-Source: AK7set9orLQ+2Z2Ig37uJCACDwcrRkjKcLhyIk05rsPrsV7aM6/JwPSiw7fBRdIxYwxiA+nL/Wo+KbP5AEH/GIWnMyw=
X-Received: by 2002:a37:ef0e:0:b0:71f:b89c:5ac4 with SMTP id
 j14-20020a37ef0e000000b0071fb89c5ac4mr982640qkk.5.1679760899688; Sat, 25 Mar
 2023 09:14:59 -0700 (PDT)
MIME-Version: 1.0
From: Paul Nelson <ultrono@HIDDEN>
Date: Sat, 25 Mar 2023 17:14:48 +0100
Message-ID: <CAOA-32OT5u8cgYUT2qFDMiK3Sj9=JTsohiu62yswkj0SEatc-w@HIDDEN>
Subject: 13.1.10; bug in preview-region applied to repeated math environments
To: bug-auctex@HIDDEN
Content-Type: multipart/alternative; boundary="000000000000bbcd5705f7bbcfb5"
Received-SPF: pass client-ip=2607:f8b0:4864:20::733;
 envelope-from=ultrono@HIDDEN; helo=mail-qk1-x733.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--000000000000bbcd5705f7bbcfb5
Content-Type: text/plain; charset="UTF-8"

Emacs  : GNU Emacs 29.0.50 (build 3, x86_64-apple-darwin21.6.0, NS
appkit-2113.60 Version 12.6 (Build 21G115))
 of 2022-11-06
Package: 13.1.10

Take the following document:

#+begin_src latex
\documentclass{amsart}
\begin{document}
 $x$ $x$
\end{document}
#+end_src

Run ~preview-region~ on the region consisting of the first $x$.  This works
as expected.

Next, run ~preview-region~ on the region consisting of just the second
$x$.  This does not preview the second $x$.  Instead, it refreshes the
overlay on the first $x$.

The relevant output:

#+begin_quote
./_region_.tex:5: Preview: Snippet 1 started.
<-><->

l.5 $
     x$
Preview: Tightpage -32891 -32891 32891 32891
./_region_.tex:5: Preview: Snippet 1 ended.(282168+0x374556).
<-><->

l.5 $x$

#+end_quote

The issue here is that there's not enough context for
~preview-parse-messages~ to determine which $x$ to overlay.

One workaround would be to apply ~preview-region~ to a region containing
both $x$'s (or to use ~preview-buffer~, etc).  This workaround wasn't ideal
for my use-case (see parenthetical comment at the bottom).

I think a fix would be to store the beginning of the region being previewed
in a buffer-local variable and, if needed, bump the point when searching
for where to place the overlay.  Details:

- Add the following line somewhere in preview.el:
  #+begin_src elisp
  (defvar-local preview-region--begin nil "Start of region being
processed.")
  #+end_src

- Add the following line to ~preview-region~, just before the invocation of
~preview-generate-preview~:
  #+begin_src elisp
  (setq-local preview-region--begin begin)
  #+end_src

- Add this to ~preview-parse-messages~, just before the second ~cond~ block:
  #+begin_src elisp
  (when (< (point) preview-region--begin)
    (goto-char preview-region--begin))
  #+end_src

I've made these changes in my local version and they have worked for me.

(This bug was an issue for me because I had set up a timer that searches
the visible portion of a TeX buffer for unrendered math environments and
runs ~preview-region~ on contiguous unpreviewed blocks.  This led to many
situations where  ~preview-region~ was called on math regions, such as the
second $x$ in the above example, that had already been previewed in the
current line.  My original workaround was to enlarge the region sent to
~preview-region~ to contain any repeated math regions that appear earlier
in a given line.  This worked, but often resulted in many fragments getting
unnecessarily refreshed.)

--000000000000bbcd5705f7bbcfb5
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Emacs =C2=A0: GNU Emacs 29.0.50 (build 3, x86_64-apple-dar=
win21.6.0, NS appkit-2113.60 Version 12.6 (Build 21G115))<br>=C2=A0of 2022-=
11-06<br>Package: 13.1.10<br><br>Take the following document:<br>=C2=A0 =C2=
=A0<br>#+begin_src latex<br>\documentclass{amsart}<br>\begin{document}<br>=
=C2=A0$x$ $x$<br>\end{document}<br>#+end_src<br><br>Run ~preview-region~ on=
 the region consisting of the first $x$.=C2=A0 This works as expected.<br><=
br>Next, run ~preview-region~ on the region consisting of just the second $=
x$.=C2=A0 This does not preview the second $x$.=C2=A0 Instead, it refreshes=
 the overlay on the first $x$.<br><br>The relevant output:<br><br>#+begin_q=
uote<br>./_region_.tex:5: Preview: Snippet 1 started.<br>&lt;-&gt;&lt;-&gt;=
<br>=C2=A0 =C2=A0 =C2=A0 <br>l.5 $<br>=C2=A0 =C2=A0 =C2=A0x$<br>Preview: Ti=
ghtpage -32891 -32891 32891 32891<br>./_region_.tex:5: Preview: Snippet 1 e=
nded.(282168+0x374556).<br>&lt;-&gt;&lt;-&gt;<br>=C2=A0 =C2=A0 =C2=A0 <br>l=
.5 $x$<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0<br>#+end_quote<br><br>The issue here =
is that there&#39;s not enough context for ~preview-parse-messages~ to dete=
rmine which $x$ to overlay.<br><br>One workaround would be to apply ~previe=
w-region~ to a region containing both $x$&#39;s (or to use ~preview-buffer~=
, etc).=C2=A0 This workaround wasn&#39;t ideal for my use-case (see parenth=
etical comment at the bottom).<br><br>I think a fix would be to store the b=
eginning of the region being previewed in a buffer-local variable and, if n=
eeded, bump the point when searching for where to place the overlay.=C2=A0 =
Details:<br><br>- Add the following line somewhere in preview.el:<br>=C2=A0=
 #+begin_src elisp<br>=C2=A0 (defvar-local preview-region--begin nil &quot;=
Start of region being processed.&quot;)<br>=C2=A0 #+end_src<br><br>- Add th=
e following line to ~preview-region~, just before the invocation of ~previe=
w-generate-preview~:<br>=C2=A0 #+begin_src elisp<br>=C2=A0 (setq-local prev=
iew-region--begin begin)<br>=C2=A0 #+end_src<br><br>- Add this to ~preview-=
parse-messages~, just before the second ~cond~ block:<br>=C2=A0 #+begin_src=
 elisp<br>=C2=A0 (when (&lt; (point) preview-region--begin)<br>=C2=A0 =C2=
=A0 (goto-char preview-region--begin))<br>=C2=A0 #+end_src<br><br>I&#39;ve =
made these changes in my local version and they have worked for me.<br><br>=
(This bug was an issue for me because I had set up a timer that searches th=
e visible portion of a TeX buffer for unrendered math environments and runs=
 ~preview-region~ on contiguous unpreviewed blocks.=C2=A0 This led to many =
situations where =C2=A0~preview-region~ was called on math regions, such as=
 the second $x$ in the above example, that had already been previewed in th=
e current line.=C2=A0 My original workaround was to enlarge the region sent=
 to ~preview-region~ to contain any repeated math regions that appear earli=
er in a given line.=C2=A0 This worked, but often resulted in many fragments=
 getting unnecessarily refreshed.)<br><div><br></div></div>

--000000000000bbcd5705f7bbcfb5--




Acknowledgement sent to Paul Nelson <ultrono@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-auctex@HIDDEN. Full text available.
Report forwarded to bug-auctex@HIDDEN:
bug#62445; Package auctex. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 25 Mar 2023 17:00:02 UTC

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