Bug 31951 - line length in Kmail does not scale with window size
Summary: line length in Kmail does not scale with window size
Status: RESOLVED WORKSFORME
Alias: None
Product: kmail
Classification: Applications
Component: composer (show other bugs)
Version: unspecified
Platform: RedHat Enterprise Linux Linux
: NOR wishlist with 476 votes (vote)
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 34083 77671 93622 134017 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-09-01 16:18 UTC by Jens
Modified: 2012-12-13 09:20 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Soft word wrap in kmail composer (707 bytes, patch)
2007-03-28 15:05 UTC, Andreas Fackler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sjarrettspraggue 2001-09-01 16:03:42 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           kmail
Version:           KDE 2.2.0 
Severity:          wishlist
Installed from:    RedHat RPMs
Compiler:          Not Specified
OS:                Linux
OS/Compiler notes: Not Specified

Mozilla's composer does not impose a fixed line length for the text that is being typed in. Thus the text line lengths depend on the size of the window of Moziilla This is how Outlook does things. Kmail's way of specifying a line length 
is not elegant if the window is either too small or takes up the whole screen.

(Submitted via bugs.kde.org)
Comment 1 Lauren Wolcott 2003-02-13 04:18:30 UTC
Yes, this is an important improvement.  I was in process of changing to a different e-mail program because of it until I discovered that I could 
turn word-wrap on and off, AND that with the other programs it was hard to look at old mail that I had saved off to an archive disk.  Even this 
window doesn't wrap at the edge (using Konqueror), a real nuisance.
Lauren
Comment 2 Jens 2004-03-24 10:13:19 UTC
This is related to Bug 41926 and Bug 77671.
Comment 3 Stephan Kulow 2004-05-19 10:42:07 UTC
Replaced sjarrettspraggue@waitrose.com with jens-bugs.kde.org@spamfreemail.de due to bounces by reporter
Comment 4 Tom Albers 2004-08-04 21:22:12 UTC
*** Bug 77671 has been marked as a duplicate of this bug. ***
Comment 5 Tom Albers 2004-08-04 21:27:36 UTC
*** Bug 34083 has been marked as a duplicate of this bug. ***
Comment 6 chemist109 2004-12-31 14:59:14 UTC
*** This bug has been confirmed by popular vote. ***
Comment 7 Ralph Clark 2005-10-30 00:20:48 UTC
It is now 2005.... 4 years after the bug first went in. It is still there.

1. Why is the word wrap limited to column 78? I have about 170 columns of width on my screen! Why can't this limit be increased?

2. Please can you implement an "auto-wrap" feature for BOTH composer and message reader windows that wraps the text automatically to fit the width of the open windows?
I think this is quite an important usability feature, and kmail would really benefit from this problem being fixed. Please note I'm using KDE 3.4.1.

Thanks.

Comment 8 Jens 2005-10-30 09:37:51 UTC
I think this is related to supporting the "delsp=yes, format=flowed" RFC extensions mentioned in the other bugs. The point is that you need to wrap text when transferring it over the net because the RFC requires it. Support for the above mentioned RFC would solve this problem.
Comment 9 Morris Cornell-Morgan 2005-11-08 14:13:14 UTC
There are detailed descriptions of what is desperately needed at http://www.kde-forum.org/artikel/13356/Kmail-word-wrap.html .  It seems like a tiny feature, but it's incredibly important for making Kmail a truly professional e-mail client.
Comment 10 Peer Frank 2006-01-24 23:38:28 UTC
dynamic word wrap is badly missing...
Comment 11 Christian González 2006-01-24 23:56:54 UTC
And, as another workaround (or solution?): when using an "external editor" - as suggested: kate; why not use the embedded kate-kpart in kmail (like e.g. kdevelop)?

Is that possible?
Comment 12 Paul Fee 2006-04-19 12:20:14 UTC
Having moved from Mozilla Thunderbird to Kontact/KMail, this bug is the first issue I've found which is preventing me from recommending KMail to my colleagues.

Can anyone provide a status update to this bug?  Is it being addressed?  Can I look forward to a fix?  Can I help?

I'm currently using:
KDE 3.5.2, Kontact 1.2, KMail 1.9.1
Comment 13 Ralph Clark 2006-04-19 20:10:52 UTC
Just thought I'd raise my head to show that I'm still watching this bug. It has to be one of the oldest out there.

