auctex-devel
[Top][All Lists]
Advanced

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

Re: Onwards to lexical binding (attempt 1)


From: Ikumi Keita
Subject: Re: Onwards to lexical binding (attempt 1)
Date: Thu, 05 Nov 2020 15:36:42 +0900

Hello Tassilo and all,

>>>>> Ikumi Keita <ikumi@ikumi.que.jp> writes:
> It doesn't work for region preview. After Setting region on circ.tex and
> C-c C-p C-r, I get error and in process buffer I find
> Running `Preview-PDF2DSC' with ``pdf2dsc circ.pdf 
> circ.prv/tmpSYCDuG/preview.dsc''
> . Thus preview-latex provides "master" file name "circ.pdf" rather than
> "_region_.pdf" for pdf2dsc for this case.

> I think `preview-region' should bind TeX-current-process-region-p
> permanently by `setq', not `let', so that TeX-active-master returns
> intended file name even in process sentinels.

This incident made me aware that it has been long that AUCTeX lost the
simultaneity, under certain condition, stated in the last sentence of
this comment of tex-buf.el:
,----
| ;; The general idea is, that there is one process and process buffer
| ;; associated with each master file, and one process and process buffer
| ;; for running TeX on a region.   Thus, if you have N master files, you
| ;; can run N + 1 processes simultaneously.
`----
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.

What should we do? I don't think personally that this is a serious
problem because it isn't much likely to run the master file process and
the region file process in parallel in actual situation of editing LaTeX
document. In fact, it seems that nobody claimed about this problem in
the past.

So it's only a matter of inconsistency of comment in tex-buf.el and we
can easily update the relavant sentence, IMHO.

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'.

Regards,
Ikumi Keita



reply via email to

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