From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: display word wrapping Date: 28 May 2004 10:37:17 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1085739043 19211 80.91.224.253 (28 May 2004 10:10:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 28 May 2004 10:10:43 +0000 (UTC) Cc: emacs-devel@gnu.org, Miles Bader Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri May 28 12:10:37 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BTeJw-0001nL-00 for ; Fri, 28 May 2004 12:10:36 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BTeJw-0002yy-00 for ; Fri, 28 May 2004 12:10:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BTct2-0002DS-Ig for emacs-devel@quimby.gnus.org; Fri, 28 May 2004 04:38:44 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BTcs8-00022c-Pc for emacs-devel@gnu.org; Fri, 28 May 2004 04:37:48 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BTcra-0001rH-FX for emacs-devel@gnu.org; Fri, 28 May 2004 04:37:46 -0400 Original-Received: from [212.88.64.25] (helo=mail-relay.sonofon.dk) by monty-python.gnu.org with smtp (Exim 4.34) id 1BTcrY-0001qP-F1 for emacs-devel@gnu.org; Fri, 28 May 2004 04:37:13 -0400 Original-Received: (qmail 8722 invoked from network); 28 May 2004 08:37:10 -0000 Original-Received: from unknown (HELO kfs-l.imdomain.dk.cua.dk) (213.83.150.2) by 0 with SMTP; 28 May 2004 08:37:10 -0000 Original-To: rms@gnu.org In-Reply-To: Original-Lines: 58 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:24072 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:24072 Richard Stallman writes: > I've always thought that since the display engine does `proper' wrapping > for variable-width characters already (variable-width fonts, tabs, etc), > which really seems to work awful darn well, maybe it wouldn't be too > hard to trick it into treating words in the buffer as `characters' for > wrapping purposes. > > I am not sure what those words mean. Do you mean word-wrapping at > redisplay time without use of real newline characters? Yes. Even window's notepad can do word wrapping without modifying the buffer text... > > This causes problems, not just for C-n, but for all editing > facilities that have something to do with newlines. So I think > we should try a different approach. It may cause (a lot of) problems when EDITING such text, but it makes perfect sense to have automatic word wrapping when you VIEW text that is a lot wider than your current window. By default, redisplay already wraps long lines at character boundaries -- my idea was that it should be possible (and not too difficult) to let redisplay backtrack at the right edge (or left with bidi) to find a whitespace character, and do the automatic wrapping there instead. One way to do it could be to put a virtual "space" display property on that space character with a width exactly equal to the number of pixels needed to reach the right edge of the window. The same text again with wrapping at 80 columns: It may cause (a lot of) problems when EDITING such text, but it makes perfect se nse to have automatic word wrapping when you VIEW text that is a lot wider than your current window. By default, redisplay already wraps long lines at characte r boundaries -- my idea was that it should be possible (and not too difficult) t o let redisplay backtrack at the right edge (or left with bidi) to find a whites pace character, and do the automatic wrapping there instead. One way to do it c ould be to put a virtual "space" display property on that space character with a width exactly equal to the number of pixels needed to reach the right edge of th e window. And now with the proposed (virtual) word wrapping: It may cause (a lot of) problems when EDITING such text, but it makes perfect sense to have automatic word wrapping when you VIEW text that is a lot wider than your current window. By default, redisplay already wraps long lines at character boundaries -- my idea was that it should be possible (and not too difficult) to let redisplay backtrack at the right edge (or left with bidi) to find a whitespace character, and do the automatic wrapping there instead. One way to do it could be to put a virtual "space" display property on that space character with a width exactly equal to the number of pixels needed to reach the right edge of the window. > > I think we should do this by extending auto-fill instead, making it > seamless, so that the buffer has real text with real newlines. That is ok for editing, but for reading (e.g. this mail), virtual word wrapping would be much simpler -- and problem-less. -- Kim F. Storm http://www.cua.dk