emacs-devel
[Top][All Lists]
Advanced

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

Re: [RFC] Using a display_info union instead of a typedef Display_Info


From: Eli Zaretskii
Subject: Re: [RFC] Using a display_info union instead of a typedef Display_Info
Date: Wed, 17 Apr 2019 19:55:35 +0300

> From: Paul Eggert <address@hidden>
> Date: Tue, 16 Apr 2019 11:54:57 -0700
> Cc: address@hidden
> 
> Thanks, this looks like a step in the right direction. I have a few
> minor quibbles: function names like U_DISPLAY_INFO_X shouldn't be
> lowercase, and more important DISPLAY_INFO/display_info should be a
> function and not a macro, and it should return a pointer to new generic
> type, 'struct generic_display_info' say, that contains only the leading
> elements common to all the structures - and all the structures should be
> changed to have a first member of that generic type. See the first
> members of 'struct Lisp_Vector' and 'struct Lisp_Char_Table' for an
> example of this.

I actually don't see why we need a function.  FRAME_DISPLAY_INFO can
continue being a macro, because all it does is return a pointer to a
struct which is a member of 'struct frame'.  The struct to which
FRAME_DISPLAY_INFO will have to change to support several
window-systems in the same session, but the change can be very simple,
like what we do with 'struct font' which is then extended by the
various font backends, see for example w32font.h.  Then when some code
needs to access window-system specific parts of display_info, it will
cast the pointer returned by FRAME_DISPLAY_INFO to the correct struct,
and use the result.

> I have my doubts about installing this in master now, as it doesn't have
> direct benefit now. Ironically, one of the patches I have in mind (which
> should improve overall Emacs performance significantly) involves
> reverting a patch installed some years ago that was intended to be a
> refactoring to do later work that was never done. So I appreciate Eli's
> concern about merging this into master right away.
> 
> However, the patch seems to be a good candidate for installing into a
> scratch branch that later patches can improve on, and once that branch
> has direct benefits we could merge that into master.

IMO, if we don't want to install such changes on master soon, there's
no reason to ask Alex to work on these changes.  After all, all the
ideas, the discussions, and even the patches Alex proposed are all in
the archives, so if someone will want to work on this in the future,
they can pick up where we leave off.

FWIW, if the changes are cleaned up, and for example don't introduce
dispatch functions with platform-specific #ifdef's, but instead go the
way I described above, I'm okay with considering something like that
for master.  I didn't like the original implementation, but I don't
reject the idea itself.



reply via email to

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