unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Line-wrapping of 80 character long lines
@ 2002-12-02 15:32 Henrik Holm
  2002-12-02 16:50 ` Kai Großjohann
  0 siblings, 1 reply; 15+ messages in thread
From: Henrik Holm @ 2002-12-02 15:32 UTC (permalink / raw)


I am not completely certain whether the emacs-devel mailing list  is 
the right forum -- I *think* this is a feature request (in which case, 
I have found the right forum) but it might be that it is a support 
question (in which case, hopefully someone will point me in the 
direction of gnu.emacs.help).  I have looked through the '(emacs) 
Continuation Lines' and '(emacs) Display Custom' info pages, without 
finding the answer, though.

I really like the feature of Emacs 21 and higher, that the fringes are 
used instead of the \ character to indicate when a line has been 
wrapped.

However, there is one part of this behavior that I find a bit 
misleading:  If a line is exactly 80 characters, it gets "wrapped" -- 
even if it is not needed. (This applies of course when my Emacs window 
is 80 characters.  If the Emacs window is narrrower, for instance 20 
cols as in the example below, the behavior will be similar.)

Consider, for instance, the following lines:

;;
12345678901234567890
;;

In an 20 column wide Emacs 21 buffer, it will look like this:

/----------------------\
| ;;                   |
| 12345678901234567890%|
|%                     |
| ;;                   |
\----------------------/

(In the figure above, I've used '%' for the fringe characters)
Granted, the fringe characters do indicate that the third line is in 
fact the continuation of line 2.  But this isn't readily apparent from 
a glance.  Moreover, as long as I'm not using show-trailing-whitespace, 
the above behavior leads me to think that there are trailing whitespace 
on that line.  What I would like to see is

/----------------------\
| ;;                   |
| 12345678901234567890 |
| ;;                   |
\----------------------/

and, for the case with a 21 character long line in a 20 column window,

/----------------------\
| ;;                   |
| 12345678901234567890%|
|%1                    |
| ;;                   |
\----------------------/

I can see reasons for having it the way it currently is, though, it is 
now somewhat reminiscent of the way it works in earlier versions of 
Emacs.  It is not exactly the same, because in earlier versions the 
line would be continued after the 79th character in order to make room 
for the '\'.  I therefore think there are good reasons for not 
"wrapping" lines of the same length as the number of columns in the 
current window.  Of course, the behavior could be customizable in order 
to please the traditionalists :-)


Henrik.

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

* Re: Line-wrapping of 80 character long lines
  2002-12-02 15:32 Line-wrapping of 80 character long lines Henrik Holm
@ 2002-12-02 16:50 ` Kai Großjohann
  2002-12-02 21:23   ` Kim F. Storm
  2002-12-02 23:48   ` Henrik Holm
  0 siblings, 2 replies; 15+ messages in thread
From: Kai Großjohann @ 2002-12-02 16:50 UTC (permalink / raw)


Henrik Holm <list@henrikholm.com> writes:

> I really like the feature of Emacs 21 and higher, that the fringes are
> used instead of the \ character to indicate when a line has been
> wrapped.
>
> However, there is one part of this behavior that I find a bit
> misleading:  If a line is exactly 80 characters, it gets "wrapped"
> -- even if it is not needed. (This applies of course when my Emacs
> window is 80 characters.  If the Emacs window is narrrower, for
> instance 20 cols as in the example below, the behavior will be
> similar.)

The problem is where to put the cursor.  When point is at the end of
the line, where do you display the cursor?

One solution is to be able to display the cursor in the right
fringe.  Another possibility might be to display the cursor as a
narrow vertical bar to the right of the last character.

-- 
~/.signature is: umop ap!sdn    (Frank Nobis)

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

* Re: Line-wrapping of 80 character long lines
  2002-12-02 16:50 ` Kai Großjohann
@ 2002-12-02 21:23   ` Kim F. Storm
  2004-01-16 23:30     ` Kim F. Storm
  2002-12-02 23:48   ` Henrik Holm
  1 sibling, 1 reply; 15+ messages in thread
From: Kim F. Storm @ 2002-12-02 21:23 UTC (permalink / raw)
  Cc: emacs-devel

kai.grossjohann@uni-duisburg.de (Kai Großjohann) writes:

