Didier Verna writes:
Kyle> This study would still be required if we were to do a
Kyle> rewrite,alas, because Emacs has some historical display
Kyle> behavior that we would have to duplicate.
I don't quite understand this. Could you elaborate ?
There are undocumented things that you will discover that code
relies on. An example, VM had consistent display problems under
Lucid emcas 19.10. I tracked the problem down to a
set-window-buffer call. Under Lucid Emacs if the window already
contained the buffer you were trying to attach with
set-window-buffer it would just return. Under Emacs, it would
cause w->force_start to be set. Because of a particular set of
circumstances, the fact that Lucid Emacs didn't set
w->force_start caused a newly created window to appear with point
in the wrong place. I had to compare Emacs and Lucid Emacs code
line by line to figure this out. The optimization Chuck added
made logical sense, but there are so many factors that control
where the cursor appears that he could not foresee this crazy
See also this comment in window.c
/* #### When the fuck does this happen? I'm so glad that history has
completely documented the behavior of the scrolling functions under
all circumstances. */
I had a heck of a time getting VM's scrolling code to work, and
once I got it to work I was fearful of ever touching it because
of the apparently voodoo involved in the redisplay. Witness this
comment in VM:
;; This voodoo is required! For some
;; reason the 18.52 emacs display
;; doesn't immediately reflect the
;; clip region change that occurs
;; above without this mantra.
It's been ten years since I added this code and I'm still afraid
to take it out. The call to scroll-up that this comment referes to
was needed because Emacs had to be coaxed to recompute _some_ of
its display structures to notice a clippig region change.
Another ugly exmaple: how about selective-display,
selective-display-ellipsis and how they are supposed to work in
the face of extents, faces and scrolling? I sure couldn't tell
you how it is supposed to just by reading the documentation. The
code is the only guide, such as it is.
Maybe we would be better off if we wiped the slate and started
over so we could be rid of this old crap. But we would have to
be ready for some odd breakage. Toss selective-display and
rewrite Outline mode to use invisible extents. Always return
accurate information about what the display should look like,
even if it requires much more on the fly computation. But we are
indeed talking about a very different animal.
I'm too chicken to try it myself, at least not all at once. I'm
game to try to rewrite pieces of it. Pixel based scrolling could
be added, I think, without starting over.