Open Bug 155219 Opened 22 years ago Updated 2 years ago

Word wrap preference ignored for conversion to plain text (attachments or HTML compose, text send)

Categories

(MailNews Core :: Composition, defect)

defect

Tracking

(Not tracked)

People

(Reporter: bryce2, Assigned: aceman)

References

Details

Attachments

(1 file)

The code exists to read the user's word wrap width preference:

       if (NS_SUCCEEDED(rv) && prefs) 
          prefs->GetIntPref("mailnews.wraplength", &width);
       // Let sanity reign!
       if (width < 10)
         width = 10;
       else if (width > 30000)
         width = 30000; 

But the calculated width is never passed anywhere.  In addition 30000 is a
very abitrary number, not supported by any of the RFC's relating to creating
plain text (text/plain) messages.

I have attached a patch that moves this code to a place where it can have
some effect, rationalizes the limits to match the RFC's, and allows
specification of 0.  All this works perfectly with our without format=flowed
text.  The existing issues with utf-8 are not affected.

Plese consider applying this patch.
Attachment #89804 - Attachment description: Respect user wrap preferences, allow no wrap. → Moz 1.1a patch - fix wrap prefs - allow 0.
*** Bug 155220 has been marked as a duplicate of this bug. ***
*** Bug 155221 has been marked as a duplicate of this bug. ***
Blocks: 123569
benb, could you review this please?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: patch, review
Not my area. But some obvious comments about the patch:
- Don't add |rv2|, reuse |rv|.
- Don't expose special-case values to the user. "Use 0 for no wrapping" is not
only bad programming, but completely escapes the ordinary user (probably
rightfully).
What would this do anyways? No wrapping? How would this work in the plaintext
and HTML composer? What, if the user writes lines longer than 1000 chars, but
has the pref to "no wrap"?
I started this patch with a desire to enable 'no wrapping'.  I traditioanlly
send plaintext messages as one line per paragraph, which works just fine.  The
recipient's client wraps the message to whatever their window width is, and the
replies don't have weird word wrapping.

One could argue that, with the advent of 'flowed' text, that this entire user
interface element could be removed.  But if it is there, it ought to work.  And
if  it is removed then 'flowed' should be enabled for as many encodings as possible.
The bug is complained by so many peoples form feedback channel.
It should be fixed ASAP.

take it.
Assignee: ducarroz → leon.zhang
I searched "wraplength" and other similar string in source codes,and 
feel very suprised that there is just one function(ProcessSignature) related to 
above searching result.

Have wrap plaintext feature disappeared?
Someone want to delete "wrap plain text " from prefrence.

current feedback from users said :
"If word-wrap is selected in preferences, word wrap does not work in Netscape 7
mail messenger.

Same results if option de-selected. This used to work in 6.2.2 but now 7.0 seems
to have broken it. Lines continue on with no wrap on compose mail and also on
some received emails, there is no reason I can see why some wrap and other do not."
Depends on: 160468
Severity: normal → major
Priority: -- → P2
newest trunk can do:  wrap word acorrding to the width of composer's window, and
cannot do wrap word according to the setting value from preference.

some versions netscape 7 can also do the latter.
In your account settings, you should deselect "compose messages in htnl format",
then you will find the function in preference can works.

so this bug is invalid.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
Product: MailNews → Core
> so this bug is invalid.

No, it is not since you can't send un-wrapped messages (even if they are plain text only AND encoded as plain text) if you for some reason don't like to disable the HTML composer in the account settings.

I don't know how to do this, but can someone pls. change the status of this bug to "unresolved", please?

David.P
Indeed.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Assignee: leon.zhang → nobody
Status: REOPENED → NEW
QA Contact: esther → composition
Product: Core → MailNews Core
Isn't this WFM? I just tried changing it to 100, worked just fine (and i do use plain text composition).
This bug has plenty of dupes... it might be "WFY", but it's not "WFM".
The confusion probably stems from the summary being flat-out untrue (whether or not it was true in 2002), and comment 0 not actually saying anything about what cases it wants to catch, or what steps to hit them. If you're composing plain text, then we set the wrap width on the editor, and that works, but whatever hits that "convert an attachment to text plain" case in the patch doesn't, and according to comment 12 HTML compose, plain text send doesn't.
Summary: Word wrap preference discarded always (Preferences->Mail->Composition->Wrap Plain Text Messages=XX) → Word wrap preference ignored, limited (Preferences->Mail->Composition->Wrap Plain Text Messages=XX)
As long as we're changing the summary, let's go all the way.

