Re: tex-symb
Ralf Angeli <[email protected]> Tue, 08 Mar 2005 10:20:40 +0100
| Newsgroups | gmane.emacs.auc-tex |
|---|---|
| Message-ID | <[email protected]> |
* Masayuki Ataka (2005-03-07) writes: > From: Ralf Angeli <[email protected]> [folding classes] > How about preparing the buffer local variable, which holds > which features are folded. For example, in tex-symb.el, > TeX-symb-ascii-arrow-list has the fuature that allows are > displayed with ascii text, where allows are displayed with > unicode font, by default. We can choose how to display allows > with ascii or unicode. I'd like to have a more explicit mechanism than that. There would have to be a variable where the user can (in the customization buffer) activate or deactivate certain classes by clicking on check boxes. > Similarly, we can divide > TeX-fold-macro-spec-list by section, item, footnote, ref, and > label. And add their variables into TeX-fold-macro-spec-list, > if we want to fold them. Yes, that's the other side of the problem. I am currently not too happy with how `TeX-fold-macro-spec-list' is looking, especially that the keyword lists for macros where the content of an argument should be shown are inside it. In case folding classes are added it will probably be better to split this variable in separate ones for every folding class. For each class there will probably have to be a variable for the system default and one holding additions made by the user (similar to what is currently done for font locking). We need a good scheme for that and have to keep in mind how this relates to the other keyword lists we currently have in AUCTeX. As written before, it would be nice to have these consolidated. >> Anyway, a main problem currently is that fontification of overlays >> covering folded content may be wrong. The problem is explained at the >> start of tex-fold.el and in the respective manual section. So it >> would e.g. be nice to have a way to hook onto a jit-lock function and >> do folding once this function has fontified the relevant parts of the >> file. If we can achieve something like this, speed of the folding >> algorithm will not be much of an issue because only parts which are >> actually shown in the buffer have to be folded at one time. I don't >> know if it is easily possible, though. And it doesn't cover the case >> where font locking is disabled or does not use jit-lock. > > I'm not familiar with font-lock code, so jit-lock is hard road > for me, either. But it is attractive for me not to check the > speed of the folding algorithm. Well, you can already have lots of fun with something like this: (defadvice jit-lock-fontify-now (after TeX-jit-lock-fontify-now activate) "Rhabarber." (let ((start (ad-get-arg 0)) (end (ad-get-arg 1))) (TeX-fold-region start end))) Note that this will work by no means flawlessly. It is just for testing. Maybe using `fontification-functions' as a hook instead of a defadvice would be better, but we don't have a function accepting only a region start, so I went for the defadvice. Anyway, it is funny to see folding act like fontification, i.e. you open a LaTeX file and the stuff will be folded right away. I don't know if this is something people would like to have. In case it is we'd need a similar mechanism in the case font locking, especially with jit-lock, is not used. -- Ralf