Ah, that rendering of diffs is nice. Something like that would certainly be welcome.
I acknowledge that it's not an easy problem. Whereas diffs can be recognized using a simple regex (a group of lines following a line that starts with 'diff'), email authors may have many reasons for indenting a line. The questions for the formatter are whether to squash whitespace at the beginning of the line (thereby removing indentation), and, separately, whether to re-wrap the lines in a paragraph. Hopefully we can find a simple rule that matches people's expectations most of the time. Julian On Thu, Jul 11, 2024 at 5:20 AM Daniel Gruno <[email protected]> wrote: > > On 7/10/24 21:12, Julian Hyde wrote: > > Ponymail has two rendering modes: 'modern' seems to wrap all text and > > squash whitespace, and 'legacy' preserves the formatting of the > > original email. > > > > I would prefer to use 'modern', since many people (and their email > > clients) don't wrap long paragraphs properly. But 'modern' flattens > > paragraphs that have been carefully indented by hand, such as the > > following code example (see [1]): > > > > final public String NonReservedKeyWord() throws ParseException { > > if (jj_2_1116(2)) { > > NonReservedKeyWord0of3(); > > } else if (jj_2_1117(2)) { > > NonReservedKeyWord1of3(); > > ... > > > > Has someone considered a 'hybrid' rendering mode that wraps paragraphs > > like 'modern' mode only if they are not preceded by whitespace? That > > seems to be the behavior of many modern email clients, such as gmail, > > and would be popular with those of us who include code fragments in > > our email discussions. > > Hi, Julian, > > We sort of have a hybrid mode built in already, for diffs in emails, > such as https://lists.apache.org/thread/ffzp2oz4s1766lwmh29jfp3k772rn3x3 > > I suppose we could use a similar approach to blocks/"quotes"? > > > > > > Julian > > > > [1] https://lists.apache.org/thread/p9gm08w9s9b9xdc767ggxgpp98sk7l5v >
