Re: tex-symb

Ralf Angeli <[email protected]> Wed, 09 Mar 2005 08:55:33 +0100
Newsgroups gmane.emacs.auc-tex
Message-ID <[email protected]>
* Masayuki Ataka (2005-03-08) writes:

>> > preview-latex illustlates duplicate images, if we step in
>> > preview image, fold symbols, and step out without unfolding
>> > symbols.  There are lots of work...
>> 
>> Fixing this is probably pretty easy.  preview-latex simply has to set
>> a priority for its overlays higher than the ones inserted by TeX-fold.
>
> Thank you.  It was not *pretty easy* for me ;), but I tried.
> A trick code is below.  It seemed to work correctly, for me.

Below I made some comments concerning the code.

> # When many of tex-fold overlays are inside preview-latex
> # overlay, Emacs tries to make many duplicate overlays and
> # sometimes crushes down.
> # (emacs-version)"GNU Emacs 22.0.50.6 of 2005-02-20"
> # Maybe the latest CVS Emacs fix this problem :)

What do you mean with "crushes down"?  Does it crash?  Do you have a
test case?

> *** preview.el	8 Mar 2005 11:01:14 -0000	1.238
> --- preview.el	8 Mar 2005 21:43:14 -0000
> ***************
> *** 1961,1966 ****
> --- 1961,1969 ----
>   		     (preview-toggle ,ov 'toggle event))
>   		  `(lambda(event) (interactive "e")
>   		     (preview-context-menu ,ov event))))
> +     (if (fboundp 'TeX-fold-prioritize)
> + 	(overlay-put ov 'priority (TeX-fold-prioritize start end))
> +       (overlay-put ov 'priority 16))

Is there a priority needed if TeX-fold is not available?  I think it
would be enough to use

(when (fboundp 'TeX-fold-propertize)
  (overlay-put ov 'priority (TeX-fold-prioritize start end)))

Similar for the next hunk I removed from this message.

> *** tex-fold.el	21  2 2005 11:38:36 +0900	1.33
> --- tex-fold.el	09  3 2005 06:46:12 +0900	
> ***************
> *** 515,521 ****
> --- 515,522 ----
>   overlays."
>     (let (outer-priority inner-priority)
>       (dolist (ov (overlays-in start end))
> -       (when (eq (overlay-get ov 'category) 'TeX-fold)
> +       (when (or (eq (overlay-get ov 'category) 'TeX-fold)
> + 		(overlay-get ov 'preview-map))

You could as well test for the category 'preview-overlay.

-- 
Ralf