emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Renaming non-X x_* identifiers


From: Alex Gramiak
Subject: Re: [PATCH] Renaming non-X x_* identifiers
Date: Mon, 15 Apr 2019 11:46:18 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Alex Gramiak <address@hidden>
>> Cc: address@hidden,  address@hidden
>> Date: Sun, 14 Apr 2019 11:34:22 -0600
>> 
>> The calls should already be #ifdef'd; it's the declarations that would
>> be #ifdef'd.
>> 
>> > I thought those which don't need to be tested are available on both
>> > GUI and TTY frames.
>> 
>> I believe there are (currently) three categories:
>> 
>> (a) Hooks implemented by all backends, which don't need to be tested.
>> 
>> (b) Hooks implemented by only GUI frames, but occurring in branches that
>> non-GUI frames are used. These have to be tested.
>> 
>> (c) Hooks implemented by only GUI frames, and occurring in branches that
>> only GUI frames are used, and are in a preprocessor conditional. These
>> don't have to be (and some currently aren't) tested.
>
> Thanks, now the issue is clear.
>
> I think I'd prefer to treat (c) the same as (b), though, i.e. add the
> tests where we don't have them, and leave the declarations visible in
> all builds.  My reasoning is that the current situation is more or
> less ad-hoc, and therefore some of the (c) could at some point become
> (b).  If and when that happens, treating them the same will allow
> easier rearrangement of the code.  By contrast, having such a modified
> code fail to compile would require the person making the change to
> perform some non-trivial analysis of why that hook was not declared,
> then move its declaration out of the #ifdef.

That makes sense. I pushed the relevant changes. Is it okay that I left
the get_focus_frame hook in do_switch_frame (frame.c) unchecked? It's
enclosed by a FRAME_WINDOW_P, so a comment in termhooks.c mandating that
window systems implement that hook should be sufficient, no? On the
other hand, it's the only one remaining in the generic code that's left
unchecked.

> It would also increase the number of #ifdef's, which I think is both
> uglier

Indeed.

> and farther from the goal of supporting several window-systems in the
> same session.

Not sure about this, as long the hooks' calling sites and declarations
are compiled in for each supported window-system. I think it would be
different if using #ifndefs, though.


Are there any other issues to discuss, besides the comments in
termhooks.h (which I'll work on soon)? Have you tested this branch on
w32 to check if I missed anything there?



reply via email to

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