all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alex <agrambot@gmail.com>
Cc: Paul Eggert <eggert@cs.ucla.edu>, emacs-devel@gnu.org
Subject: Re: Renaming non-X x_* procedures in xdisp.c (and elsewhere)
Date: Sun, 24 Mar 2019 07:39:46 +0200	[thread overview]
Message-ID: <922F9B91-2E9E-45F6-BB96-66CAE5E9FB81@gnu.org> (raw)
In-Reply-To: <871s2w510a.fsf@gmail.com>

On March 24, 2019 6:50:45 AM GMT+02:00, Alex <agrambot@gmail.com> wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > I don't have strong opinions about this.  Aside of making the
> > archeology and forensics harder, renaming will get in the way of my
> > personal acquaintance with the code in xdisp.c and dispnew.c, but
> that
> > alone doesn't sound like a reason to object to the change.  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.
> 
> How about using something like the following? It's ugly, but at least
> it doesn't ruin the rest of the code.
> 
> #ifdef HAVE_X_WINDOWS
> #define CASE_X(proc, ...)                       \
>   case output_x_window:                         \
>   x_ ## proc (__VAR_ARGS__)
> #define CASE_X_VAR(var, proc, ...)              \
>   case output_x_window:                         \
>   var = x_ ## proc (__VA_ARGS__)
> #else
> #define CASE_X(...)
> #define CASE_X_VAR(...)
> #endif
> 
> #ifdef HAVE_NTGUI
> #define CASE_W32(proc, ...)                     \
>   case output_w32:                              \
>   w32_ ## proc (__VA_ARGS__)
> #define CASE_W32_VAR(var, proc, ...)            \
>   case output_w32:                              \
>   var = w32_ ## proc (__VA_ARGS__)
> #else
> #define CASE_W32(...)
> #define CASE_W32_VAR(...)
> #endif
> 
> #ifdef HAVE_NS
> #define CASE_NS(proc, ...)                      \
>   case output_ns:                               \
>   ns_ ## proc (__VA_ARGS__)
> #define CASE_NS_VAR(var, proc, ...)             \
>   case output_ns:                               \
>   var = ns_ ## proc (__VA_ARGS__)
> #else
> #define CASE_NS(...)
> #define CASE_NS_VAR(...)
> #endif
> 
> #define CALL_FOR_WS(f, proc, ...)               \
>   switch ((f)->output_method)                   \
>     {                                           \
>       CASE_X (proc, __VA_ARGS__);               \
>       CASE_W32 (proc, __VA_ARGS__);             \
>       CASE_NS (proc, __VA_ARGS__);              \
>     }
> 
> #define ASSIGN_FOR_WS(f, var, proc, ...)        \
>   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?



  reply	other threads:[~2019-03-24  5:39 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-23 15:07 Renaming non-X x_* procedures in xdisp.c (and elsewhere) Alex
2019-03-23 15:38 ` Stefan Monnier
2019-03-23 16:10 ` Eli Zaretskii
2019-03-23 16:41   ` Paul Eggert
2019-03-23 16:59     ` Eli Zaretskii
2019-03-23 17:39       ` Alex
2019-03-23 17:54         ` Alex
2019-03-23 18:16         ` Eli Zaretskii
2019-03-23 18:55           ` Alex
2019-03-23 19:32             ` Eli Zaretskii
2019-03-24  4:14               ` Alex
2019-03-24  4:50       ` Alex
2019-03-24  5:39         ` Eli Zaretskii [this message]
2019-03-24 15:05           ` Alex
2019-03-24 16:01             ` Yuri Khan
2019-03-24 16:13               ` Eli Zaretskii
2019-03-24 17:03                 ` Eli Zaretskii
2019-03-24 16:27             ` Eli Zaretskii
2019-03-24 18:30               ` Alex
2019-03-24 18:48                 ` Eli Zaretskii
2019-03-25 19:21                   ` Alex
2019-03-30 10:07                     ` Eli Zaretskii
2019-03-30 17:26                       ` Alex
2019-03-30 17:40                         ` Eli Zaretskii
2019-03-30 17:59                           ` Alex
2019-03-30 18:55                             ` Eli Zaretskii
2019-03-30 23:27                               ` Alex
2019-03-31 14:52                                 ` Eli Zaretskii
2019-04-11 19:07                                   ` Alex
2019-04-12 19:03                                     ` Eli Zaretskii
2019-04-12 19:50                                       ` Alex Gramiak
2019-04-12 20:10                                         ` Eli Zaretskii
2019-04-13 16:26                                           ` Alex Gramiak
2019-04-13 17:20                                             ` Eli Zaretskii
2019-04-13 16:13                                   ` [PATCH] Renaming non-X x_* identifiers (was: Renaming non-X x_* procedures in xdisp.c (and elsewhere)) Alex Gramiak
2019-04-13 17:17                                     ` Eli Zaretskii
2019-04-13 18:43                                       ` [PATCH] Renaming non-X x_* identifiers Alex Gramiak
2019-04-13 19:00                                         ` Eli Zaretskii
2019-04-14  3:35                                           ` Alex Gramiak
2019-04-14 14:02                                             ` Eli Zaretskii
2019-04-14 15:57                                               ` Alex Gramiak
2019-04-14 16:10                                                 ` Eli Zaretskii
2019-04-14 17:34                                                   ` Alex Gramiak
2019-04-15 14:51                                                     ` Eli Zaretskii
2019-04-15 17:46                                                       ` Alex Gramiak
2019-04-15 18:43                                                         ` Eli Zaretskii
2019-04-16 16:24                                                           ` Alex Gramiak
2019-04-16 16:45                                                             ` Eli Zaretskii
2019-04-16 16:59                                                               ` Alex Gramiak
2019-04-16 17:04                                                                 ` Eli Zaretskii
2019-04-16 17:07                                                                   ` Alex Gramiak
2019-04-16 18:09                                                                     ` Eli Zaretskii
2019-04-24 19:40                                                                       ` Alex Gramiak
2019-04-25  5:25                                                                         ` Eli Zaretskii
2019-04-25  9:56                                                                           ` Eli Zaretskii
2019-04-25 14:50                                                                             ` Alex Gramiak
2019-04-25 15:04                                                                               ` Eli Zaretskii
2019-04-26  6:52                                                                                 ` Robert Pluim
2019-04-26  8:07                                                                                   ` Eli Zaretskii
2019-04-26 23:12                                                                                     ` Alex Gramiak
2019-04-15 22:01                                                       ` Stefan Monnier
2019-04-16  2:29                                                         ` Eli Zaretskii
2019-04-16 12:55                                                           ` Stefan Monnier
2019-04-16 14:58                                                             ` Eli Zaretskii
2019-04-14  3:47                                         ` Stefan Monnier
2019-04-27  1:53                                     ` Basil L. Contovounesios
2019-04-27  3:46                                       ` Alex Gramiak
2019-04-27 11:37                                         ` Basil L. Contovounesios

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=922F9B91-2E9E-45F6-BB96-66CAE5E9FB81@gnu.org \
    --to=eliz@gnu.org \
    --cc=agrambot@gmail.com \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.