Re: Changes to preview-latex
David Kastrup <[email protected]> Wed, 16 Mar 2005 11:05:22 +0100
| Newsgroups | gmane.emacs.auc-tex |
|---|---|
| Message-ID | <[email protected]> |
Masayuki Ataka <[email protected]> writes: > From: Masayuki Ataka <[email protected]> > Subject: Re: Changes to preview-latex > Date: Tue, 15 Mar 2005 11:39:18 +0900 (JST) > >> From: David Kastrup <[email protected]> > >> > I have not yet made a decision about that. And I think it very >> > unfortunate if preview.el requires tex-fold.el to be loaded. If we >> > need to place overlay priorities for some reason, I think we should >> > try to figure out a system where preview.el can place its respective >> > priorities without consulting with tex-fold.el. >> > >> > Can we figure out some proper scheme for that? I don't know the >> > details of the problem that we need to solve here. >> >> How about copying neccessary code from tex-fold.el into >> preview.el? AFAICS, only the variable TeX-fold-priority-step >> and the function TeX-fold-prioritize are required for the >> calculation of priorities. > > Ah, It's a bad idea just copying a variable and a function, > because we have the two functions in one package. Once one of > them are changed, we will be in the trouble. Ok, after thinking about this, here is my take on that: we have the folding in TeX-fold, and we have the folding in preview-latex. Clearly preview-latex will at one point of time also have to deal with nested previews. Frankly, this should really be solved by Emacs: it does not make sense at all when display properties are nested to let the inner property bleed out. Anyway, the damage is done. Since this sort of prioritizing is common to folding/previews and potential other things, we should place the core functionality of prioritizing within tex.el and call it TeX-overlay-prioritize and TeX-fold-step (we already take a look at some overlay properties for filling, so that is not really new). I don't think that tex.el should require overlay.el if we can avoid it, so we should have two versions: one using extent-property and similar for XEmacs, one using overlay-*. In tex.el, they would get differentiated with (if (featurep 'xemacs) (define for xemacs) (define for emacs)) TeX-fold has not been distributed separately from AUCTeX, I think, so it can just use the function in tex.el. The two versions would then also be placed into prv-xemacs.el and prv-emacs.el, respectively, wrapped inside of (defvar ...) (unless (fboundp 'TeX-overlay-prioritize) (defun for the fitting flavor...)) That way, preview-latex will cooperate with older versions of AUCTeX while not overriding any code defined in newer versions. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum