Subject: Re: bug#75926: 31.0.50; Cygw32 build break

From: Ken Brown <[email-masked]>
Date: Mon, 24 Feb 2025 17:07:34 -0500

On 2/24/2025 7:35 AM, Eli Zaretskii wrote:
>> Date: Mon, 24 Feb 2025 11:15:05 +0900
>> From: Kazuhiro Ito <[email-masked]>
>> Cc: Ken Brown <[email-masked]>,
>> 	[email-masked]
>>
>>>>> We should probably split w32-win.el into two parts, one loaded by both
>>>>> the native Windows and Cygw32 builds, the other only by the former.
>>>>> But I don't know enough about the Cygw32 build and it needs, and don't
>>>>> have Cygwin installed to build it in the first place, so I'm not the
>>>>> best person for doing that job.  Maybe Ken (CC'ed) has comments or
>>>>> suggestions on this.
>>>>
>>>> That sounds like a reasonable approach, but I don't have time to dig
>>>> into it right now.  I don't actually know the innards of the Cygw32
>>>> build very well.  I never use that build myself, and I only build it
>>>> when someone asks me to test something.  Kazuhiro, are you interested in
>>>> giving Eli's suggestion a try?  I have a feeling that you're more
>>>> familiar with that part of the code than I am.
>>>
>>> Ping!  Kazuhiro, do you intend on giving this a try?|
>>
>> Sorry for the late response.  I didn't have enough time and actually I
>> don't know Emacs internals well in any area.  I simply build Emacs for
>> testing elisp packages I maintain.  But I tried on it.
>> Please review.
> 
> Thanks.  Ken, any comments?

LGTM, though I haven't checked every detail.  It obviously needs lots of 
testing.  I only have some small comments about the commit message:

> Subject: [PATCH] Avoid defining unneeded variables on Cygw32.

No period at the end of the summary line.

> lisp/term/w32-win.el contained definitions of variables which were
> not used on Cygw32.  It is now to split into two files, common
> part and Windows native build specific part. The latter is new
> file, lisp/term/w32-win.el.

                   w32-nt.el

> * src/image.c (Qlibpng_version, Qlibgif_version)
> (Qlibjpeg_version): Don't define on Cygw32 build.
> 
> * src/treesit.c (Qtree_sitter__library_abi): Ditto.
> 
> * lisp/term/w32-win.el (dynamic-library-alist, libpng-version)
> (libgif-version, libjpeg-version, libgnutls-version)
> (tree-sitter--library-abi, gui-backend-set-selection)
> (gui-backend-get-selection, gui-backend-selection-owner-p)
> (gui-selection-exists-p): Moved to lisp/term/w32-nt.el.
> 
> * lisp/term/w32-nt.el: New file, separated Windows native build
> specific part from lisp/term/w32-win.el.
> 
> * lisp/loadup.el: Load term/w32-nt.el on Windows native build.

The bug number should be mentioned somewhere.

Kazuhiro, thanks very much for doing this!

Ken