> Henrik Holm <list@henrikholm.com> writes:
> 
> > I really like the feature of Emacs 21 and higher, that the fringes are
> > used instead of the \ character to indicate when a line has been
> > wrapped.
> >
> > However, there is one part of this behavior that I find a bit
> > misleading:  If a line is exactly 80 characters, it gets "wrapped"
> > -- even if it is not needed. (This applies of course when my Emacs
> > window is 80 characters.  If the Emacs window is narrrower, for
> > instance 20 cols as in the example below, the behavior will be
> > similar.)
> 
> The problem is where to put the cursor.  When point is at the end of
> the line, where do you display the cursor?
> 
> One solution is to be able to display the cursor in the right
> fringe.  Another possibility might be to display the cursor as a
> narrow vertical bar to the right of the last character.

Also, there's no guarantee that there is a right fringe, or whether it
has sufficient width to show a cursor.  But for most uses, I think it
makes good sense to display the cursor in the fringe.


-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: Line-wrapping of 80 character long lines
  2002-12-02 16:50 ` Kai Großjohann
  2002-12-02 21:23   ` Kim F. Storm
@ 2002-12-02 23:48   ` Henrik Holm
  1 sibling, 0 replies; 15+ messages in thread
From: Henrik Holm @ 2002-12-02 23:48 UTC (permalink / raw)


Kai Großjohann writes:

> Henrik Holm <list@henrikholm.com> writes:
> 
> > However, there is one part of this behavior that I find a bit
> > misleading:  
> > If a line is exactly 80 characters, it gets "wrapped"
> > -- even if it is not needed.
> 
> The problem is where to put the cursor.  When point is at the end of
> the line, where do you display the cursor?

Ah, I see.   Didn't think of that.

> One solution is to be able to display the cursor in the right
> fringe.  Another possibility might be to display the cursor as a
> narrow vertical bar to the right of the last character.

Any one of these would work... although, personally, I'd be leaning
towards the 'vertical bar'-solution.  Is it possible to have the cursor
as a vertical bar in this particular case and as a box anywhere else?

Henrik

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

* Re: Line-wrapping of 80 character long lines
  2002-12-02 21:23   ` Kim F. Storm
@ 2004-01-16 23:30     ` Kim F. Storm
  2004-01-19 18:14       ` Stefan Monnier
  2004-01-19 18:30       ` Glenn Morris
  0 siblings, 2 replies; 15+ messages in thread
From: Kim F. Storm @ 2004-01-16 23:30 UTC (permalink / raw)
  Cc: Henrik Holm, emacs-devel

storm@cua.dk (Kim F. Storm) writes:

> kai.grossjohann@uni-duisburg.de (Kai Großjohann) writes:
> 
> > Henrik Holm <list@henrikholm.com> writes:
> > 
> > > I really like the feature of Emacs 21 and higher, that the fringes are
> > > used instead of the \ character to indicate when a line has been
> > > wrapped.
> > >
> > > However, there is one part of this behavior that I find a bit
> > > misleading:  If a line is exactly 80 characters, it gets "wrapped"
> > > -- even if it is not needed. (This applies of course when my Emacs
> > > window is 80 characters.  If the Emacs window is narrrower, for
> > > instance 20 cols as in the example below, the behavior will be
> > > similar.)
> > 
> > The problem is where to put the cursor.  When point is at the end of
> > the line, where do you display the cursor?
> > 
> > One solution is to be able to display the cursor in the right
> > fringe.  Another possibility might be to display the cursor as a
> > narrow vertical bar to the right of the last character.

I just installed patches to CVS emacs to let an "exact width" line
flow into the right fringe, and put the cursor there when point is
at the end of such a line.

> Also, there's no guarantee that there is a right fringe, or whether it
> has sufficient width to show a cursor.  But for most uses, I think it
> makes good sense to display the cursor in the fringe.

It works only if there is a non-zero width fringe on the right.  Otherwise
it reverts to breaking the line as it used to.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: Line-wrapping of 80 character long lines
  2004-01-16 23:30     ` Kim F. Storm
@ 2004-01-19 18:14       ` Stefan Monnier
  2004-01-20  1:06         ` Kim F. Storm
  2004-01-19 18:30       ` Glenn Morris
  1 sibling, 1 reply; 15+ messages in thread
From: Stefan Monnier @ 2004-01-19 18:14 UTC (permalink / raw)
  Cc: Henrik Holm, Kai Großjohann, emacs-devel

> I just installed patches to CVS emacs to let an "exact width" line
> flow into the right fringe, and put the cursor there when point is
> at the end of such a line.

Cool!


        Stefan


PS: The cursor-in-the-fringe is wider by 1 pixel on my Emacs (with 13x6
    misc-fixed font and no customization).  It's not like it bothers me, but
    was surprised: is it normal?

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

* Re: Line-wrapping of 80 character long lines
  2004-01-16 23:30     ` Kim F. Storm
  2004-01-19 18:14       ` Stefan Monnier
@ 2004-01-19 18:30       ` Glenn Morris
  2004-01-20  1:13         ` Kim F. Storm
                           ` (2 more replies)
  1 sibling, 3 replies; 15+ messages in thread
