emacs-devel
[Top][All Lists]
Advanced

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

Re: redisplay code is ugly (was: Cursor positioning with `after-string'


From: Eli Zaretskii
Subject: Re: redisplay code is ugly (was: Cursor positioning with `after-string' overlays)
Date: Sat, 03 Apr 2010 10:30:57 +0300

> From: Stefan Monnier <address@hidden>
> Date: Fri, 02 Apr 2010 21:21:09 -0400
> Cc: address@hidden
> 
> I.e. it's workable but it'd probably be ugly.

Ugly is xdisp.c's middle name.  I hate to say it, but almost every
important function of the display engine has become so convoluted and
under-commented that they all simply cry for refactoring.  Look at
move_it_in_display_line_to or at display_line -- with all the
different temporary `struct it' and flag variables, the amount of
cruft there is so large that it is next to impossible to even grasp
the overall control and data flow there, let alone make a non-trivial
modification.  (set_cursor_from_row was in a similar state; I hope
that after the rewrite on the trunk, it is a bit more manageable, but
I'd certainly love some critical peer review there.)

I frequently need to look at the Emacs 21 sources, just to understand
the original design and implementation.  At least there, they are
clearly visible and adequately commented.

My conclusion from almost a year of hacking the display engine is that
we are currently stretching it way past its original design
limitations.  Somebody(TM) should take a fresh look at the code and
refactor it.  I'm quite sure that quite a few of ugly places could be
rectified by adding some data to the core data structures, for
example.

Emacs 24 sounds like a good opportunity for such a refactoring.

And no, I'm not volunteering.  One reason is that I'm not good at this
job -- I try to stick to the original design on some deeply
subconscious level.




reply via email to

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