From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: xdisp.c in C++ (Was: Abysmal state of GTK build) Date: Thu, 25 Aug 2022 11:28:02 +0300 Message-ID: <83zgfs3ey5.fsf@gnu.org> References: <8735dm10jj.fsf@gmail.com> <8815abc5-90c3-e2cc-916c-0b71a2da9daa@gmail.com> <875yigvmq0.fsf@yahoo.com> <3b341ee7-f726-1a35-0123-083c3389f858@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25081"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, emacs-devel@gnu.org To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 25 11:18:11 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oR907-0006GA-4C for ged-emacs-devel@m.gmane-mx.org; Thu, 25 Aug 2022 11:18:11 +0200 Original-Received: from localhost ([::1]:50194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oR905-0001Lg-Ge for ged-emacs-devel@m.gmane-mx.org; Thu, 25 Aug 2022 05:18:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oR8DW-0006Kk-K7 for emacs-devel@gnu.org; Thu, 25 Aug 2022 04:27:58 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:33408) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oR8DR-0007B5-Nd; Thu, 25 Aug 2022 04:27:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=sctW6tGBy1arr8AuBFGzei1SAhDKs85G6LZQJ3OqVxo=; b=HQlpmg7CojTQCR/MkHY1 dchCclY+ZTyLuuQTa+4HpPppEr4u10nRBmVB9Gji2M30V4n0HwFqK9ILBE10X/W0+2MajAxGpklk4 cktxtNWhxZn/TKDJaoZN1VoErIobBwDLGhpN88zcyD2HR2ir7b+X6jmD5/vAa7KOgbKiqflsJXXWC xHvXJOZyAexphLGjSiECBgkH6De1zsX/Q3+ZaAIUFjVuFavoeGwLMYDr7kPrYjkYG7JqzBwKuLuGu eLitu+xZ7YIXqvlWUPjxZgA2bLzCEsGFBYl3oZDqseP2vVNgmvbqeFcjQFG+Y0qQ+i3e7rmZYG850 CszA9kS3kI+kuA==; Original-Received: from [87.69.77.57] (port=3124 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oR8DR-0002xf-2w; Thu, 25 Aug 2022 04:27:53 -0400 In-Reply-To: <3b341ee7-f726-1a35-0123-083c3389f858@gmail.com> (message from Gerd =?utf-8?Q?M=C3=B6llmann?= on Thu, 25 Aug 2022 08:57:34 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:294077 Archived-At: > 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 > > On 22-08-25 8:52 , Po Lu wrote: > > Gerd Möllmann 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.)