[dev] Re: [cvs] commit: imp/lib BodyText.php

Michael M Slusarz slusarz@bigworm.colorado.edu
Wed, 5 Jun 2002 16:08:28 -0600


Quoting Nuno Loureiro <nuno@co.eth.pt>:

| On Thu, 2002-05-30 at 17:50, Michael M Slusarz wrote:
| 
| > For example, the following reply text:
| > 
| > > > 1. One
| > > > 2. Two
| > > > 3. Three
| > 
| > Will be justified with my current code like this:
| > 
| > > > 1. One 2. Two 3. Three
| > 
| 
| Maybe I'm missing something here, but I think both cases are complety
| different, since the first one doesn't need wrapping and the second one
| does. I didn't look at your code yet (just did it in a glance), but the
| first case, determining the length of the line doesn't need any
| wrapping. The second case, needs wrapping, so the next line would have
| the current quoting string plus the rest of the current line (the
| wrapped part). [before answering this, read on... <g>)
|  
| My only problem is in the reliability of IMP_BodyText::is_quote($val);
| How do you know if something is a quote prefix or author's text ?

I was told by the original author that it _should_ handle these kind of 
quotes.  If not, this can be easily added.  I think it would be impossible 
to definitively say that all quote strings will always be caught, but since 
99% of the world uses simple quotes that's what we should be mostly 
interested in (it can't be any worse than the current reply system).

| 
| > > > Words words words words words words words words words words words 
| > > words
| > > > words words.
| > 
| > Which should be justified like this:
| > 
| > > > Words words words words words words words words words words words 
| > > > words words words.
| > 
| 
| I think I'm not understanding one thing here, which is probably what I'm
| missing here. 
| 1-Are you trying to justify the message *after* your MUA prefix it with
| the quoting string and do lame wrapping? 
| 2-Or are you trying to justify a message previously messed up by a
| previous MUA?
| 3-Or are you trying to justify a message "at the same time" you prefix
| it with the quoting string?

#3.  We can't undo any *lame* wrapping by previous MUA's (or at least we 
can't do this without some extreme effort).  I just want to ensure that 
anything IMP does not screw up the reply any more than when it received it.

| If your answer is 3, then If you first insert the quoting prefix without
| any wrapping, and on a second stage wrap+justify it, sounds more easier
| and you'll not have the problem you mentioned because the first example
| doesn't need to be wrapped and second one does, according to line
| lengths.
| 

As I said before, this is not going to be the easiest thing to accomplish, 
but I think a workable solution can be done.  A lot of the work is already 
out of the way (Eduardo Chappa's original algorithim in isQuote) so that's 
a plus.

I'm busy on several other things at present so I probably won't get to this 
for awhile.  Feel free to hack away.

michael

______________________________________________
Michael Slusarz [slusarz@bigworm.colorado.edu]
The University of Colorado at Boulder