[Geany-Users] TWiki Lexer / Folder / Highlighter:The From header

rhkramer at gmail.com rhkramer at xxxxx
Mon Dec 14 16:52:02 UTC 2015


Oh, I should have mentioned:

   * there is more to fold / highlight than just the From header--I plan to 
address more in separate emails

   * a From header marks the beginning of a top level fold, which ends 
(currently) at the end of the a TWiki record (either the morF, the next From 
header, or the EOF).

   * highlighting: in the kate highlighter, highlighting is as follows (and 
I'd like to do it the same in Scintilla / Geany)

      * the word "From" is in a bold red font
      * the word or quoted phrase after From is in the black "normal" font 
(the same as all other text)
      * the remainder of that line, and the remainder of the From header 
(subsequent lines) is in a pale yellow (i.e., something barely visible) 
"normal" font.  Future enhancements might include:
         * rendering all but Date: and Subject: lines in the header as not 
visible or similar, and rendering those in the barely visible pale yellow 
"normal" font

Notes:
   * When I do something to "break" the syntax of the From header, then the 
entire From header (all lines) are rendered in the (black) "normal" font and 
are easily visible and editable.

   * The "morF" is always (keep reading) rendered in the  (black) "normal" 
font, but when a TWiki record is folded, the morF is not visible because it is 
within the fold.

   * By the way, when a TWiki record is folded, only the first line of the From 
header is visible, rendered as described above (i.e., red bold, normal, then 
pale yellow)

Randy Kramer


On Sunday, December 13, 2015 10:51:58 PM you wrote:
> The From header is a multiline header that marks the beginning of a TWiki
> record.
> 
> The From header is very much like and compatible with the mbox file From
> header.  Among other things, it allows TWiki records to be treated as
> emails in various other software (specifically, kmail, nmail, and kate
> (using my TWiki highlighter)).
> 
> An optional "morF" line, the next From header, or the EOF mark the end of a
> TWiki record.
> 
> There can be non-TWiki record text matter between a morF line and the start
> of the next TWiki record, or before the first TWiki record, or between a
> morF line and the end of the file.
> 
> The first line of a From header:
>    * starts with "From" starting at the 1st position of a line, followed by
> a space
>    * the next entity on the line can be either a single word without
> quotes, or a phrase within double quotes
>    * the next entity on the line is a date and time in the format:
> Wed Jun 24 23:34:59 2011
> 
> The From line can be followed by any number of header lines with a format
> like:
> 
> <keyword>: <text>
> 
> A header line starting with 8 spaces is a continuation of the previous
> line.
> 
> For purposes of TWiki (to make the From header work in kmail, nmail, and
> kate) that group of lines must include at least one Date: line and at
> least one Subject: line.  It may include any number of other <keyword>:
> <text> lines, or additional Date: or Subject: lines.
> 
> The From header is ended by a blank line.
> 
> Here are some examples of From headers (with a sample morF line just to
> remember that morF lines exist and must be handled):
> 
> From "this is a test" Wed Jun 24 23:34:59 2011
> Subject: initial notes
> Date: Fri Jun 25 23:34:59 2011
> 
> morF
> 
> From testing Wed Jun 24 23:34:59 2011
> Subject: initial notes
> Date: Fri Jun 25 23:34:59 2011
> 
> From "this is a test" Wed Jun 24 23:34:59 2011
> From: John Doe <jdoe06 at gmail.com>
> To: Mary Doe <mdoe at gmail.com>
> Subject: initial notes
> Date: Fri Jun 25 23:34:59 2011
> Delivered-To: mdoe at gmail.com
> Received: by 10.202.71.88 with SMTP id u85csp532197oia;
>         Wed, 4 Feb 2015 04:06:40 -0800 (PST)
> X-Received: by 10.66.124.225 with SMTP id
> ml1mr45317489pab.142.1423051599997; Wed, 04 Feb 2015 04:06:39 -0800 (PST)
> Return-Path: <eagle at gopusamedia.com>
> Received: from mx2.gopusamedia.com (mx2.gopusamedia.com. [65.17.233.201])
>         by mx.google.com with ESMTP id
> xy10si1804601pac.209.2015.02.04.04.06.39
>         for <mdoe at gmail.com>;
>         Wed, 04 Feb 2015 04:06:39 -0800 (PST)


More information about the Users mailing list