emacs-devel
[Top][All Lists]
Advanced

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

Re: xdisp.c in C++ (Was: Abysmal state of GTK build)


From: Eli Zaretskii
Subject: Re: xdisp.c in C++ (Was: Abysmal state of GTK build)
Date: Thu, 25 Aug 2022 11:28:02 +0300

> Date: Thu, 25 Aug 2022 08:57:34 +0200
> Cc: rpluim@gmail.com, emacs-devel@gnu.org, ofv@wanadoo.es,
>  owinebar@gmail.com, rms@gnu.org
> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> 
> On 22-08-25 8:52 , Po Lu wrote:
> > Gerd Möllmann <gerd.moellmann@gmail.com> writes:
> > 
> >> Take a look at xdisp.c, and imagine what that will look like in
> >> another 20 years if nothing happens.
> > 
> > I don't quite believe that C++ will make it look any better, without
> > someone doing the work to clean it up.  Which might as well be done in
> > C.
> 
> Obviously I disagree, and I might add that I know both C++ and xdisp.c 
> quite well.  Xdisp.c not as well as I once did, but anyway.

Feel free to describe how rewriting xdisp.c in C++ could make it
significantly easier to understand and maintain.  We might as well
consider doing something still in C, if any of the ideas sound
attractive.

It is quite obvious that the various methods in
get_next_display_element and set_iterator_to_next could use
polymorphism, and the iterator object itself could be rewritten in
C++.  Likewise the handle_stop handlers.  But will this really make
the code simpler and easier to understand?

And what else in xdisp.c will benefit from rewriting it in C++?

(This is obviously a very academic discussion at this point, so I'll
understand if you don't want to invest any real time in it.  I asked
those questions on the chance that you already have most of the
answers figured out and ready.)



reply via email to

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