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: line/wrap-prefix patch Date: Fri, 04 Jul 2008 22:50:57 +0200 Message-ID: <8763rlpe4u.fsf@escher.local.home> References: <61zlp3k2xx.fsf@fencepost.gnu.org> <87abh1i6xm.fsf@escher.local.home> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1215204688 19048 80.91.229.12 (4 Jul 2008 20:51:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Jul 2008 20:51:28 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 04 22:52:14 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 1KEsGI-0005do-4I for ged-emacs-devel@m.gmane.org; Fri, 04 Jul 2008 22:52:10 +0200 Original-Received: from localhost ([127.0.0.1]:51023 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEsFQ-0007iq-Rb for ged-emacs-devel@m.gmane.org; Fri, 04 Jul 2008 16:51:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KEsFL-0007ia-Qc for emacs-devel@gnu.org; Fri, 04 Jul 2008 16:51:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KEsFL-0007iI-CB for emacs-devel@gnu.org; Fri, 04 Jul 2008 16:51:11 -0400 Original-Received: from [199.232.76.173] (port=51905 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEsFL-0007iF-6b for emacs-devel@gnu.org; Fri, 04 Jul 2008 16:51:11 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:47585 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 1KEsFL-0002NC-6u for emacs-devel@gnu.org; Fri, 04 Jul 2008 16:51:11 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KEsFE-0007YL-Lg for emacs-devel@gnu.org; Fri, 04 Jul 2008 20:51:04 +0000 Original-Received: from i5387d963.versanet.de ([83.135.217.99]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 04 Jul 2008 20:51:04 +0000 Original-Received: from stephen.berman by i5387d963.versanet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 04 Jul 2008 20:51:04 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 52 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: i5387d963.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:100357 Archived-At: On Thu, 03 Jul 2008 13:19:10 +0900 Miles Bader wrote: > Stephen Berman writes: >> My final comment concerns adaptive filling. In my modification of >> longlines.el long lines are appropriately wrapped at different levels of >> indentation, resulting in displays like this: > .. >> With your patch, doing (setq wrap-prefix >> (fill-context-prefix (line-beginning-position) (line-end-position))) >> results in a display like this: > ... >> It would be nice to get the appropriate indentation. > > To get varying prefixes, you can use the `wrap-prefix' text property. Yes, I see this when I evaluate e.g. (put-text-property (point) (1+ (point)) 'wrap-prefix " ") with the cursor on the first character of a wrapped word. Is this the right way to use this text property? > To do so automatically and dynamically would be interesting, but is > obviously more work. If my usage above is correct, I think this approach would effectively need to be augmented by something like longlines.el. If I just enable word wrapping and set wrap-prefix text properties as above, then as soon as I add enough text to force new word wrapping before a position indented by the wrap-prefix property, that indentation is lost. Without line wrapping via post-command-hook a la longlines.el I don't see how to reliably retain the indentation after such changes in the previous text, at least at the lisp level (the alternative would be to integrate "adaptive indentation" into redisplay, as you did with "simple" indentation). > I wonder what ways of specifying the prefix would > be practical (e.g., a text-property covering the "header" text at the > beginning of the physical line, which would be replaced by spaces to get > the wrap prefix, or a regexp used to match the header)? I don't see how any "static" text property assignment will insure the right indentation when the preceding text changes and forces new word wrapping. ********* I was really hoping you would respond to the display problem at window-start. I find it very dissatisfying to regard this as a "misfeature" of Emacs redisplay and leave it that, as RMS seemed to conclude was the only course to take. Is it so infeasible to rework window-start to handle indented wrapped lines? I feel pretty helpless when it comes to the Emacs C core, but if you or anyone would you point me to the locus of this "misfeature" in the code I would be grateful. Steve Berman