And those steps to reproduce, as many of the ways to hit it as you know, would also be a big help.
Summary: Word wrap preference ignored, limited (Preferences->Mail->Composition->Wrap Plain Text Messages=XX) → Word wrap preference ignored for conversion to plain text (attachments or HTML compose, text send)
STR:
1) Set prefs:  mailnews.send_plaintext_flowed = false
               mailnews.wraplength            = 0
2) Compose HTML message with a long line
3) Send (or Send Later, just examine the Outbox contents), being sure not to send "as HTML only"
4) View Source of sent message

Actual results:
Plain text version of message is wrapped at 72

Expected results:
Plain text version of message doesn't wrap until RFC-imposed limit (990?)


I don't know what is meant by "converting attachments to plain text" but generally I would expect any attachment to be sent losslessly -- altho, conversion to quoted-printable is fine in that case, so long as it can be saved to disk as it was originally sent (modulo line-endings for plain text).
There are several fetches of mailnews.wraplength today. These are the occurrences:
mailnews$ grep -i -r 'wraplength' *
base/util/nsMsgUtils.cpp:    pPrefBranch->GetIntPref("mailnews.wraplength", &wrapWidth);
compose/src/nsMsgCompose.cpp:nsresult nsMsgCompose::GetWrapLength(PRInt32 *aWrapLength)
compose/src/nsMsgCompose.cpp:  return prefBranch->GetIntPref("mailnews.wraplength", aWrapLength);
compose/src/nsMsgCompose.cpp:  PRInt32 wrapLength = 72; // setup default value in case GetWrapLength failed
compose/src/nsMsgCompose.cpp:  GetWrapLength(&wrapLength);
compose/src/nsMsgCompose.cpp:  GetWrapLength(&wrapping_enabled);
compose/src/nsMsgAttachmentHandler.cpp:      pPrefBranch->GetIntPref("mailnews.wraplength", &width);
mailnews.js:pref("mailnews.wraplength",                 72);

The problem is, there are different "sanity" ranges applied to this value (max at 990 or 3000) and some of the places treat 0 value as unlimited (wrapping off), some convert 0 to 72, some convert 0 to 990.

I don't know if that is intentional. I could try to consolidate this if there is a decision on how this sanity mangling should work.

On the other hand, it seems the original patch here was applied to the source (maybe by other bug). So is this bug still existent today?
Assignee: nobody → acelists
Depends on: 61831
I added dependence on bug 61831 because it changes one spot in nsMessenger.cpp that was using hardcoded wrap at 72 chars. Now it obeys the mailnews.wraplength pref. Maybe it will help comment 19?
Maybe the backend/composition owners will know what needs to happen here.
I think things have changed somewhat since this bug was filed - I'm not sure this is a big deal; we don't get a lot of complaints about it but if someone wants to advocate for changing our behavior, I'm listening.
OK. I have made an offer in comment 20 to consolidate the various manglings just for consistency. However I am not personally hit by this bug. So the original reporters (counting the dupes) must step in if any of the reported problems are still existing today.
Depends on: 777205

(In reply to :aceman from comment #24)

OK. I have made an offer in comment 20 to consolidate the various manglings just for consistency. However I am not personally hit by this bug. So the
original reporters (counting the dupes) must step in if any of the reported problems are still existing today.

I doubt any of them are still around (maybe Bryce, Przemyslaw at most) and the blocking Bug 777205 - Should remove unused wrap length value in nsMsgAttachmentHandler::UrlExit - has since been fixed.

So do you think there is aything left to do here?

Severity: major → normal
Flags: needinfo?(acelists)
Priority: P2 → --
Flags: needinfo?(acelists)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: