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 16:15:30 +0000 Message-ID: <20190818161530.GB31509@ACM> References: <20190818134804.GA31509@ACM> <83mug6mtjy.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="51695"; 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 18:16: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 1hzNqh-000DKM-5s for ged-emacs-devel@m.gmane.org; Sun, 18 Aug 2019 18:16:07 +0200 Original-Received: from localhost ([::1]:41958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzNqf-0008Dg-JT for ged-emacs-devel@m.gmane.org; Sun, 18 Aug 2019 12:16:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36989) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzNqA-0008Da-RM for emacs-devel@gnu.org; Sun, 18 Aug 2019 12:15:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzNq9-0000Sb-J6 for emacs-devel@gnu.org; Sun, 18 Aug 2019 12:15:34 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:19834 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1hzNq9-0000S3-CV for emacs-devel@gnu.org; Sun, 18 Aug 2019 12:15:33 -0400 Original-Received: (qmail 66385 invoked by uid 3782); 18 Aug 2019 15:22:49 -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 17:22:47 +0200 Original-Received: (qmail 32558 invoked by uid 1000); 18 Aug 2019 16:15:30 -0000 Content-Disposition: inline In-Reply-To: <83mug6mtjy.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:239441 Archived-At: Hello, Eli. On Sun, Aug 18, 2019 at 17:34:09 +0300, Eli Zaretskii wrote: > > Date: Sun, 18 Aug 2019 13:48:04 +0000 > > From: Alan Mackenzie > > Currently, when there are no fringes, inserting an overlay arrow > > overwrites the first two characters on the pertinent line. This is fine > > for things like edebug, where the text is usually indented many columns > > anyway, and only whitespace gets overwritten. > > This is less good for things like compilation-mode, where this arrow > > would obliterate the first two characters of a file name. > > The following amendment fixes this by allowing the arrow to be displayed > > at the BOL, displacing the rest of the line two characters to the right. > > To do this, a new buffer local boolean variable, overlay-arrow-insert is > > introduced. > 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. > 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. > What am I missing? Probably not a lot. Extending the overlay arrow functionality using before-strings would certainly have been easier than changing the display engine. But it may be worthwhile to be able to use the overlay arrow interface for "insertion type" arrows. -- Alan Mackenzie (Nuremberg, Germany).