Re: tex-symb
Ralf Angeli <[email protected]>
| Newsgroups | gmane.emacs.auc-tex |
|---|---|
| Message-ID | <[email protected]> |
* Masayuki Ataka (2005-03-05) writes:
> tex-symb.el is written to override tex-fold.el, so only have to
> do is load tex-symb.el and do tex-folding in your buffer.
> Mathematical macros will be folded into symbols (with unicode
> font).
There currently are very few defaults in tex-fold.el to avoid
compromising speed of folding and to allow a user to customize it to
her taste by adding new macros. We discussed before that this can be
inconvenient especially for users who have needs not covered by the
defaults. In order to suit most people we concluded to add something
like folding classes specifying certain types of material to be
folded, e.g. labels/references or math. Once we have these classes
and can allow the user to switch them on and off as well as add his
own macros to class-specific lists we can populate them with content.
I haven't had time to do something like this and don't know if I
will. So if you are interested in doing this, please go ahead.
We might also consider to allow the specification of material other
than macros. I know that Talcum (<URL:http://talcum.sarovar.org/>) is
able to fold stuff like ~, "- etc. because it allows to specify
regular expressions for the content to be folded. When I wrote
tex-fold.el I decided against this because I wanted the user interface
for customization to be as simple as possible. But maybe one could
add a new customization option which accomodates for this.
Unexperienced users could use it to specify simple strings and those
comfortable with regular expressions could add regexps.
> ** Slow!
>
> We should write new folding engine especially for TeX macros?
tex-fold.el uses functions of AUCTeX's core for finding macros,
environments and their content. So speeding up these functions would
be beneficial for other parts of AUCTeX as well.
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.
We will also have to see what happens now that preview-latex will get
integrated into AUCTeX. It will likely have mechanisms which can be
used by tex-fold.el for doing certain things but I don't know yet
which ones. But there may happen some consolidation between those two
packages.
Another aspect (to make confusion complete) would be a unified
interface for adding macros e.g. in AUCTeX style files. Currently we
have several lists of macros for several purposes often holding the
same macros. We have the stuff added by `TeX-add-symbol' which is
there for making completion and other input aids available for a
macro. We have the lists used for fontification and we have lists
used for folding. We should provide a convenient way to add a macro
to these lists and maybe even unify them at one point in time. Maybe
such a unified list could even hold informative text about the
macro/environment itself (extracted from a TeX reference or package
documentation) and information about its syntax (both for the user and
for AUCTeX; I already mentioned something like "[]{}{}" for specifying
this).
--
Ralf