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: Mon, 26 May 2008 17:02:19 -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 1211835761 31250 80.91.229.12 (26 May 2008 21:02:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 May 2008 21:02:41 +0000 (UTC) Cc: emacs-devel Mailinglist To: Carsten Dominik Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 26 23:03:21 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 1K0jqf-0007CD-Ai for ged-emacs-devel@m.gmane.org; Mon, 26 May 2008 23:03:17 +0200 Original-Received: from localhost ([127.0.0.1]:41828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0jpu-0007yI-3G for ged-emacs-devel@m.gmane.org; Mon, 26 May 2008 17:02:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K0jpo-0007yB-Ux for emacs-devel@gnu.org; Mon, 26 May 2008 17:02:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K0jpm-0007xw-IY for emacs-devel@gnu.org; Mon, 26 May 2008 17:02:23 -0400 Original-Received: from [199.232.76.173] (port=34979 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0jpm-0007xt-7b for emacs-devel@gnu.org; Mon, 26 May 2008 17:02:22 -0400 Original-Received: from vpn-132-204-232-176.acd.umontreal.ca ([132.204.232.176]:60306 helo=ceviche.home) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K0jpl-0000le-EC for emacs-devel@gnu.org; Mon, 26 May 2008 17:02:21 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 6D90AB408C; Mon, 26 May 2008 17:02:19 -0400 (EDT) In-Reply-To: (Carsten Dominik's message of "Sat, 24 May 2008 22:22:46 +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:97761 Archived-At: >> Can't you remove the display property when you fold to avoid the problem? > I could, but then I would have to add and remove text properties during > each fold/unfold, quite some unnecessary overhead. Not sure how much of an overhead that would be. Doesn't seem major. It might be inconvenient to code, tho. Is that what you meant? >>> 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? > Hmm, nice translation of my request. Yes, basically what I am > asking for is a working before-string text property. I know > that adding the property sounds like a lot of effort, but I could > use the font-lock/jit-lock setup to get this done efficiently, > only for the pieces that actually get displayed. The same has been requested for display properties (e.g. to put something in the margin without hiding any of the current text, you need an overlay). A `before-string' text-property might be doable, but I couldn't tell you how easy it'd be to add. If someone wants to implement that, I might accept it (e.g., as a form of `display' property), but if I were you I wouldn't hold my breath (we have enough bugs to fix and are getting close to feature freeze). The best I can offer for now, is to use overlays which you add via jit-lock and which you eagerly remove in the background (so they don't accumulate). >> How 'bout modifying the actual buffer text directly? > Yes, this is in fact what I am doing now, I use TAB, and > wrapping/paragraph-fill support to get fill prefixes. I also modify > indentation during promotion and demotion of entries. > However, there are some disadvantages to this. One obvious one is > this: Org contains a publishing part, and for publishing > we allow examples like code snippets, where indentation might be > important. So the > #+BEGIN_EXAMPLE > #+END_EXAMPLE > construct should be flush to the left margin. I'm not sure I understand why that makes any difference. > Are we going to get a before-string property? WOuld be cool. Well... patches welcome, Stefan