auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Proposal to fix simultaneity (Re: Onwards to lexical binding (attempt 1)


From: Ikumi Keita
Subject: Proposal to fix simultaneity (Re: Onwards to lexical binding (attempt 1))
Date: Fri, 25 Feb 2022 22:12:17 +0900

Hi Tassilo,

This is a continuation of 1.5-year old thread.

>>>>> Ikumi Keita <ikumi@ikumi.que.jp> writes:
>>>>> Tassilo Horn <tsdh@gnu.org> writes:
>> Ikumi Keita <ikumi@ikumi.que.jp> writes:
>>> The reason is that sentinel functions `TeX-LaTeX-sentinel' and those in
>>> preview.el call `TeX-active-master', which depends on the global dynamic
>>> scope variable 'TeX-current-process-region-p'. Suppose that Alice types
>>> C-c C-c in a fairly large document.  The LaTeX process takes, say, 20
>>> seconds or more. Before it finishes, Alice spans a region in the buffer
>>> and types C-c C-r.
>>> Then 'TeX-current-process-region-p' is overwritten by that C-c C-r, thus
>>> `TeX-master-file', called in the process sentinel of the first process
>>> invoked by C-c C-c, doesn't work as expected.

>> Hm, isn't it actually even worse, i.e., Alice could compile one large
>> document and then compile/preview a region in some completely different
>> document?  AFAICS, `TeX-current-process-region-p' isn't even
>> buffer-local which would at least help with the "different documents"
>> case.

> Yes, I agree with you.

>> Well, if we've had that working at some point in time, I'd say it would
>> be good if we could restore that.

>> But how did it work?  I mean, the sentinel function runs much later
>> outside of the dynamic scope of the command starting the process.

> I guess that in early stage of development, sentinel functions were
> simple enough to be free of TeX-active-master, including implicit
> dependence through other functions.

>>> On the other hand, if this problem must be considered as a serious
>>> defect, then we should turn 'TeX-current-process-region-p' into a kind
>>> of "process local variable" like `TeX-command-next'.

>> I'd say it's not serious but we should address it anyway, and making it
>> local in the process buffer seems like a suitable approach.

I expect the attached patch addresses this issue. What do you think
about it?

Regards,
Ikumi Keita
#StandWithUkraine #StopRussianAggression

Attachment: 0001-Fix-simultaneity.patch
Description: simultaneity


reply via email to

[Prev in Thread] Current Thread [Next in Thread]