From: Glenn Morris @ 2004-01-19 18:30 UTC (permalink / raw)
  Cc: emacs-devel

Kim F. Storm wrote:

> I just installed patches to CVS emacs to let an "exact width" line
> flow into the right fringe, and put the cursor there when point is
> at the end of such a line.

This is really nice. Two comments:

i)  It doesn't work for the last line in a buffer, if there is no
final newline. It seems a bit weird that adding a character to a line
(ie a newline) can make it look shorter in the Emacs display.

ii) Any chance the cursor could retain the cursor face when it moves
into the fringe, rather than switching to the fringe face?

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

* Re: Line-wrapping of 80 character long lines
  2004-01-19 18:14       ` Stefan Monnier
@ 2004-01-20  1:06         ` Kim F. Storm
  2004-01-20 15:38           ` Stefan Monnier
  0 siblings, 1 reply; 15+ messages in thread
From: Kim F. Storm @ 2004-01-20  1:06 UTC (permalink / raw)
  Cc: Henrik Holm, Kai Großjohann, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> > I just installed patches to CVS emacs to let an "exact width" line
> > flow into the right fringe, and put the cursor there when point is
> > at the end of such a line.
> 
> Cool!
> 
> 
>         Stefan
> 
> 
> PS: The cursor-in-the-fringe is wider by 1 pixel on my Emacs (with 13x6
>     misc-fixed font and no customization).  It's not like it bothers me, but
>     was surprised: is it normal?

The cursor is shown in the fringe using a fixed size bitmap -- which
is 7 pixels wide.

I have considered various ways to improve this, but don't expect it to
happen "soon".

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: Line-wrapping of 80 character long lines
  2004-01-19 18:30       ` Glenn Morris
@ 2004-01-20  1:13         ` Kim F. Storm
  2004-01-20  9:10         ` Harald Maier
  2004-02-17 10:25         ` Kim F. Storm
  2 siblings, 0 replies; 15+ messages in thread
From: Kim F. Storm @ 2004-01-20  1:13 UTC (permalink / raw)
  Cc: emacs-devel

Glenn Morris <gmorris+emacs@ast.cam.ac.uk> writes:

> Kim F. Storm wrote:
> 
> > I just installed patches to CVS emacs to let an "exact width" line
> > flow into the right fringe, and put the cursor there when point is
> > at the end of such a line.
> 
> This is really nice. Two comments:
> 
> i)  It doesn't work for the last line in a buffer, if there is no
> final newline. It seems a bit weird that adding a character to a line
> (ie a newline) can make it look shorter in the Emacs display.

I'll have to look into that.

> 
> ii) Any chance the cursor could retain the cursor face when it moves
> into the fringe, rather than switching to the fringe face?

Fixing this is on my to-do list.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: Line-wrapping of 80 character long lines
  2004-01-19 18:30       ` Glenn Morris
  2004-01-20  1:13         ` Kim F. Storm
@ 2004-01-20  9:10         ` Harald Maier
  2004-01-20 12:46           ` Kim F. Storm
  2004-02-17 10:26           ` Kim F. Storm
  2004-02-17 10:25         ` Kim F. Storm
  2 siblings, 2 replies; 15+ messages in thread
From: Harald Maier @ 2004-01-20  9:10 UTC (permalink / raw)
  Cc: emacs-devel

Glenn Morris <gmorris+emacs@ast.cam.ac.uk> writes:

> Kim F. Storm wrote:
>
>> I just installed patches to CVS emacs to let an "exact width" line
>> flow into the right fringe, and put the cursor there when point is
>> at the end of such a line.
>
> This is really nice. Two comments:

I agree completely.

>
> i)  It doesn't work for the last line in a buffer, if there is no
> final newline. It seems a bit weird that adding a character to a line
> (ie a newline) can make it look shorter in the Emacs display.

Also the end boundary disappears in this case if boundaries are
enabled with:

  (setq default-indicate-buffer-boundaries t)

Harald

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

* Re: Line-wrapping of 80 character long lines
  2004-01-20  9:10         ` Harald Maier
@ 2004-01-20 12:46           ` Kim F. Storm
  2004-02-17 10:26           ` Kim F. Storm
  1 sibling, 0 replies; 15+ messages in thread
From: Kim F. Storm @ 2004-01-20 12:46 UTC (permalink / raw)
  Cc: emacs-devel

Harald Maier <harald@maierh.de> writes:

