From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: David Engster Newsgroups: gmane.emacs.devel Subject: Re: Emacs canvas support Date: Wed, 29 Apr 2020 21:23:30 +0200 Message-ID: <87d07qdrkd.fsf@randomsample> References: <875zdikdge.fsf.ref@yahoo.com> <875zdikdge.fsf@yahoo.com> <834kt21yyo.fsf@gnu.org> <87zhau1uog.fsf@yahoo.com> <83sggmzjp8.fsf@gnu.org> <87mu6u1tii.fsf@yahoo.com> <83o8raziis.fsf@gnu.org> <877dxy1smz.fsf@yahoo.com> <87o8rae0ao.fsf@randomsample> <83lfmexmfp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="27071"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux) Cc: luangruo@yahoo.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 29 21:24:14 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jTsJY-0006tf-8H for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Apr 2020 21:24:12 +0200 Original-Received: from localhost ([::1]:60104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTsJX-0003hx-Ae for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Apr 2020 15:24:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45184) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTsIz-0002g8-Tt for emacs-devel@gnu.org; Wed, 29 Apr 2020 15:23:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTsIx-0005Ah-M1 for emacs-devel@gnu.org; Wed, 29 Apr 2020 15:23:37 -0400 Original-Received: from [2a03:4000:42:1a1:9400:eeff:feb4:c8a0] (port=46594 helo=randomsample.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jTsIx-00055b-3M; Wed, 29 Apr 2020 15:23:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=g/oxhxuweF7LusxDLVpW4+oiAvJ2jIi/aYiy6jHGF+Y=; b=RCCglR6hPS26zcEnlpN3AhTyn 0Drp+hd4+3pHAaeOLaVjmYfQNzNIv8mWrmPhIcl95XgKtsaZb+U6fiRIT1Dnix36ZBfMrsXj6DXeb jzxYwmzPjApOnLxQgAC8Z0ejmEXon+Bj3vY/5rwVk8OgW5qQkWQghvuIUAaZg1xpXhwj6R5qOPZjR +B9r6OEPSTpdETvvxJEWWR4KLqUjM/MTYTSGXv3p43S/8xvEraY0x0D84MTR2+LkitbVpHToDc37V tPtzg8edjGFd4D7X0GddIfmoNCkWQgCBYp/AoZQZe2imm50ISqiMM1smMk/Y7E5toePQiNUMPLAOZ t0LUwzPBg==; Original-Received: from ip5f5abaee.dynamic.kabel-deutschland.de ([95.90.186.238] helo=void) by randomsample.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jTsIt-00047A-Ad; Wed, 29 Apr 2020 21:23:31 +0200 In-Reply-To: <83lfmexmfp.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 29 Apr 2020 19:54:02 +0300") Received-SPF: pass client-ip=2a03:4000:42:1a1:9400:eeff:feb4:c8a0; envelope-from=deng@randomsample.de; helo=randomsample.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/29 15:23:32 X-ACL-Warn: Detected OS = ??? X-Received-From: 2a03:4000:42:1a1:9400:eeff:feb4:c8a0 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:248181 Archived-At: >> From: David Engster >> Cc: Eli Zaretskii , emacs-devel@gnu.org >> Date: Wed, 29 Apr 2020 18:14:55 +0200 > >> >> IMHO, What would be much more exciting, is if you could draw directly >> over normal text. This would enable a whole new set of >> possibilities. For instance, I always liked visual diff tools like >> 'Meld' or 'Code Compare', but I don't see how you could do this with >> Emacs. Or things like proper indentation guides, or widgets inside text >> for code folding. Yes, those can be done in Emacs today, but it is very >> difficult to get right and often not really satisfactory (weird >> interactions between packages, too slow, etc.). > > AFAIU, Meld seems to draw the graphics _between_ windows, and only > highlights the source lines with background colors. I think we can do > that if we use an extra window in-between the two being compared, and > put images in that extra window to show the graphical description of > the changes between the two versions. I actually tried exactly that, many years ago. I dimly remember that handling the coordinates was pretty complicated and it was slow. Like, orders of magnitude too slow, even with the simplest and fastest image types. There was no way you would ever be able to scroll text and update the diff visualization alongside it. It was just a flickery mess. It would of course be possible to visualize the diff in an idle timer and not during scrolling, but that is exactly what I mean above with "not really satisfactory", so I gave up. > Drawing over normal text, if we don't want to redesign the entire > display engine, needs some new kind of "display element" ( a sibling > to "character", "image", "stretch", etc.), one that doesn't > necessarily have any effect on the metrics of the screen lines it is > drawn upon. I'm not sure I have a clear idea about what features such > a drawing will need to support, but it could be possible to add such > an element with not too much effort. Would someone want to come up > with a reasonable list of requirements for such a feature? When I played around with it, I thought a first iteration could be to simply expose the basic Cairo API to ELisp, which is essentially drawing lines/arcs/rectangles and filling. I thought that maybe it would be possible that one could handle this like a graphical transparent overlay, but I'm afraid I'm way out of my depth here. I have no idea how one would handle scrolling, for instance. -David