From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: [Patch]: Allow overlay arrows to be inserted before the text at column zero rather than splatting it. Date: Sun, 18 Aug 2019 18:43:56 +0000 Message-ID: <20190818184356.GC31509@ACM> References: <20190818134804.GA31509@ACM> <83mug6mtjy.fsf@gnu.org> <20190818161530.GB31509@ACM> <83imqumo7i.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="99387"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 18 20:44:08 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hzQ9v-000Pkk-Ud for ged-emacs-devel@m.gmane.org; Sun, 18 Aug 2019 20:44:08 +0200 Original-Received: from localhost ([::1]:42522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzQ9u-0001mB-3R for ged-emacs-devel@m.gmane.org; Sun, 18 Aug 2019 14:44:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51769) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzQ9o-0001m2-TG for emacs-devel@gnu.org; Sun, 18 Aug 2019 14:44:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzQ9n-0002Ub-If for emacs-devel@gnu.org; Sun, 18 Aug 2019 14:44:00 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:21448 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1hzQ9n-0002St-9a for emacs-devel@gnu.org; Sun, 18 Aug 2019 14:43:59 -0400 Original-Received: (qmail 71124 invoked by uid 3782); 18 Aug 2019 17:51:14 -0000 Original-Received: from acm.muc.de (p4FE153BA.dip0.t-ipconnect.de [79.225.83.186]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 18 Aug 2019 19:51:13 +0200 Original-Received: (qmail 968 invoked by uid 1000); 18 Aug 2019 18:43:56 -0000 Content-Disposition: inline In-Reply-To: <83imqumo7i.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:239444 Archived-At: Hello, Eli. On Sun, Aug 18, 2019 at 19:29:37 +0300, Eli Zaretskii wrote: > > Date: Sun, 18 Aug 2019 16:15:30 +0000 > > Cc: emacs-devel@gnu.org > > From: Alan Mackenzie > > > If you want the arrow be displayed before the line's text, why didn't > > > you just put a before-string at the beginning of the line, instead of > > > implementing this in the display engine? > > I think it was to be able to use the same interface that the overlay > > arrow already uses, without having to reimplement a lot of it using > > before-strings. > I think it's a general consensus that the "overlay arrow" feature > should be walked away of, and at some point should be deprecated. I'd > prefer not to base new code on that kludge. I don't think there's anything else in Emacs at the moment that could take its place. The essence here is being able to insert "=>" onto the display _without_ disturbing the horizontal alignment, as needed by debuggers. Maybe, in addition to before-strings and after-strings we need "overlay-strings" (with a better name than that), which would cover up the underlying text. Or do we already have something like that? > > > AFAIU, that would give you most of the patch for free, e.g. you > > > wouldn't need to mess with the set_cursor_from_row hair. > > Yes, there was set_cursor_from_row which I had to change. Somehow, only > > partially initialised glyphs got into it; they pointed to lisp strings, > > but with an offset of -1. This caused an error to be thrown, and the > > surrounding internal_condition_case_1 reentered the redisplay code in a > > loop, causing Emacs to hang. I'm not sure where they failed to get > > initialised, but the function is probably better with the workaround I > > put in. > This might mean there's a bug in the code that generates those glyphs. > One more reason not to implement this in the display code. I'm convinced there's a bug in there, somewhere, but I couldn't discern what the optimal place to complete the initialisation would be. > > But it may be worthwhile to be able to use the overlay arrow > > interface for "insertion type" arrows. > Any particular reason why this might be worth our while? Because I > don't see any. I'm a little less confused than a couple of hours ago. The point is that there are two types of "=>" that can go on a TTY screen: the "overlay arrow" (as above) and the "before-string", which visibly displaces the text on the line to the right. On a GUI frame with left fringes, each of these distinct types of "=>" is replaced by a fringe bitmap. So, the fringe bitmap wants to be as close as possible to two different TTY-style interfaces. This isn't possible. In extending the overlay arrow interface, I think I was subconciously trying to make these three forms of arrows as close as possible to eachother. After all, the "overlay arrows" and "fringe bitmaps" are both implemented directly by display_line, whereas "before-strings" are handled by push_it and setting up the struct IT for a separate string. > Thanks. -- Alan Mackenzie (Nuremberg, Germany).