From lennart.borgman@gmail.com Thu Sep 18 19:49:18 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.5 required=4.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 19 Sep 2008 02:49:18 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8J2nEsI032437 for ; Thu, 18 Sep 2008 19:49:15 -0700 Received: from mail.gnu.org ([199.232.76.166]:35694 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KgW1b-00026U-Nz for emacs-pretest-bug@gnu.org; Thu, 18 Sep 2008 22:47:16 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KgW3Q-00030s-1y for emacs-pretest-bug@gnu.org; Thu, 18 Sep 2008 22:49:11 -0400 Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]:49325) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KgW3O-000300-Vi for emacs-pretest-bug@gnu.org; Thu, 18 Sep 2008 22:49:07 -0400 Received: from c83-254-151-87.bredband.comhem.se ([83.254.151.87]:64423 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1KgW3L-0004lu-3c for emacs-pretest-bug@gnu.org; Fri, 19 Sep 2008 04:49:03 +0200 Message-ID: <48D31317.8080603@gmail.com> Date: Fri, 19 Sep 2008 04:48:55 +0200 From: "Lennart Borgman (gmail)" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: emacs-pretest-bug@gnu.org Subject: 23.0.60; left/right-margin property is not honored on word-wrapped lines X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 080918-0, 2008-09-18), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.87 X-Scan-Result: No virus found in message 1KgW3L-0004lu-3c. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1KgW3L-0004lu-3c a7cf4824938b4b8d314341eb5fbaf10d X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6? (barebone, rare!) When a line is wrapped the `left-margin' text property is honored only on the first visual line. This seems ok to me unless word-wrap is true. In that case I think that `left-margin' and `right-margin' should be honored on all visual lines. In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600) of 2008-09-18 Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include -fno-crossjumping' From cyd@stupidchicken.com Fri Sep 19 08:54:39 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.8 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 999) by emacsbugs.donarmstrong.com; 19 Sep 2008 15:54:39 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8JFsard024052 for <999@emacsbugs.donarmstrong.com>; Fri, 19 Sep 2008 08:54:37 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 5236057E352; Fri, 19 Sep 2008 11:54:34 -0400 (EDT) From: Chong Yidong To: "Lennart Borgman \(gmail\)" Cc: 999@debbugs.gnu.org Subject: Re: 23.0.60; left/right-margin property is not honored on word-wrapped lines Date: Fri, 19 Sep 2008 11:54:32 -0400 Message-ID: <87abe45dxj.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > When a line is wrapped the `left-margin' text property is honored only > on the first visual line. This seems ok to me unless word-wrap is > true. In that case I think that `left-margin' and `right-margin' > should be honored on all visual lines. A word-wrapped line is essentially the same as a continued line; it's just that the line is continued at a word boundary rather than a window edge. In terms of the buffer contents, it's all one long line, so there's no reason for margin properties to have any effect on the subsequent *screen* lines in the wrapped line. From lennart.borgman@gmail.com Fri Sep 19 16:33:17 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.0 required=4.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 999) by emacsbugs.donarmstrong.com; 19 Sep 2008 23:33:17 +0000 Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8JNXDcS025637 for <999@emacsbugs.donarmstrong.com>; Fri, 19 Sep 2008 16:33:14 -0700 Received: from c83-254-151-87.bredband.comhem.se ([83.254.151.87]:63615 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1KgpTM-0007Hh-8a; Sat, 20 Sep 2008 01:33:12 +0200 Message-ID: <48D436B4.1020904@gmail.com> Date: Sat, 20 Sep 2008 01:33:08 +0200 From: "Lennart Borgman (gmail)" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Chong Yidong CC: 999@debbugs.gnu.org Subject: Re: 23.0.60; left/right-margin property is not honored on word-wrapped lines References: <87abe45dxj.fsf@cyd.mit.edu> In-Reply-To: <87abe45dxj.fsf@cyd.mit.edu> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 080919-0, 2008-09-19), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.87 X-Scan-Result: No virus found in message 1KgpTM-0007Hh-8a. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1KgpTM-0007Hh-8a ae4b6bbbac98b08fd5df9126b28b49dd Chong Yidong wrote: >> When a line is wrapped the `left-margin' text property is honored only >> on the first visual line. This seems ok to me unless word-wrap is >> true. In that case I think that `left-margin' and `right-margin' >> should be honored on all visual lines. > > A word-wrapped line is essentially the same as a continued line; it's > just that the line is continued at a word boundary rather than a window > edge. In terms of the buffer contents, it's all one long line, so > there's no reason for margin properties to have any effect on the > subsequent *screen* lines in the wrapped line. But the reason for wrapping at words is to enhance readability for the user. For precisely this reason I think that the left margin property should be used indent the wrapped line too. After all that is how fill-paragraph works. I think we should think the same about wrapped lines. From cyd@stupidchicken.com Fri Sep 19 20:13:54 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.3 required=4.0 tests=AWL,BAYES_00,GMAIL autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 999-done) by emacsbugs.donarmstrong.com; 20 Sep 2008 03:13:55 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8K3DpYc006919 for <999-done@emacsbugs.donarmstrong.com>; Fri, 19 Sep 2008 20:13:53 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 2818C57E342; Fri, 19 Sep 2008 23:13:54 -0400 (EDT) From: Chong Yidong To: "Lennart Borgman \(gmail\)" Cc: 999-done@debbugs.gnu.org Subject: Re: 23.0.60; left/right-margin property is not honored on word-wrapped lines References: <87abe45dxj.fsf@cyd.mit.edu> <48D436B4.1020904@gmail.com> Date: Fri, 19 Sep 2008 23:13:54 -0400 In-Reply-To: <48D436B4.1020904@gmail.com> (Lennart Borgman's message of "Sat, 20 Sep 2008 01:33:08 +0200") Message-ID: <871vzfjyq5.fsf@cyd.mit.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii "Lennart Borgman (gmail)" writes: > But the reason for wrapping at words is to enhance readability for the > user. For precisely this reason I think that the left margin property > should be used indent the wrapped line too. > > After all that is how fill-paragraph works. I think we should think the > same about wrapped lines. The variable wrap-prefix can be used for this. It would not be consistent to make the left/right margin affect continued lines. From lennart.borgman@gmail.com Sat Sep 20 02:40:18 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.5 required=4.0 tests=AWL,BAYES_00,GMAIL, RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 999-done) by emacsbugs.donarmstrong.com; 20 Sep 2008 09:40:19 +0000 Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8K9eEbR014228 for <999-done@emacsbugs.donarmstrong.com>; Sat, 20 Sep 2008 02:40:16 -0700 Received: from c83-254-151-87.bredband.comhem.se ([83.254.151.87]:59847 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1Kgywn-0007t1-6K; Sat, 20 Sep 2008 11:40:14 +0200 Message-ID: <48D4C4F8.1000909@gmail.com> Date: Sat, 20 Sep 2008 11:40:08 +0200 From: "Lennart Borgman (gmail)" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Chong Yidong CC: 999-done@debbugs.gnu.org Subject: Re: 23.0.60; left/right-margin property is not honored on word-wrapped lines References: <87abe45dxj.fsf@cyd.mit.edu> <48D436B4.1020904@gmail.com> <871vzfjyq5.fsf@cyd.mit.edu> In-Reply-To: <871vzfjyq5.fsf@cyd.mit.edu> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 080919-0, 2008-09-19), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.87 X-Scan-Result: No virus found in message 1Kgywn-0007t1-6K. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1Kgywn-0007t1-6K adbc20fa3bb14db7f6f8f3d18bcbf4d1 Chong Yidong wrote: > "Lennart Borgman (gmail)" writes: > >> But the reason for wrapping at words is to enhance readability for the >> user. For precisely this reason I think that the left margin property >> should be used indent the wrapped line too. >> >> After all that is how fill-paragraph works. I think we should think the >> same about wrapped lines. > > The variable wrap-prefix can be used for this. > > It would not be consistent to make the left/right margin affect > continued lines. That is no good replacement. It does not solve the problem at the user level. You are in effect saying that this should not work as fill paragraph. Can you please give the reason for this. And please reopen this bug! From cyd@stupidchicken.com Sat Sep 20 07:19:13 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.3 required=4.0 tests=AWL,BAYES_00,GMAIL autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 999-done) by emacsbugs.donarmstrong.com; 20 Sep 2008 14:19:13 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8KEJAFI016406 for <999-done@emacsbugs.donarmstrong.com>; Sat, 20 Sep 2008 07:19:11 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id C156357E34B; Sat, 20 Sep 2008 10:19:14 -0400 (EDT) From: Chong Yidong To: "Lennart Borgman \(gmail\)" Cc: 999-done@debbugs.gnu.org Subject: Re: 23.0.60; left/right-margin property is not honored on word-wrapped lines References: <87abe45dxj.fsf@cyd.mit.edu> <48D436B4.1020904@gmail.com> <871vzfjyq5.fsf@cyd.mit.edu> <48D4C4F8.1000909@gmail.com> Date: Sat, 20 Sep 2008 10:19:14 -0400 In-Reply-To: <48D4C4F8.1000909@gmail.com> (Lennart Borgman's message of "Sat, 20 Sep 2008 11:40:08 +0200") Message-ID: <87hc8agasd.fsf@cyd.mit.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii "Lennart Borgman (gmail)" writes: >> The variable wrap-prefix can be used for this. > > That is no good replacement. It does not solve the problem at the user > level. > > You are in effect saying that this should not work as fill paragraph. > Can you please give the reason for this. The situation is not at all similar. Fill paragraph inserts real whitespace in front of the filled line; you can undo this by using the usual deletion commands. If word wrap were to make continued lines begin anywhere other than the left window edge, that would be "fake" whitespace that cannot be removed by the user. That's not acceptable behavior. From lennart.borgman@gmail.com Sat Sep 20 16:46:32 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.5 required=4.0 tests=AWL,BAYES_00,GMAIL, RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 999-done) by emacsbugs.donarmstrong.com; 20 Sep 2008 23:46:32 +0000 Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8KNkSYi023509 for <999-done@emacsbugs.donarmstrong.com>; Sat, 20 Sep 2008 16:46:30 -0700 Received: from c83-254-151-87.bredband.comhem.se ([83.254.151.87]:64277 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1KhC9k-0000vj-6i; Sun, 21 Sep 2008 01:46:28 +0200 Message-ID: <48D58B4E.6070005@gmail.com> Date: Sun, 21 Sep 2008 01:46:22 +0200 From: "Lennart Borgman (gmail)" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Chong Yidong CC: 999-done@debbugs.gnu.org Subject: Re: 23.0.60; left/right-margin property is not honored on word-wrapped lines References: <87abe45dxj.fsf@cyd.mit.edu> <48D436B4.1020904@gmail.com> <871vzfjyq5.fsf@cyd.mit.edu> <48D4C4F8.1000909@gmail.com> <87hc8agasd.fsf@cyd.mit.edu> In-Reply-To: <87hc8agasd.fsf@cyd.mit.edu> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 080920-0, 2008-09-20), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.87 X-Scan-Result: No virus found in message 1KhC9k-0000vj-6i. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1KhC9k-0000vj-6i ff9b7334de2e3b3009628aec63ab45f6 Chong Yidong wrote: > "Lennart Borgman (gmail)" writes: > >>> The variable wrap-prefix can be used for this. >> That is no good replacement. It does not solve the problem at the user >> level. >> >> You are in effect saying that this should not work as fill paragraph. >> Can you please give the reason for this. > > The situation is not at all similar. Fill paragraph inserts real > whitespace in front of the filled line; you can undo this by using the > usual deletion commands. If word wrap were to make continued lines > begin anywhere other than the left window edge, that would be "fake" > whitespace that cannot be removed by the user. That's not acceptable > behavior. We are talking about the visual representation. Are you saying that the user will be fooled by the "faked" whitespace? I do not think that will be the case here. Or, not more than the "faked" new lines. I just think that a visual representation where the continuation lines are (visually aka faked) indented as the first line is a more useful visual representation. We have already made that conclusion in fill paragraph. Typical use cases I can see is for example in org-mode or when editing text parts of XHTML files. From cyd@stupidchicken.com Sat Sep 20 20:11:14 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.3 required=4.0 tests=AWL,BAYES_00,GMAIL autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 999-done) by emacsbugs.donarmstrong.com; 21 Sep 2008 03:11:14 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8L3BBpx000454 for <999-done@emacsbugs.donarmstrong.com>; Sat, 20 Sep 2008 20:11:12 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id A5E6457E34B; Sat, 20 Sep 2008 23:11:18 -0400 (EDT) From: Chong Yidong To: "Lennart Borgman \(gmail\)" Cc: 999-done@debbugs.gnu.org Subject: Re: 23.0.60; left/right-margin property is not honored on word-wrapped lines References: <87abe45dxj.fsf@cyd.mit.edu> <48D436B4.1020904@gmail.com> <871vzfjyq5.fsf@cyd.mit.edu> <48D4C4F8.1000909@gmail.com> <87hc8agasd.fsf@cyd.mit.edu> <48D58B4E.6070005@gmail.com> Date: Sat, 20 Sep 2008 23:11:18 -0400 In-Reply-To: <48D58B4E.6070005@gmail.com> (Lennart Borgman's message of "Sun, 21 Sep 2008 01:46:22 +0200") Message-ID: <87r67e6vmx.fsf@cyd.mit.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii "Lennart Borgman (gmail)" writes: > We are talking about the visual representation. Are you saying that the > user will be fooled by the "faked" whitespace? > > I do not think that will be the case here. Or, not more than the "faked" > new lines. Plenty of computer programs "fake" whitespace at the end of the line, but none fake it at the beginning. Users will be fooled for this reason. > I just think that a visual representation where the continuation lines > are (visually aka faked) indented as the first line is a more useful > visual representation. We have already made that conclusion in fill > paragraph. > > Typical use cases I can see is for example in org-mode or when editing > text parts of XHTML files. This can be left to the discretion of individual major modes, by setting wrap-prefix or some other method. I don't think it's desireable to do it in general, and left-margin/right-margin is almost certainly the wrong variable for this. From lennart.borgman@gmail.com Sat Sep 20 20:27:39 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.4 required=4.0 tests=AWL,BAYES_00,FVGT_m_MULTI_ODD, GMAIL,RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 999-done) by emacsbugs.donarmstrong.com; 21 Sep 2008 03:27:39 +0000 Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8L3RYeh005952 for <999-done@emacsbugs.donarmstrong.com>; Sat, 20 Sep 2008 20:27:35 -0700 Received: from c83-254-151-87.bredband.comhem.se ([83.254.151.87]:60449 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1KhFbg-00035a-5O; Sun, 21 Sep 2008 05:27:33 +0200 Message-ID: <48D5BF23.6090901@gmail.com> Date: Sun, 21 Sep 2008 05:27:31 +0200 From: "Lennart Borgman (gmail)" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Chong Yidong CC: 999-done@debbugs.gnu.org Subject: Re: 23.0.60; left/right-margin property is not honored on word-wrapped lines References: <87abe45dxj.fsf@cyd.mit.edu> <48D436B4.1020904@gmail.com> <871vzfjyq5.fsf@cyd.mit.edu> <48D4C4F8.1000909@gmail.com> <87hc8agasd.fsf@cyd.mit.edu> <48D58B4E.6070005@gmail.com> <87r67e6vmx.fsf@cyd.mit.edu> In-Reply-To: <87r67e6vmx.fsf@cyd.mit.edu> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 080920-0, 2008-09-20), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.87 X-Scan-Result: No virus found in message 1KhFbg-00035a-5O. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1KhFbg-00035a-5O e8a4e0c147793f2cfbf9eebb33ad53d2 Chong Yidong wrote: > "Lennart Borgman (gmail)" writes: > >> We are talking about the visual representation. Are you saying that the >> user will be fooled by the "faked" whitespace? >> >> I do not think that will be the case here. Or, not more than the "faked" >> new lines. > > Plenty of computer programs "fake" whitespace at the end of the line, > but none fake it at the beginning. Users will be fooled for this > reason. I think that depends on the type of program. Applications for writing text (like Word or OpenOffice) have concepts like indenting of paragraphs. It is something like that I want to achieve here. >> I just think that a visual representation where the continuation lines >> are (visually aka faked) indented as the first line is a more useful >> visual representation. We have already made that conclusion in fill >> paragraph. >> >> Typical use cases I can see is for example in org-mode or when editing >> text parts of XHTML files. > > This can be left to the discretion of individual major modes, by setting > wrap-prefix or some other method. I don't think it's desireable to do > it in general, and left-margin/right-margin is almost certainly the > wrong variable for this. Yes, left-margin/right-margin might be a bad and clumsy idea. Using the actual indentation seems more easy. I tried to implement something like I suggested here in elisp instead. It seems usable (to my surprise, I thought it would be too slow). Note that the mumamo-* macro below is just a copy from jit-lock (if I remember correctly). When indenting a line the continuation lines will get the same visual indentation. ;; Fix-me: There is a confusion between buffer and window margins ;; here. Also the doc says that left-margin-width and dito right may ;; be nil. However they seem to be 0 by default, but when displaying a ;; buffer in a window then window-margins returns (nil). (defun wrap-to-fill-set-values () "Use `fill-column' display columns in buffer windows." (let ((buf-windows (get-buffer-window-list (current-buffer)))) (dolist (win buf-windows) (if wrap-to-fill-mode (let* ((edges (window-edges win)) (win-width (- (nth 2 edges) (nth 0 edges))) (extra-width (- win-width fill-column)) (left-marg (if wrap-to-fill-left-marg-use wrap-to-fill-left-marg-use (- (/ extra-width 2) 1))) (right-marg (- win-width fill-column left-marg)) (win-margs (window-margins win)) (old-left (or (car win-margs) 0)) (old-right (or (cdr win-margs) 0))) (unless (> left-marg 0) (setq left-marg 0)) (unless (> right-marg 0) (setq right-marg 0)) (unless (and (= old-left left-marg) (= old-right right-marg)) (set-window-margins win left-marg right-marg))) (set-window-buffer win (current-buffer)))))) (defcustom wrap-to-fill-left-marg nil "Left margin handling for `wrap-to-fill-mode'. Used by `wrap-to-fill-mode'. If nil then center the display columns. Otherwise it should be a number which will be the left margin." :type '(choice (const :tag "Center" nil) (integer :tag "Left margin")) :group 'convenience) (make-variable-buffer-local 'wrap-to-fill-left-marg) (defvar wrap-to-fill-left-marg-use 0) (make-variable-buffer-local 'wrap-to-fill-left-marg-use) (defcustom wrap-to-fill-left-marg-modes '(text-mode fundamental-mode) "Major modes where `wrap-to-fill-left-margin' may be nil." :type '(repeat commandp) :group 'convenience) (defun wrap-to-fill-set-prefix (min max) "Set `wrap-prefix' text property from point MIN to MAX." (let ((here (point)) beg-pos end-pos ind-str (inhibit-field-text-motion t) ) (goto-char min) (forward-line 0) (when (< (point) min) (forward-line)) (mumamo-with-buffer-prepared-for-jit-lock (while (and (<= (point) max) (< (point) (point-max))) (setq beg-pos (point)) (setq end-pos (line-end-position)) (when (equal (get-text-property beg-pos 'wrap-prefix) (get-text-property beg-pos 'wrap-to-fill-prefix)) (skip-chars-forward "[:blank:]") (setq ind-str (buffer-substring-no-properties beg-pos (point))) (put-text-property beg-pos end-pos 'wrap-prefix ind-str) (put-text-property beg-pos end-pos 'wrap-to-fill-prefix ind-str)) (forward-line))) (goto-char here))) (defun wrap-to-fill-after-change (min max old-len) "For `after-change-functions'. See the hook for MIN, MAX and OLD-LEN." (let ((here (point)) (inhibit-field-text-motion t)) (goto-char min) (setq min (line-beginning-position)) (goto-char max) (setq max (line-end-position)) (wrap-to-fill-set-prefix min max))) (defun wrap-to-fill-scroll-fun (window start-pos) "For `window-scroll-functions'. See the hook for WINDOW and START-POS." (let ((min (or start-pos (window-start window))) (max (window-end window t))) (wrap-to-fill-set-prefix min max))) (define-minor-mode wrap-to-fill-mode "Use `fill-column' display columns in buffer windows. By default the display columns are centered, but see the option `wrap-to-fill-left-marg'. Note 1: When turning this on `visual-line-mode' is also turned on. This is not reset when turning off this mode. Note 2: The text property `wrap-prefix' is set by this mode to indent continuation lines. This is not recorded in the undo list." :lighter " WrapFill" :group 'convenience (if wrap-to-fill-mode (progn (setq wrap-to-fill-left-marg-use wrap-to-fill-left-marg) (unless (or wrap-to-fill-left-marg-use (memq major-mode wrap-to-fill-left-marg-modes)) (setq wrap-to-fill-left-marg-use (default-value 'wrap-to-fill-left-marg-use))) (add-hook 'window-configuration-change-hook 'wrap-to-fill-set-values nil t) (add-hook 'after-change-functions 'wrap-to-fill-after-change nil t) (add-hook 'window-scroll-functions 'wrap-to-fill-scroll-fun nil t) (visual-line-mode 1) (dolist (window (get-buffer-window-list (current-buffer))) (wrap-to-fill-scroll-fun window nil))) (remove-hook 'window-configuration-change-hook 'wrap-to-fill-set-values t) (remove-hook 'after-change-functions 'wrap-to-fill-after-change t) (remove-hook 'window-scroll-functions 'wrap-to-fill-scroll-fun t) (let ((here (point)) (inhibit-field-text-motion t) beg-pos end-pos) (mumamo-with-buffer-prepared-for-jit-lock (save-restriction (widen) (goto-char (point-min)) (while (< (point) (point-max)) (setq beg-pos (point)) (setq end-pos (line-end-position)) (when (equal (get-text-property beg-pos 'wrap-prefix) (get-text-property beg-pos 'wrap-to-fill-prefix)) (remove-list-of-text-properties beg-pos end-pos '(wrap-prefix))) (forward-line)) (remove-list-of-text-properties (point-min) (point-max) '(wrap-to-fill-prefix))) (goto-char here)))) (wrap-to-fill-set-values)) From unknown Sun Jun 22 11:44:31 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Sun, 19 Oct 2008 14:24:03 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator