GNU bug report logs - #26694
preview-at-point fails on very long lines with "End of buffer"

Previous Next

Package: auctex;

Reported by: Frank Fischer <frank-fischer <at> shadow-soft.de>

Date: Fri, 28 Apr 2017 13:30:04 UTC

Severity: normal

Done: Mosè Giordano <mose <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Frank Fischer <frank-fischer <at> shadow-soft.de>
Subject: bug#26694: closed (Re: bug#26694: preview-at-point fails on very
 long lines with "End of buffer")
Date: Sat, 06 May 2017 18:33:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#26694: preview-at-point fails on very long lines with "End of buffer"

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 26694 <at> debbugs.gnu.org.

-- 
26694: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=26694
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mosè Giordano <mose <at> gnu.org>
To: Frank Fischer <frank-fischer <at> shadow-soft.de>
Cc: 26694-done <at> debbugs.gnu.org
Subject: Re: bug#26694: preview-at-point fails on very long lines with "End of
 buffer"
Date: Sat, 6 May 2017 20:31:44 +0200
Hi Frank,

2017-04-28 15:26 GMT+02:00 Frank Fischer <frank-fischer <at> shadow-soft.de>:
> However, I would say the the column offset is just wrong. Either
> subtract the length of the preceding text (in the original buffer) from
> the column number or copy the preceding text to the temp buffer as well.

I think you're right, a good solution would be to add one more
argument to `TeX-region-create' with the adjusted line-col
information.  However, in order to avoid changing the signature of the
function I decided to apply a work around: the point is moved only
when `TeX-source-correlate-mode' is non nil (because point is moved
only to make forward/inverse search work) and this variable is
let-bound to nil when running the preview (forward/inverse search is
not needed here).

I dropped a few comments about this work-around in the code, in case
someone want to improve the fix, maybe as suggested above.  In any
case, I'm closing this ticket as the issue should be fixed.

Thanks for the good bug report Frank!

Bye,
Mosè

[Message part 3 (message/rfc822, inline)]
From: Frank Fischer <frank-fischer <at> shadow-soft.de>
To: bug-auctex <at> gnu.org
Subject: preview-at-point fails on very long lines with "End of buffer"
Date: Fri, 28 Apr 2017 15:26:51 +0200
Hi,

consider the following example file https://pastebin.com/73W7EbCa

This file has a single very long line with one math item at the end. Do
the following:

1. generate the preview with C-c C-p C-p
2. move point to the "x" in the math block, change it to "y" and leave
point within the math block
3. execute C-c C-p C-p again

One should get the message "End of buffer" without the preview being
regenerated.

AFAICT the reason is that in this case only the snippet $x$ without the
text preceding the snippet in the line is copied to the temporary file
for generating the preview. However line 2103 in tex-buf.el (that is the
line with "(forward-char (cdr line-col))") tries to move point to the
*original* column of the snippet. This number is so large that
"(forward-char ...)" will actually reach the end of the buffer and the
error occurs.

However, I would say the the column offset is just wrong. Either
subtract the length of the preceding text (in the original buffer) from
the column number or copy the preceding text to the temp buffer as well.

I hope my description is clear, if not, please ask ;)

Best regards,
Frank



This bug report was last modified 7 years and 353 days ago.

Previous Next


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