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

Previous Next

Package: auctex;

Reported by: Paul Nelson <ultrono <at> gmail.com>

Date: Sat, 25 Mar 2023 16:16:01 UTC

Severity: normal

Found in version 13.1.10

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Paul Nelson <ultrono <at> gmail.com>
To: Arash Esbati <arash <at> gnu.org>
Cc: 62445 <at> debbugs.gnu.org
Subject: Re: bug#62445: 13.1.10; bug in preview-region applied to repeated
 math environments
Date: Mon, 8 Apr 2024 17:50:50 +0200
[Message part 1 (text/plain, inline)]
Hi Arash,

I've adjusted the commit message as best I could (it wasn't 100% clear
to me whether the summary line should appear "twice", both in the
subject and in the first line of the commit message), and can't
remember any reason not to just use setq, so I've changed it to that.
Any further feedback is welcome.

Thanks, best,

Paul

On Mon, Apr 8, 2024 at 2:44 PM Arash Esbati <arash <at> gnu.org> wrote:
>
> Hi Paul,
>
> Paul Nelson <ultrono <at> gmail.com> writes:
>
> > OK, very well.  Please find attached my best attempt at a patch for
> > this (any feedback or corrections welcome).
>
> Thanks.  I have 2 questions, see below:
>
> > From 9d3266304f62fa3b21751b27200aab17454add6c Mon Sep 17 00:00:00 2001
> > From: Paul Nelson <ultrono <at> gmail.com>
> > Date: Mon, 8 Apr 2024 13:11:52 +0200
> > Subject: [PATCH] fix bug with preview-region applied to repeated math
> >  environments
> >
> > See https://www.mail-archive.com/bug-auctex <at> gnu.org/msg04327.html.
>
> Can you try to adjust the commit message as described here:
>
>   https://git.savannah.gnu.org/cgit/emacs.git/tree/CONTRIBUTE#n172
>
> If not, I will try to fix that afterwards.
>
> > ---
> >  preview.el.in | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> >
> > diff --git a/preview.el.in b/preview.el.in
> > index 09836d9..72c5e58 100644
> > --- a/preview.el.in
> > +++ b/preview.el.in
> > @@ -3268,6 +3268,8 @@ Return a new string."
> >      (setq result (concat result string))
> >      result))
> >
> > +(defvar-local preview--region-begin nil)
> > +
> >  (defun preview-parse-messages (open-closure)
> >    "Turn all preview snippets into overlays.
> >  This parses the pseudo error messages from the preview
> > @@ -3538,6 +3540,14 @@ name(\\([^)]+\\))\\)\\|\
> >                          (goto-char (point-min))
> >                          (forward-line (1- line)))
> >                        (setq lpoint (point))
> > +
> > +                      ;; The following addresses the bug described at
> > +                      ;; https://www.mail-archive.com/bug-auctex <at> gnu.org/msg04327.html
> > +                      (and preview--region-begin
> > +                           (< (point)
> > +                              preview--region-begin)
> > +                           (goto-char preview--region-begin))
> > +
> >                        (cond
> >                         ((search-forward (concat string after-string)
> >                                          (line-end-position) t)
> > @@ -4033,6 +4043,7 @@ stored in `preview-dumped-alist'."
> >                           "<none>")
> >                         (TeX-current-offset begin)))
> >    (setq TeX-current-process-region-p t)
> > +  (setq-local preview--region-begin begin)
>
> Why `setq-local'?  You define `preview--region-begin' with
> `defvar-local', why not just `setq' it?
>
> Best, arash
[0001-Fix-preview-region-bug-with-repeated-math-envs.patch (application/octet-stream, attachment)]

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.