From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: line/wrap-prefix patch Date: Sat, 05 Jul 2008 09:52:17 +0900 Message-ID: <87d4lt5f0e.fsf@catnip.gol.com> References: <61zlp3k2xx.fsf@fencepost.gnu.org> <87abh1i6xm.fsf@escher.local.home> <8763rlpe4u.fsf@escher.local.home> Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1215219162 22071 80.91.229.12 (5 Jul 2008 00:52:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Jul 2008 00:52:42 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stephen Berman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 05 02:53:29 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 1KEw1o-0008R6-2X for ged-emacs-devel@m.gmane.org; Sat, 05 Jul 2008 02:53:28 +0200 Original-Received: from localhost ([127.0.0.1]:39417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEw0x-0001rB-1s for ged-emacs-devel@m.gmane.org; Fri, 04 Jul 2008 20:52:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KEw0s-0001r6-W8 for emacs-devel@gnu.org; Fri, 04 Jul 2008 20:52:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KEw0q-0001qu-Kt for emacs-devel@gnu.org; Fri, 04 Jul 2008 20:52:29 -0400 Original-Received: from [199.232.76.173] (port=42729 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEw0q-0001qr-EJ for emacs-devel@gnu.org; Fri, 04 Jul 2008 20:52:28 -0400 Original-Received: from smtp11.dentaku.gol.com ([203.216.5.73]:58096) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KEw0m-0004Li-Qt; Fri, 04 Jul 2008 20:52:25 -0400 Original-Received: from 218.33.235.146.eo.eaccess.ne.jp ([218.33.235.146] helo=catnip.gol.com) by smtp11.dentaku.gol.com with esmtpa (Dentaku) id 1KEw0h-0002VI-Qy; Sat, 05 Jul 2008 09:52:19 +0900 Original-Received: by catnip.gol.com (Postfix, from userid 1000) id 197292F3A; Sat, 5 Jul 2008 09:52:17 +0900 (JST) System-Type: i686-pc-linux-gnu In-Reply-To: <8763rlpe4u.fsf@escher.local.home> (Stephen Berman's message of "Fri, 04 Jul 2008 22:50:57 +0200") Original-Lines: 62 X-Virus-Scanned: ClamAV GOL (outbound) X-Abuse-Complaints: abuse@gol.com 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:100361 Archived-At: Stephen Berman writes: >> 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? You can put the property over the entire region of text that the wrap-prefix applies to; there's no need to know which words will actually get wrapped. >> 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 No. >> 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. The "right" indendation depends only on the text following the preceding _hard_ line-start, i.e, the preceding "non-wrap prefix". E.g., if you have the following long line: - This is a long-line-aka-paragraph blah blah blah blah blah blah blah and you want to have it wrapped (at display-time) like: - This is a long-line-aka-paragraph blah blah blah blah blah blah blah The tricky part is getting the wrap-prefix " " by examining the current non-wrap prefix, " - " in this case. Currently there's no way of having the display engine do it, so one could alternatively have a font-lock-like mechanism that turned hard paragraph prefixes into wrap-prefix text properties. One could also try to come up with a mechanism to have the display engine do it dynamically (as I talked about a bit in my previous message). > ********* > 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. I haven't been able the reproduce it so far, so I need to try to do so more thoroughly. I'll try to do so this weekend. -Miles -- Friendship, n. A ship big enough to carry two in fair weather, but only one in foul.