[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

comint-last-output-overlay -- overlapping overlays

From: Alex Schroeder
Subject: comint-last-output-overlay -- overlapping overlays
Date: Thu, 15 Nov 2001 02:23:23 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu)

If you have ever used ansi-color.el with Emacs 20, you will have
noticed that "ls /dev" can bring Emacs to a standstill.  The reason is
simple: overlapping overlays are a real Emacs display killer.  I don't
know why that is, but other lisp packages suffer from this as well.
(Those of you using BBDB from CVS will have noticed that showing lots
of entries takes several minutes instead of seconds -- because BBDB
from CVS uses overlapping overlays!).

I just added some bugfixes to ansi-color.el which makes it work around
the insert-before-markers problem in Emacs 20.7.  Basically the same
stuff which is in comint.el, as I discovered afterwards.  :)

Not all problems are solved, however:

The new comint.el introduces comint-last-output-overlay.  And now all
overlays which ansi-color.el creates are automatically overlapping.
They overlap with comint-last-output-overlay.  And thus, eventhough
the overlapping overlays bug due to the insert-before-markers problem
was fixed for Emacs 20, ansi-color is still not usable for Emacs 21.
"ls /dev" will bring Emacs 21 to a standstill.

I've tried the following workaround:

I introduced code which will deletes all ansi-color overlays which lie
more than 5000 characters before process-mark.  But even that doesn't
cut it.  I have to set this limit to 1000 characters (about 17 lines
of "ls /dev" output) in order to get half-decent performance.

I only see two possible solutions:

1. Improve handling of overlapping overlays significantly, or
2. Remove comint-last-output-overlay

The problem with solution 1 is that it seems very difficult to do.  On
the other hand XEmacs can handle overlapping extents, so somehow a
better solution must be around.

The problem with solution 2 is that the last-output-overlay seems
useful.  The relevant code:

                  (overlay-put over 'field 'output)
                  (overlay-put over 'inhibit-line-move-field-capture t)
                  (overlay-put over 'evaporate t)
                  (setq comint-last-output-overlay over))))


One possibility I see would be this: Do not create
comint-last-output-overlay while output is arriving, create it
afterwards.  Perhaps then, when the output has arrived at last and
we're back at the prompt, then create comint-last-output-overlay.

If that seems inadequate, then I will limit ansi-color overlays to the
last 1000 characters or less -- 17 lines of ls output, no more.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]