Any plans to fix it?
Comment 14 arutha 2006-04-20 15:17:51 UTC
This bug should be closed asap. And I mean just closed, without "fixing" what ain't broken. I actually complained to the mozilla people once to enable word wrapping like it is done in KMail for thunderbird.

I agree with you, that KMail should be able to switch its behaviour for all you people that want it the other (wrong) way, but I really like it as it is. What you get with wrapping at the window is easily seen when replying from thunderbird (or outlook), you get "stairs" in quoted text. Have you ever tried to remove half a line of quoted text (rest of a sentence) in thunderbird and realign the rest of the paragraph because you want to quote it? Much easier to do correctly in KMail. Of course, if you are not quoting correctly KMail's behaviour may seem abnormal.
Comment 15 Andreas Fackler 2006-04-20 16:06:17 UTC
There's only one little change that would have to be made: If you write a message with word wrap disabled the composer should display it with dynamic word wrap just like KEdit and KWrite do.
The way these messages are displayed in current KMail versions renders the no-word-wrap mode completely useless.
Comment 16 Jens 2006-04-20 16:26:32 UTC
I completely agree with Comment 15. This would at least be a first start at implementing Wish / Bug 92591 (which has been duplicated a dozen times, so there *is* a need to fix this).

However, I don't know whether this works when quoted-printable encoding is turned off (can you turn it off at all?), since then text lines in the mail could get longer than 80 characters, which is forbidden in RFC822 (IIRC).

The real solution, as before, is to implement Bug 92591 and its numerous duplicates. I'm perfectly willing to help here by writing appropriate pseudocode, I just don't know the C++ and KDE APIs well enough to write real code =)

Jens
Comment 17 Paul Fee 2006-04-21 15:20:58 UTC
Hello all,

Good to see renewed interest in this bug.  There are various aspects to Kmail's email wrapping, fortunately most are fine for me.

1: Email's content over the wire [OK]
This is affected by your choice of the word wrap setting in the composer options.  Not using the word wrap option gives best results as it allows long lines (e.g. URLs) and it avoids the "stairs" in comment 14.

2: Viewing received email [OK]
This is not configurable.  The email wraps as required to fit in the window.  Horizontal scroll bars do not appear.

3: View in the email composition window [Problem]
We may want to turn off word-wrap (i.e. static word wrap) which would insert unwanted newlines into the transmitted email.  However with word wrap disabled, we then have to suffer with horizontal scroll bars.

The email composition window needs changes to allow the text to wrap on the screen, preventing horizontal scrolling.  However this on screen wrapping (dynamic wrapping) must not affect the contents of the email being transmitted.

Without looking at the code, nor being familiar with KDE APIs, would it be the case that the email composition window has a set of properties.  Perhaps one of them's a flag controlling whether or not the window can scroll horizontally.

Could it be the case that disabling horizontal scrolling in the email composition window would be enough fix this bug?
Comment 18 Jens 2006-04-21 15:33:49 UTC
Hi,

a possible solution (if my C++ parsing skills are correct):

in http://websvn.kde.org/trunk/KDE/kdepim/kmail/kmcomposewin.cpp?rev=532058&view=auto the widget "KMEdit" seems to inherit from "KEdit", and this code is used:

  if (GlobalSettings::self()->wordWrap())
  {
    mEditor->setWordWrap( Q3MultiLineEdit::FixedColumnWidth );
    mEditor->setWrapColumnOrWidth( GlobalSettings::self()->lineWrapWidth() );
  }
  else
  {
    mEditor->setWordWrap( Q3MultiLineEdit::NoWrap );
  }

In http://websvn.kde.org/trunk/KDE/kdeutils/kedit/kedit.cpp?rev=530649&view=auto the KEdit widget (I assume it's the same) is set to "soft word-wrap" by using 

  eframe = new KEdit (this);
  // ...
  if( Prefs::wrapMode() == Prefs::EnumWrapMode::FixedColumnWrap )
  {
    eframe->setWordWrap(Q3MultiLineEdit::FixedColumnWidth);
    eframe->setWrapColumnOrWidth(Prefs::wrapColumn());
  }
  else if( Prefs::wrapMode() == Prefs::EnumWrapMode::SoftWrap )
  {
    eframe->setWordWrap(Q3MultiLineEdit::WidgetWidth);
  }
  else
  {
    eframe->setWordWrap(Q3MultiLineEdit::NoWrap);
  }

