From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: highlight-indent-guides in display engine Date: Sun, 07 Jul 2019 18:04:10 +0300 Message-ID: <83sgrh7uol.fsf@gnu.org> References: <20190706211716.semd47fksgh66rug@Ergus> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="160520"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 07 17:04:30 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 1hk8iM-000fh1-5F for ged-emacs-devel@m.gmane.org; Sun, 07 Jul 2019 17:04:30 +0200 Original-Received: from localhost ([::1]:35816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hk8iL-0004Bh-4n for ged-emacs-devel@m.gmane.org; Sun, 07 Jul 2019 11:04:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55045) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hk8iD-0004BR-30 for emacs-devel@gnu.org; Sun, 07 Jul 2019 11:04:22 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hk8i5-0003Sg-Jd; Sun, 07 Jul 2019 11:04:16 -0400 Original-Received: from [176.228.60.248] (port=1533 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hk8i4-0006sQ-MX; Sun, 07 Jul 2019 11:04:13 -0400 In-reply-to: <20190706211716.semd47fksgh66rug@Ergus> (message from Ergus on Sat, 6 Jul 2019 23:17:16 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:238392 Archived-At: > Date: Sat, 6 Jul 2019 23:17:16 +0200 > From: Ergus > > This email is a question about the highlight-indent-guides because some > people find that functionality very useful (and it is very common in > ides/editors around). > > I am using the package with that name [1] but It affects performance a > lot. Specially scrolling and responsiveness in general. Even when > disabling the animations. > > So my question is in two parts: > > 1) Does emacs already provides a way to reproduce this functionality > that does not kill performance so much, even if we sacrifice some > functionality? Not that I know of. But there are some alternatives mentioned in the README of that package -- aren't some of them faster? > 2) Does it make sense to implement it in the display engine as we did > with the fill-column-indicator? Hard to answer this question because the requirements aren't clear. The description of highlight-indent-guides doesn't include any systematic explanations of what the package does, only some quite terse description of some options. Do you want to have all of what that package does, or only part (and if the latter, which part)? In general, I see potential difficulties in making this entirely part of the display code, because what is displayed in the indentation of each line depends directly and indirectly on what happens in preceding lines. This means, for example, that when the display engine is invoked to lay out a single line, it might need to look backwards, potentially very far backwards, to find indentation on previous lines, If I'm not missing something, and this is indeed so, then such searches will almost certainly slow down redisplay considerably. Maybe someone will have clever ideas for how to avoid this problem. Alternatively, we could implement part of the feature in Lisp, and the other part in C. For example, determining what indentation levels should be displayed on a given line could be a job of the Lisp part. But before we decide that this is a viable alternative, we should profile the current Lisp implementation and find out which of its parts are responsible for slowdown. Then we could decide whether this or that reimplementation will make the feature significantly faster.