From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Daniel Colascione" Newsgroups: gmane.emacs.devel Subject: Re: [RFC] Using a display_info union instead of a typedef Display_Info Date: Fri, 12 Apr 2019 12:36:22 -0700 Message-ID: <8427bdc09f6e42930e6e8378284d771c.squirrel@dancol.org> References: <87mukvw4la.fsf@gmail.com> <83v9zjkt05.fsf@gnu.org> <877ebzvzgy.fsf@gmail.com> <83mukvkoyn.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="61716"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: SquirrelMail/1.4.23 [SVN] Cc: monnier@iro.umontreal.ca, Alex Gramiak , emacs-devel@gnu.org To: "Eli Zaretskii" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 12 21:37:13 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hF1z2-000FpM-Fh for ged-emacs-devel@m.gmane.org; Fri, 12 Apr 2019 21:37:09 +0200 Original-Received: from localhost ([127.0.0.1]:41762 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hF1z1-00076L-8U for ged-emacs-devel@m.gmane.org; Fri, 12 Apr 2019 15:37:07 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hF1yQ-00076D-Ai for emacs-devel@gnu.org; Fri, 12 Apr 2019 15:36:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hF1yP-0000RQ-7Z for emacs-devel@gnu.org; Fri, 12 Apr 2019 15:36:30 -0400 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:51746) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hF1yK-0000Fr-Qy; Fri, 12 Apr 2019 15:36:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:To:From:Subject:Date:References:In-Reply-To:Message-ID; bh=fKlig9DFlFsX9f7sMVtWNwtMcDh7AoIsgOO0RT7OhW4=; b=NdJyX7hpVVgn1IRkVIH6O7zmbtNls2iRu/SQnfr00czdEwVObHgDbR4VVey7tiJZRGnlWnfHb8bvofV20h/jKGEuxkXACI/u3So4K67S/4aysk8LRTUbNS0IbwNSgwbJk4QBMdhabuC81Dv9MdGAGntThw6OHh8JF6Da7wjZUTfmyeLtriLanx2BBqnC2jpA16/ME1S5hLz7naWMWfck3hYHDPbXDiBwnaAdCX6304V/k/eYYvgtR7D4knj9mOlvmTqZ4f9EFxgj5ZrfwoMe4IRdQEyEx1HqXA6zOk0mqno+nQKtgQ/vClC3F9ogOYxhaTV/7CE7OfD3iCPtzLiEug==; Original-Received: from localhost ([127.0.0.1] helo=dancol.org) by dancol.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hF1yI-0001jj-DD; Fri, 12 Apr 2019 12:36:22 -0700 Original-Received: from 127.0.0.1 (SquirrelMail authenticated user dancol) by dancol.org with HTTP; Fri, 12 Apr 2019 12:36:22 -0700 In-Reply-To: <83mukvkoyn.fsf@gnu.org> X-Priority: 3 (Normal) Importance: Normal X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:235367 Archived-At: >> From: Alex Gramiak >> Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca >> Date: Fri, 12 Apr 2019 12:40:45 -0600 >> >> > Looks to me like replacing one set of window-system specific code with >> > another: still the same #ifdef's and the same window-system specific >> > code fragments. Maybe I'm missing something, but it doesn't look to >> > me like a change for the better. >> >> There will always have to be window-system specific code somewhere. The >> difference with this patch is that the changed parts of the code will be >> able to be used by multiple different window systems. That is to say, I >> believe this is a necessary step towards Stefan's goal of using multiple >> window systems simultaneously. >> >> Note how before there was the implicit conditional compilation regarding >> the definition of check_x_display_info and x_get_arg that allowed the >> procedure to be used by _only_ 1 window system, but decode_display_info >> and gui_display_get_arg would be able to handle _all_ graphical window >> systems that Emacs is built with. >> >> This currently doesn't mean any functional change as that number can >> currently only be 1, but it would be nice for that to change. Again, I >> believe this is (part of) the way to do so. > > We've been through this before: if these changes don't come together > with, or closely followed by, the code to support using several > window-systems in the same session, I'd prefer not to make these > changes at this time. The advantages you describe are at this point > theoretical, whereas the disadvantage -- making the code less familiar > for veteran Emacs hackers -- is very real. > > Let's invest our time and energy in making changes that are useful > today, not in some distant future. > >> To show how it's used, I've included a diff that uses >> decode_display_info to simplify all 3 check_x_display_info >> implementations into a single conditional. (I could remove that >> conditional with another terminal hook, but I'm not sure that's worth >> it). > > There's a way to attain that without the massive changes you propose: > just make a single function which dispatches by the type of > output_data. We won't be able to judge which alternative is better > until and unless we have real code which implements this feature. The way Alex proposes to do it is the right one. You're proposing using typecases everywhere, which ends up being unmaintainable. A set of well-defined hooks that various implements can fill is a concept that's used all over the place, from Linux file_operations structures to C++ vtables. The efficiency argument is bogus: processors will do jump target prediction perfectly well, because everyone uses this indirect call technique.