emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: display word wrapping


From: Kim F. Storm
Subject: Re: display word wrapping
Date: 28 May 2004 10:37:17 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Richard Stallman <address@hidden> 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 <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]