[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#39927: 12.2; preview-latex gs treatment off by one
From: |
candeb |
Subject: |
bug#39927: 12.2; preview-latex gs treatment off by one |
Date: |
Thu, 12 Mar 2020 09:51:14 +0100 (CET) |
Hi Ikumi
I spent some time digging into the internals of preview-latex, even though I do
not speak elisp wery well...
The crucial part happens inside preview-gs-transact, which gets called each
time GS has written something to the standard output (usually GS> or GS<1>)
As I wrote in a previous message, adding some debug prints to the beginning of
preview-gs-transact shows that you need to count the number of GS<1> prompts in
order to guess when a new file is ready.
Current code just counts all prompts, skipping one, so with two GS> prompts at
the beginning it is off by one.
The attached patch, based on that observation, solves the problem entirely.
Again, as I said in all my previous messages, I DO NOT UNDERSTAND ghostscript,
I am just making empiric observations regarding the correlation between what GS
writes to stdout and what seems to happen.
These observations seem to be consistent regardless of the color compatibility
option you choose or the number of files you feed into GS at a time (but only
tested with 9.50)
Cheers,
Itaï
0103-Improve-preview-gs-transact.patch
Description: Text Data