Mail Archives: djgpp/1997/10/31/03:46:45
> This is a known problem. Emacs does almost a complete parsing of the
> buffer part that preceeds current location, so it could indent it when
> you press ENTER. This might be quite slow in ELisp in pathological cases
> such as yours.
Two things that together may ensure a fix in a future EMACS: One, be sure
to use STL ropes or something similar for buffer contents representation.
Two, use an indent logic that is "local", i.e. only needs to look at the
immediate neighborhood of the insertion point to know what to do. I.e.
indent same as line above, unless it ends with a hanging {, then indent by
two more, or if it has a } with no matching {, indent two less (with two a
user-configirable parameter)... that's a simple algorithm for indenting a
newly-created line in a C file. One can embellish it till the cows come
home, and if parts of the file get out of sync, then you just have a
recursive reindent_whole_buffer command that exdents the top line to the
left margin then applies the rules to each line in sequence (that could be
slow on bi files though.)
--
.*. Where feelings are concerned, answers are rarely simple [GeneDeWeese]
-() < When I go to the theater, I always go straight to the "bag and mix"
`*' bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh
- Raw text -