From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Can we go GTK-only? Date: Mon, 31 Oct 2016 22:50:21 +0200 Message-ID: <8337jcp7jm.fsf@gnu.org> References: <24db2975-17ca-ad01-20c8-df12071fa89a@dancol.org> <4615E73A-19E2-4B79-9889-D3FA686DDDE6@raeburn.org> <11E61536-1345-4B81-999D-2E17F8B14C62@dancol.org> <83a8dkpl67.fsf@gnu.org> <32899811-83bb-e1f0-4f82-3e41846d7d0c@dancol.org> <8360o8pisk.fsf@gnu.org> <20161031135438.317114a2@jabberwock.cb.piermont.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1477947066 21651 195.159.176.226 (31 Oct 2016 20:51:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 31 Oct 2016 20:51:06 +0000 (UTC) Cc: dancol@dancol.org, emacs-devel@gnu.org, raeburn@raeburn.org, monnier@iro.umontreal.ca To: "Perry E. Metzger" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 31 21:51:00 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c1JXg-00044C-K2 for ged-emacs-devel@m.gmane.org; Mon, 31 Oct 2016 21:50:52 +0100 Original-Received: from localhost ([::1]:38521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1JXj-000584-9b for ged-emacs-devel@m.gmane.org; Mon, 31 Oct 2016 16:50:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1JX1-00057x-O1 for emacs-devel@gnu.org; Mon, 31 Oct 2016 16:50:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1JWy-00088b-NN for emacs-devel@gnu.org; Mon, 31 Oct 2016 16:50:11 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1JWy-00088T-KI; Mon, 31 Oct 2016 16:50:08 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3440 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c1JWx-0000dA-RC; Mon, 31 Oct 2016 16:50:08 -0400 In-reply-to: <20161031135438.317114a2@jabberwock.cb.piermont.com> (perry@piermont.com) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:209045 Archived-At: > Date: Mon, 31 Oct 2016 13:54:38 -0400 > From: "Perry E. Metzger" > Cc: Daniel Colascione , raeburn@raeburn.org, > monnier@iro.umontreal.ca, emacs-devel@gnu.org > > > That's exactly the part that needs to be carefully designed. It is > > nowhere near what we have now, because the current expression of > > "the idea of what the desired layout should be" is the glyph > > matrices, which in their present shape cannot be shared by several > > processes. > > > > I'm not even sure we could come up with a useful scheme that would > > allow such a division in a way that will let the communications > > between the two work efficiently. It remains to be shown that this > > is feasible. > > So there would seem to be two obvious ways to keep the two > matrices in sync. One would be to record all the changes made on the > one side as they are made and serialize that. The other way would be > to use a dynamic programming algorithm to find the minimum set of > differences and transmit them. Given that redisplay is likely nearly > continuous, I'd say the former makes more sense. I think you are missing the point. The hard part is to figure out how to convey the information across the divide, without forcing the receiving side to repeat a large part of the layout calculations and face resolution that the sending side already did. The rest is much easier, either way. I suggest to look at the implementation of the write_glyphs method that is invoked when a screen line or its part needs to be delivered to the glass. Specifically, look at 'struct glyph_string', which is the object used to describe a series of glyphs the terminal-specific back-end needs to draw. You will see there what information is being communicated to the back-end; dividing Emacs in two would need to find a way to communicate the equivalent of that, without relying on common memory.