> > i)  It doesn't work for the last line in a buffer, if there is no
> > final newline. It seems a bit weird that adding a character to a line
> > (ie a newline) can make it look shorter in the Emacs display.
> 
> Also the end boundary disappears in this case if boundaries are
> enabled with:
> 
>   (setq default-indicate-buffer-boundaries t)
> 

I know that, but this is somewhat tricky to fix.  

In any case, if you use the blinking cursor, the end boundary icon
only disappears some of the time :-)

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: Line-wrapping of 80 character long lines
  2004-01-20  1:06         ` Kim F. Storm
@ 2004-01-20 15:38           ` Stefan Monnier
  0 siblings, 0 replies; 15+ messages in thread
From: Stefan Monnier @ 2004-01-20 15:38 UTC (permalink / raw)
  Cc: Henrik Holm, Kai Großjohann, emacs-devel

> The cursor is shown in the fringe using a fixed size bitmap -- which
> is 7 pixels wide.

Oh, so it's normal.

> I have considered various ways to improve this, but don't expect it to
> happen "soon".

Feel free to push it way down the todo list.


        Stefan

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

* Re: Line-wrapping of 80 character long lines
  2004-01-19 18:30       ` Glenn Morris
  2004-01-20  1:13         ` Kim F. Storm
  2004-01-20  9:10         ` Harald Maier
@ 2004-02-17 10:25         ` Kim F. Storm
  2004-02-17 22:57           ` Glenn Morris
  2 siblings, 1 reply; 15+ messages in thread
From: Kim F. Storm @ 2004-02-17 10:25 UTC (permalink / raw)
  Cc: emacs-devel

Glenn Morris <gmorris+emacs@ast.cam.ac.uk> writes:

> > I just installed patches to CVS emacs to let an "exact width" line
> > flow into the right fringe, and put the cursor there when point is
> > at the end of such a line.
> 
> This is really nice. Two comments:
> 
> i)  It doesn't work for the last line in a buffer, if there is no
> final newline. It seems a bit weird that adding a character to a line
> (ie a newline) can make it look shorter in the Emacs display.
> 
> ii) Any chance the cursor could retain the cursor face when it moves
> into the fringe, rather than switching to the fringe face?

Both of these problems should be fixed now.  Please verify, thanks.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: Line-wrapping of 80 character long lines
  2004-01-20  9:10         ` Harald Maier
  2004-01-20 12:46           ` Kim F. Storm
@ 2004-02-17 10:26           ` Kim F. Storm
  1 sibling, 0 replies; 15+ messages in thread
From: Kim F. Storm @ 2004-02-17 10:26 UTC (permalink / raw)
  Cc: emacs-devel

Harald Maier <harald@maierh.de> writes:

> > i)  It doesn't work for the last line in a buffer, if there is no
> > final newline. It seems a bit weird that adding a character to a line
> > (ie a newline) can make it look shorter in the Emacs display.
> 
> Also the end boundary disappears in this case if boundaries are
> enabled with:
> 
>   (setq default-indicate-buffer-boundaries t)

Should be fixed now.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: Line-wrapping of 80 character long lines
  2004-02-17 10:25         ` Kim F. Storm
@ 2004-02-17 22:57           ` Glenn Morris
  0 siblings, 0 replies; 15+ messages in thread
From: Glenn Morris @ 2004-02-17 22:57 UTC (permalink / raw)
  Cc: emacs-devel

Kim F. Storm wrote:

> Glenn Morris <gmorris+emacs@ast.cam.ac.uk> writes:
>
>> i)  It doesn't work for the last line in a buffer, if there is no
>> final newline.
[...]
>> ii) Any chance the cursor could retain the cursor face when it moves
>> into the fringe...
>
> Both of these problems should be fixed now.  Please verify, thanks.

Yes indeed. Thank you!

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

end of thread, other threads:[~2004-02-17 22:57 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-02 15:32 Line-wrapping of 80 character long lines Henrik Holm
2002-12-02 16:50 ` Kai Großjohann
2002-12-02 21:23   ` Kim F. Storm
2004-01-16 23:30     ` Kim F. Storm
2004-01-19 18:14       ` Stefan Monnier
2004-01-20  1:06         ` Kim F. Storm
2004-01-20 15:38           ` Stefan Monnier
2004-01-19 18:30       ` Glenn Morris
2004-01-20  1:13         ` Kim F. Storm
2004-01-20  9:10         ` Harald Maier
2004-01-20 12:46           ` Kim F. Storm
2004-02-17 10:26           ` Kim F. Storm
2004-02-17 10:25         ` Kim F. Storm
2004-02-17 22:57           ` Glenn Morris
2002-12-02 23:48   ` Henrik Holm

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).