[Gambas-user] Top posting

Tobias Boege taboege at ...626...
Wed Mar 11 01:51:54 CET 2015


On Wed, 11 Mar 2015, richard terry wrote:
> Personally I like top-posting, some lists I"m on use it. I find it 
> easier to find out the last thing said rather than having to scroll down 
> to the bottom of a long post. If the mail headers are up in the top 
> pain, and the text in the bottom pain its easy to just scroll down the 
> mail without having to constantly jump to the bottom pane to go down to 
> the bottom.
> 

I'm astonished how I can't relate at all. There is clearly no use trying
to settle this debate. So, for those who have a scriptable MUA and like
bottom-posting better, I attach a super-quick hack which tries to convert
top-posting mails to bottom ones, just to suggest that everyone may fix
their mail locally. In mutt, display_filter is the relevant setting (for
display only).

Also attached are a screenshot of a mail where it works and one where it
doesn't completely. There are uncountably many variations in the way
citations are introduced, and, in turn, as many spacing violations of
them, so it will never relly work. (I guess at this point, it will
completely mess up inline replies... It also can't correct top-posting
in citations.)

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
-------------- next part --------------
#!/usr/bin/gbs3

Private Enum Header, Body, Signature

Private $iPart As Integer
Private $aHeader As New String[]
Private $aBody As New String[]
Private $aSig As New String[]

Public Sub Main()
  $iPart = Header
  ' Process input in Application_Read()
  While Not Eof(File.In)
    Wait 0.1
  Wend

  Top2Bottom()
  Print Trim$($aHeader.Join("\n"))
  Print
  Print Trim$($aBody.Join("\n"))
  Print
  Print Trim$($aSig.Join("\n"))
  Quit
End

Public Sub Application_Read()
  Dim sLine As String

  Line Input sLine
  Select Case $iPart
    Case Header
      If Not sLine Then $iPart = Body
      $aHeader.Add(sLine)
    Case Body
      If sLine = "--" Or If sLine = "-- " Then
        $iPart = Signature
        $aSig.Add(sLine)
      Else
        $aBody.Add(sLine)
      Endif
    Case Signature
      $aSig.Add(sLine)
  End Select
End

Private Sub Top2Bottom()
  Dim aReply, aCitation As New String[]
  Dim iInd As Integer

  For iInd = 0 To $aBody.Max
    ' Gambas has no support for "If p Or If (q And If r) Then"
    If $aBody[iInd] Begins ">" Then
      aCitation.Add($aBody[iInd])
    Else If iInd < $aBody.Max And If $aBody[iInd + 1] Begins ">" Then
      aCitation.Add($aBody[iInd])
    Else
      aReply.Add($aBody[iInd])
    Endif
  Next
  $aBody = aCitation.Insert(["\n"]).Insert(aReply)
End
-------------- next part --------------
A non-text attachment was scrubbed...
Name: top2bottom-1.png
Type: image/png
Size: 45387 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20150311/5926489a/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: top2bottom-2.png
Type: image/png
Size: 46362 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20150311/5926489a/attachment-0001.png>


More information about the User mailing list