From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Display-based word wrapping Date: Sun, 22 Jun 2008 15:54:06 -0400 Message-ID: <87y74x9rfl.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1214164744 5206 80.91.229.12 (22 Jun 2008 19:59:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Jun 2008 19:59:04 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 22 21:59:48 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 1KAVj1-0003dC-Vr for ged-emacs-devel@m.gmane.org; Sun, 22 Jun 2008 21:59:48 +0200 Original-Received: from localhost ([127.0.0.1]:47199 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAViC-0007Nf-So for ged-emacs-devel@m.gmane.org; Sun, 22 Jun 2008 15:58:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KAVi8-0007M7-H2 for emacs-devel@gnu.org; Sun, 22 Jun 2008 15:58:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KAVi6-0007Kn-Sb for emacs-devel@gnu.org; Sun, 22 Jun 2008 15:58:52 -0400 Original-Received: from [199.232.76.173] (port=48810 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAVi6-0007KX-NF for emacs-devel@gnu.org; Sun, 22 Jun 2008 15:58:50 -0400 Original-Received: from cyd.mit.edu ([18.115.2.24]:36587) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KAVi6-0008Tg-ES for emacs-devel@gnu.org; Sun, 22 Jun 2008 15:58:50 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 459894E490; Sun, 22 Jun 2008 15:54:06 -0400 (EDT) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:99707 Archived-At: I have been studying Kim Storm's display-based word wrapping code. I believe it's pretty safe, and suitable for inclusion into the Emacs 23 release (probably turned off by default). The original patch included a `wrap-column' variable, but I'd like to modify this to use `truncate-lines' instead, as shown below. This would mean that word wrap always uses the right window edge as a wrap column. Any objections? truncate-lines is a variable defined in `C source code'. Documentation: Whether lines longer than the window width are truncated. If the value is nil or `word-wrap', long lines are displayed using continuation lines. If nil, the wrapping occurs at the right window edge. If `word-wrap', it occurs at the rightmost space or tab character, if possible. Any other non-nil value means to give each line of text just one screen line, truncating long lines at the right window edge. Note that this is overridden by the variable `truncate-partial-width-windows' if that variable is non-nil and this buffer is not full-frame width.