From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Feature proposal/request: Indentation driven by display engine Date: Sat, 24 May 2008 14:48:51 -0400 Message-ID: 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 1211654953 16319 80.91.229.12 (24 May 2008 18:49:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 May 2008 18:49:13 +0000 (UTC) Cc: emacs-devel Mailinglist To: Carsten Dominik Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 24 20:49:53 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 1JzyoS-0005dG-Mp for ged-emacs-devel@m.gmane.org; Sat, 24 May 2008 20:49:52 +0200 Original-Received: from localhost ([127.0.0.1]:52711 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jzynh-0001SD-Qw for ged-emacs-devel@m.gmane.org; Sat, 24 May 2008 14:49:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jzync-0001OP-1c for emacs-devel@gnu.org; Sat, 24 May 2008 14:49:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jzyna-0001LI-KY for emacs-devel@gnu.org; Sat, 24 May 2008 14:48:59 -0400 Original-Received: from [199.232.76.173] (port=33906 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jzyna-0001L7-CL for emacs-devel@gnu.org; Sat, 24 May 2008 14:48:58 -0400 Original-Received: from 206-248-174-248.dsl.teksavvy.com ([206.248.174.248]:36393 helo=ceviche.home) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JzynZ-0006W8-SX for emacs-devel@gnu.org; Sat, 24 May 2008 14:48:58 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id AA6ECB400C; Sat, 24 May 2008 14:48:51 -0400 (EDT) In-Reply-To: <608B9795-0975-4472-89B0-CA78575496E4@gmail.com> (Carsten Dominik's message of "Sat, 24 May 2008 14:15:59 +0200") 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 (newer, 3) 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:97654 Archived-At: > 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. Can't you remove the display property when you fold to avoid the problem? > 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. Yes, we need to improve the implementation of markers to eliminate the O(N) complexity. Ideally, there'd be some clever way to store the markers directly inside the text-properties tree. > 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. This property would still need to be added to every line. So basically all you're asking is a "before-string" text-property, maybe? > Or are there other comments, for example how this dynamic > indentation could be implemented in a different way? How 'bout modifying the actual buffer text directly? Stefan