Eli Zaretskii writes: >> From: Alex Gramiak >> Cc: Eli Zaretskii , Stefan Monnier >> Date: Fri, 12 Apr 2019 10:50:09 -0600 >> >> The jist of the attached patch is that generalizes x_get_string_resource >> into a terminal hook, and in the process changes several procedures to >> use union display_info instead of the typedef Display_Info, which is >> display system-dependent. One uses DISPLAY_INFO (dpyinfo) to access the >> common structure of the union, and there are macros >> U_DISPLAY_INFO_ to convert from a specific display_info to the >> union. There is also a procedure gui_frame_display_info, that grabs a >> window system display_info from a frame. >> >> I've also included a new procedure decode_display_info, which takes the >> role of the display system-dependent check_x_display_info. I've left out >> the removal of the check_x_display_info since I'm not sure if this patch >> will be accepted. I've also left out NS support until a later stage. >> >> WDYT? > > 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. 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).