From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: Feature proposal/request: Indentation driven by display engine Date: Sun, 25 May 2008 01:02:53 +0200 Message-ID: <8763t3e25e.fsf@escher.local.home> References: <608B9795-0975-4472-89B0-CA78575496E4@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1211670916 22734 80.91.229.12 (24 May 2008 23:15:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 May 2008 23:15:16 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 25 01:15:56 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K02xw-0000EN-0W for ged-emacs-devel@m.gmane.org; Sun, 25 May 2008 01:15:56 +0200 Original-Received: from localhost ([127.0.0.1]:59635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K02xB-0008Oj-72 for ged-emacs-devel@m.gmane.org; Sat, 24 May 2008 19:15:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K02x6-0008Oa-VQ for emacs-devel@gnu.org; Sat, 24 May 2008 19:15:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K02x6-0008OJ-Ev for emacs-devel@gnu.org; Sat, 24 May 2008 19:15:04 -0400 Original-Received: from [199.232.76.173] (port=36159 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K02x6-0008OG-8h for emacs-devel@gnu.org; Sat, 24 May 2008 19:15:04 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:40884 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K02x5-0005Ec-Po for emacs-devel@gnu.org; Sat, 24 May 2008 19:15:04 -0400 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1K02x4-0007Cs-KY for emacs-devel@gnu.org; Sat, 24 May 2008 23:15:02 +0000 Original-Received: from i5387eb1b.versanet.de ([83.135.235.27]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 24 May 2008 23:15:02 +0000 Original-Received: from Stephen.Berman by i5387eb1b.versanet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 24 May 2008 23:15:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 70 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: i5387eb1b.versanet.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:97674 Archived-At: On Sat, 24 May 2008 14:15:59 +0200 Carsten Dominik wrote: > Hi, > > I have a proposal to make: > > Recently, I have experimented with an idea, to create > indentation on the Emacs display. > > For example, in an outline structure > > * level 1 > text under level 1 > ** Level 2 > text under level 1 > > > I would like to display this as: > > * level 1 > text under level 1 > ** Level 2 > text under level 1 > > without actually inserting white space at the beginning of > each line. So effectively I would like to shift the location > of the left margin on a per-line basis. > > I have been trying to implement this using display properties > on each newline characters, displaying "\n " instead of > just "\n". This basically works, but it interacts badly > with outlining: If I fold the text below a headline, the > first indentation is still displayed. This sounds reminiscent of a bug I reported a while ago; see . > The next thing I tried was using overlays over each "\n", > with an after-string property carrying the indentations. > This works correctly with outline, but when I add thousands > of overlays to a buffer this becomes slow and redisplay and > editing become sluggish, probably because to the huge > amount of markers in the buffer. > > It then occurred to me that it might be useful to support > such a feature directly in the display engine. > For example, if the line contains text with an `indentation' > property, the display engine would add this amount of white > space to before the beginning of the line, maybe also a vertical > line indicating the location of the margin. > > Would that be something useful to add? Anyone who would > volunteer to implement this, because I frankly have no > idea how the display engine works internally. > > Or are there other comments, for example how this dynamic > indentation could be implemented in a different way? I've attempted to develop a version of longlines-mode that implements the same sort of left margin shifting you mention, also by means of a similar display property (I use " \n" concatented with a customizable string). It works fairly well (also with adaptive filling, which does not work with current longlines-mode) but among other problems suffers from the display bug I referred to in the above URL, which sounds like what you are also seeing. In an earlier version I tried using before-string overlays and also ran into scalability problems. I don't know if a before-string property would solve all issues, but it would be nice to have the possibility. Steve Berman