From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Renaming non-X x_* procedures in xdisp.c (and elsewhere) Date: Sun, 24 Mar 2019 07:39:46 +0200 Message-ID: <922F9B91-2E9E-45F6-BB96-66CAE5E9FB81@gnu.org> References: <87wokp4okn.fsf@gmail.com> <83ef6xpo6b.fsf@gnu.org> <0f4be9a6-6e09-f55d-9f58-2a15aef264cd@cs.ucla.edu> <837ecpplw8.fsf@gnu.org> <871s2w510a.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="234780"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: K-9 Mail for Android Cc: Paul Eggert , emacs-devel@gnu.org To: Alex Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 24 06:40:00 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 1h7vrT-000ywn-VU for ged-emacs-devel@m.gmane.org; Sun, 24 Mar 2019 06:40:00 +0100 Original-Received: from localhost ([127.0.0.1]:52167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7vrT-0007us-0a for ged-emacs-devel@m.gmane.org; Sun, 24 Mar 2019 01:39:59 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7vrN-0007ul-Id for emacs-devel@gnu.org; Sun, 24 Mar 2019 01:39:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7vrK-0008RO-0F; Sun, 24 Mar 2019 01:39:51 -0400 Original-Received: from [176.12.194.127] (port=35007 helo=[10.211.85.128]) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1h7vrJ-0003iq-8i; Sun, 24 Mar 2019 01:39:49 -0400 In-Reply-To: <871s2w510a.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:234675 Archived-At: On March 24, 2019 6:50:45 AM GMT+02:00, Alex wrote: > Eli Zaretskii writes: >=20 > > I don't have strong opinions about this=2E Aside of making the > > archeology and forensics harder, renaming will get in the way of my > > personal acquaintance with the code in xdisp=2Ec and dispnew=2Ec, but > that > > alone doesn't sound like a reason to object to the change=2E It will > > probably also require a lot more ugly #ifdef's in the mainline code > > (or calling through function pointers, not sure which is worse), and > > quite a few changes in the headers to go with that=2E >=20 > How about using something like the following? It's ugly, but at least > it doesn't ruin the rest of the code=2E >=20 > #ifdef HAVE_X_WINDOWS > #define CASE_X(proc, =2E=2E=2E) \ > case output_x_window: \ > x_ ## proc (__VAR_ARGS__) > #define CASE_X_VAR(var, proc, =2E=2E=2E) \ > case output_x_window: \ > var =3D x_ ## proc (__VA_ARGS__) > #else > #define CASE_X(=2E=2E=2E) > #define CASE_X_VAR(=2E=2E=2E) > #endif >=20 > #ifdef HAVE_NTGUI > #define CASE_W32(proc, =2E=2E=2E) \ > case output_w32: \ > w32_ ## proc (__VA_ARGS__) > #define CASE_W32_VAR(var, proc, =2E=2E=2E) \ > case output_w32: \ > var =3D w32_ ## proc (__VA_ARGS__) > #else > #define CASE_W32(=2E=2E=2E) > #define CASE_W32_VAR(=2E=2E=2E) > #endif >=20 > #ifdef HAVE_NS > #define CASE_NS(proc, =2E=2E=2E) \ > case output_ns: \ > ns_ ## proc (__VA_ARGS__) > #define CASE_NS_VAR(var, proc, =2E=2E=2E) \ > case output_ns: \ > var =3D ns_ ## proc (__VA_ARGS__) > #else > #define CASE_NS(=2E=2E=2E) > #define CASE_NS_VAR(=2E=2E=2E) > #endif >=20 > #define CALL_FOR_WS(f, proc, =2E=2E=2E) \ > switch ((f)->output_method) \ > { \ > CASE_X (proc, __VA_ARGS__); \ > CASE_W32 (proc, __VA_ARGS__); \ > CASE_NS (proc, __VA_ARGS__); \ > } >=20 > #define ASSIGN_FOR_WS(f, var, proc, =2E=2E=2E) \ > switch ((f)->output_method) \ > { \ > CASE_X_VAR (var, proc, __VA_ARGS__); \ > CASE_W32_VAR (var, proc, __VA_ARGS__); \ > CASE_NS_VAR (var, proc, __VA_ARGS__); \ > } Where would something like that be needed? Can you point out a couple of = places in the code where we should use this?