From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Display-based word wrapping Date: Sun, 22 Jun 2008 22:12:42 +0200 Message-ID: <858wwx5iv9.fsf@lola.goethe.zz> References: <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 1214165584 8534 80.91.229.12 (22 Jun 2008 20:13:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Jun 2008 20:13:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 22 22:13: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 1KAVwW-0007Bu-RN for ged-emacs-devel@m.gmane.org; Sun, 22 Jun 2008 22:13:45 +0200 Original-Received: from localhost ([127.0.0.1]:37823 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAVvh-0005X9-J2 for ged-emacs-devel@m.gmane.org; Sun, 22 Jun 2008 16:12:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KAVvc-0005W9-J9 for emacs-devel@gnu.org; Sun, 22 Jun 2008 16:12:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KAVva-0005Vv-KD for emacs-devel@gnu.org; Sun, 22 Jun 2008 16:12:47 -0400 Original-Received: from [199.232.76.173] (port=51764 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAVva-0005Vs-EY for emacs-devel@gnu.org; Sun, 22 Jun 2008 16:12:46 -0400 Original-Received: from mail-in-11.arcor-online.net ([151.189.21.51]:34656) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KAVvZ-0005ZJ-T9 for emacs-devel@gnu.org; Sun, 22 Jun 2008 16:12:46 -0400 Original-Received: from mail-in-07-z2.arcor-online.net (mail-in-07-z2.arcor-online.net [151.189.8.19]) by mail-in-11.arcor-online.net (Postfix) with ESMTP id 54DAB13312; Sun, 22 Jun 2008 22:12:44 +0200 (CEST) Original-Received: from mail-in-11.arcor-online.net (mail-in-11.arcor-online.net [151.189.21.51]) by mail-in-07-z2.arcor-online.net (Postfix) with ESMTP id 420542C6D49; Sun, 22 Jun 2008 22:12:44 +0200 (CEST) Original-Received: from lola.goethe.zz (dslb-084-061-005-023.pools.arcor-ip.net [84.61.5.23]) by mail-in-11.arcor-online.net (Postfix) with ESMTP id BAA7F13312; Sun, 22 Jun 2008 22:12:43 +0200 (CEST) Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id B59C51C2D55B; Sun, 22 Jun 2008 22:12:42 +0200 (CEST) In-Reply-To: <87y74x9rfl.fsf@stupidchicken.com> (Chong Yidong's message of "Sun, 22 Jun 2008 15:54:06 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-Virus-Scanned: ClamAV 0.93/7407/Mon Jun 9 04:21:00 2008 on mail-in-11.arcor-online.net X-Virus-Status: Clean X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:99710 Archived-At: Chong Yidong writes: > 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. How about not using word-wrap, but rather integers? A positive integer indicates the column before the wrap should occur, with negative integers counting from the right margin? That makes it possible to specify a fixed wrap position if really wanted. Also the truncate-partial-window-width override should have the same meaning and take precedence if non-nil. I am not sure this flexibility is needed, though. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum