unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Display-based word wrapping
@ 2008-06-22 19:54 Chong Yidong
  2008-06-22 20:04 ` Lennart Borgman (gmail)
                   ` (2 more replies)
  0 siblings, 3 replies; 35+ messages in thread
From: Chong Yidong @ 2008-06-22 19:54 UTC (permalink / raw)
  To: emacs-devel

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.




^ permalink raw reply	[flat|nested] 35+ messages in thread
* Display-based word wrapping
@ 2008-06-24 18:06 Chong Yidong
  2008-06-24 18:52 ` Stefan Monnier
  0 siblings, 1 reply; 35+ messages in thread
From: Chong Yidong @ 2008-06-24 18:06 UTC (permalink / raw)
  To: emacs-devel

I've checked in Kim F. Storm's display-based word-wrapping patch, with
some modifications.  The word-wrapping is controlled by the `word-wrap'
per-buffer variable.  It is a form of continuation line, so e.g. will
not be performed if lines are truncated rather than continued.

The default is nil.  More work will have to be done to make this really
useful for editing documents with long lines: (i) the minor mode for
screen-based editing commands being discussed in another thread, (ii) a
way to change the continuation/wrapping/truncation margin, and (iii) a
way to customize the fringe indicators to avoid displaying tons of
continuation line indicators.

I have also changed truncate-partial-width-windows to accept integer
values specifying a window width below which to truncate lines, and
changed the default to 30.

I believe the patch should not affect the default behavior where
word-wrap is nil, but please be on the lookout.  Problem reports are
welcome.




^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2008-06-25 18:58 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-22 19:54 Display-based word wrapping Chong Yidong
2008-06-22 20:04 ` Lennart Borgman (gmail)
2008-06-22 20:33   ` Chong Yidong
2008-06-22 20:54     ` Lennart Borgman (gmail)
2008-06-22 22:08     ` David Reitter
2008-06-22 22:24       ` Chong Yidong
2008-06-22 23:45         ` David Reitter
2008-06-23  0:32     ` Miles Bader
2008-06-22 20:12 ` David Kastrup
2008-06-22 22:02   ` Stefan Monnier
2008-06-22 23:40     ` Chong Yidong
2008-06-23  1:23       ` Stefan Monnier
2008-06-23  2:04         ` Chong Yidong
2008-06-23 16:42           ` Chong Yidong
2008-06-23 18:29           ` Stefan Monnier
2008-06-22 23:38   ` Chong Yidong
2008-06-23  0:25     ` Miles Bader
2008-06-23  0:22 ` Miles Bader
2008-06-23  1:27   ` Stefan Monnier
2008-06-23  1:51     ` Miles Bader
2008-06-23  2:03       ` Stefan Monnier
2008-06-23  2:40         ` Miles Bader
2008-06-23 18:24           ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2008-06-24 18:06 Chong Yidong
2008-06-24 18:52 ` Stefan Monnier
2008-06-24 19:54   ` Chong Yidong
2008-06-24 20:23     ` Stefan Monnier
2008-06-24 21:52       ` Chong Yidong
2008-06-25  1:41         ` Stefan Monnier
2008-06-25  1:46           ` Miles Bader
2008-06-25  3:45             ` Stefan Monnier
2008-06-25  2:04           ` Chong Yidong
2008-06-25  3:48             ` Stefan Monnier
2008-06-25 18:14               ` Chong Yidong
2008-06-25 18:58                 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).