|FAQ about patches|||||More patches|||||Main Page|||||SHA256 digest for this patch|
Justify paragraphs that contain more than one level of quoting.
Patch is available for versions: alpine snapshot alpine 0.81 alpine 0.82 alpine 0.83 alpine 0.98 alpine 0.99 alpine 0.999 alpine 0.9999 alpine 0.99999 alpine 0.999999 alpine 1.99 alpine 1.999 alpine 2.19.4 alpine 2.19.5 alpine 2.19.6 alpine 2.19.7 alpine 2.19.99 alpine 2.20.1 alpine 2.20.3 alpine 2.20.4 alpine 2.20.5 alpine 2.20.6 alpine 2.20.7 alpine 2.20.8 alpine 2.20.9 alpine 2.20.11 alpine 2.20.12 alpine 2.20.13 alpine 2.20.14 alpine 2.20.15 alpine 2.20.16 alpine 2.20.17 alpine 2.20.99 alpine 2.20.999 alpine 2.21.9 alpine 2.21.999 alpine 2.21.9999
When you reply to a message, which has been quoted by several people and you justify a paragraph, Alpine may not notice any other quote strings and justify the paragraph as if there was no other quote strings in it. This patch will help Alpine recognize extra levels of quoting, so that justifying will still make the text readable. This is important because the purpose of justification is to make the text more readable, and an incorrect justification may make the text impossible to read.
Here's a real example:
The following text is not justified:
:) > this is a :) > test :) > :) >If we justified this text in Alpine we'd get
:) > this is a > test > > :) :)If you apply the patch and justify the above text, you'd get
:) > this is a test :) > :) >Note how quote levels were preserved.
It's very difficult, although not impossible, to fool the algorithm. I still have to find a real life example where I can fool the algorithm, if you find one please let me know. As usual, the Ctrl-U command can undo justification, so keep it in mind if you find that the patch does not do its work correctly.
Here there are more interesting examples.
New: Additionally, if you use Alpine with colors, now this patch was added some code that will allow you to read different quoting levels in different colors. Here you can see an image that shows 3 different labels painted correctly. This patch also supports flowed text. This means that if flowed text contains a non standard quote string it will be wrapped correctly. For example, you can see image which shows flowed text in a terminal 80 columns wide. If you compress this text, you can see that text is wrapped and painted correctly.
You can also remove paragraphs. The command ^W^P can be used to erase the paragraph over which the cursor is. If the cursor is not over a paragraph, Pico will delete the paragraph following to the position of the cursor. Paragraphs that are quoted are also recognized by this patch (and it is the main reason why this functionality was added to this patch). You can recover a paragraph that you just deleted by pressing ^U. If you delete two consecutive paragraphs without pressing any other key in between, then pressing ^U will recover both paragraphs.
The variable quote-suppression-threshold also controls the number of quoted consecutive lines that are displayed, not only those quoted using the > character.
Alpine has basic support for justification of more than one quoting level, but only when the quote string in every level of quoting is the same (this means that, other quote strings are not recognized). That implementation of justification has some bugs which do not allow it to recognize certain combinations of the same quote string (in raw form). For example, if a text is quoted with the quote string "> " (two spaces at the end), Alpine will fail to recognize quoted text, even if it is justified with the ">" or "> " quote strings.
The editor nano (version 1.2.0) also has support for multiple levels of quoting, but it does not support all quotes that this algorithm supports out of the box. For example, nano supports several levels of arbitrary quote strings starting the editor with the command "nano". If you do so, the above test text will be justified as:
:) > this is a ) > test ) > ) >You can always justify correctly if you tell nano what the quote string is, and that's a big difference with this algorithm, in which you don't have to tell the algorithm what is the quote string, but it will guess it pretty well. It is my understanding that other editors (e.g. vim) behave in a similar way to nano.
Last Updated 23:46:55 MDT Mon Aug 13 2018.