From: "Daniel Colascione" <dancol@dancol.org>
To: "Eli Zaretskii" <eliz@gnu.org>
Cc: monnier@iro.umontreal.ca, Alex Gramiak <agrambot@gmail.com>,
emacs-devel@gnu.org
Subject: Re: [RFC] Using a display_info union instead of a typedef Display_Info
Date: Fri, 12 Apr 2019 12:36:22 -0700 [thread overview]
Message-ID: <8427bdc09f6e42930e6e8378284d771c.squirrel@dancol.org> (raw)
In-Reply-To: <83mukvkoyn.fsf@gnu.org>
>> From: Alex Gramiak <agrambot@gmail.com>
>> Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca
>> Date: Fri, 12 Apr 2019 12:40:45 -0600
>>
>> > 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.
>
> We've been through this before: if these changes don't come together
> with, or closely followed by, the code to support using several
> window-systems in the same session, I'd prefer not to make these
> changes at this time. The advantages you describe are at this point
> theoretical, whereas the disadvantage -- making the code less familiar
> for veteran Emacs hackers -- is very real.
>
> Let's invest our time and energy in making changes that are useful
> today, not in some distant future.
>
>> 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).
>
> There's a way to attain that without the massive changes you propose:
> just make a single function which dispatches by the type of
> output_data. We won't be able to judge which alternative is better
> until and unless we have real code which implements this feature.
The way Alex proposes to do it is the right one. You're proposing using
typecases everywhere, which ends up being unmaintainable. A set of
well-defined hooks that various implements can fill is a concept that's
used all over the place, from Linux file_operations structures to C++
vtables. The efficiency argument is bogus: processors will do jump target
prediction perfectly well, because everyone uses this indirect call
technique.
next prev parent reply other threads:[~2019-04-12 19:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-12 16:50 [RFC] Using a display_info union instead of a typedef Display_Info Alex Gramiak
2019-04-12 17:06 ` Alex Gramiak
2019-04-16 18:54 ` Paul Eggert
2019-04-17 16:55 ` Eli Zaretskii
2019-04-12 17:55 ` Eli Zaretskii
2019-04-12 18:40 ` Alex Gramiak
2019-04-12 19:23 ` Eli Zaretskii
2019-04-12 19:36 ` Daniel Colascione [this message]
2019-04-12 19:44 ` Eli Zaretskii
2019-04-12 19:55 ` Daniel Colascione
2019-04-12 20:12 ` Eli Zaretskii
2019-04-14 1:17 ` Richard Stallman
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=8427bdc09f6e42930e6e8378284d771c.squirrel@dancol.org \
--to=dancol@dancol.org \
--cc=agrambot@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.