Maybe this can be used in KMedit as well, since KMedit is inherited from KEdit? Just exchange the "NoWrap" in kmcompose.cpp to "WidgetWidth", change nothing else.

Can somebody who has a running development system try this out?

Thanks!

Jens
Comment 19 Alberto Gonzalez 2006-10-31 00:45:57 UTC
I agree with everyone. It's very annoying to see the horizontal scrollbars when disabling word wrap.

Thanks in advance.
Comment 20 TiLK 2007-03-15 20:46:45 UTC
Im also missing this feature. After I red this it seems to me that the development team should have some specific reason to keek this bug as it is.
Comment 21 Bram Schoenmakers 2007-03-15 21:55:51 UTC
The reason is pretty simple: it's open source.
Comment 22 Bram Schoenmakers 2007-03-25 23:28:21 UTC
*** Bug 93622 has been marked as a duplicate of this bug. ***
Comment 23 Bram Schoenmakers 2007-03-25 23:33:13 UTC
*** Bug 134017 has been marked as a duplicate of this bug. ***
Comment 24 Andreas Fackler 2007-03-28 15:05:00 UTC
Created attachment 20111 [details]
Soft word wrap in kmail composer

I tried out Jens B. Beneckes suggestion with KMail 1.9.6 (KDE 3.5.6) and it
works for me, but I had to make the function doSend() revert back to NoWrap to
prevent it from sending or saving the "soft" word wraps.
Comment 25 Thomas McGuire 2007-03-31 21:59:32 UTC
Andreas, the KMail developers do not monitor this bug system very closly. Please contact them at the #kontact IRC channel or at the kde-pim mailinglist to get your patch reviewed and commited. Thanks.
Comment 26 Jens 2007-08-01 13:32:03 UTC
Hey,

is anything being done about the word-wrap problem in KMail? AFAIunderstand, it is a matter of changing just two lines of code: just change the KMEdit widget instance's word-wrap to "soft-wrap", and possibly enforce the use of quoted-printable encoding to ensure the text is wrapped for over-the-wire transfer.

The "real" solution would be to implement "format=flowed", which is a little harder to do, but this solution would make most people a lot happier and does not affect any other part of KMail.

Thanks!

Jens
Comment 27 Lothar Krause 2007-08-04 13:59:03 UTC
Is there something wrong with the patch? I too want to have dynamic word wrap. 
Comment 28 Carl 2007-10-09 11:32:15 UTC
Another vote from me to solve this asap. The standards are in place, so there is no reason not to do it.

I love Kontact, but had to go back to Thunderbird for my work. Sending out emails with 78 characters per line is really unprofessional, and editing unwrapped lines is simply unpractical.
Comment 29 Pupeno 2007-11-25 21:48:41 UTC
Another 20 votes for dynamic word wrap, bring KMail into the 21st century!
Comment 30 Stefan Kombrink 2008-04-18 22:08:42 UTC
i am not sure but i tried the latest kmail (kde 3.5.9) and the problem here described does not exist.
just reopen, if i should be wrong!
Comment 31 Léonard G 2008-04-19 14:52:54 UTC
you are wrong, the bug still partially exists ( but now not with every messages )

When replying or inline forwarding a message, the quoted text gets wrapped, when some conditions i haven't really been able to highlight are met. It seems that usually it happens when the original message was an html one, and/or with some underlining or color, and/or when the message contains several replies.

When the warpping occurs, i have found a work around : i select the text of the message i want to reply/forward to, and click reply/forward. In this way everything works fine. But it's still a pain to have to do this, especially that Ctrl-a select the header that i don't want to quote.

Perhaps should i open a new bug ? since it seems it is a bug in the resolution of this bug ?
Comment 32 tlauniainen 2012-05-02 09:38:53 UTC
I am having this problem with kmail 4.8.2, Kubuntu 12.04.
Comment 33 Igor Larionovo 2012-11-29 23:48:31 UTC
kmail 4.8.5, kubuntu 12.04.1 LTS still a pain in the neck.
either disallow non wrapped composition
or please support dynamic wrapping it at window's width.
Comment 34 eleban 2012-12-13 09:20:26 UTC
Kmail 4.8.5,  kubuntu 12.04.1 LTS:
Another vote to push this issue to "solved". Dynamic wrap is the path to take. So obvious...