! Syntax Highlighting Patterns for RFC-822 Emails ! ! Use this pattern by starting NEdit with: ! ! nedit -import email-3.1.pats ! ! If you want to keep the patterns permanently, you have to save your ! preferences by choosing 'Save Defaults' from the Preferences menu. ! ! Copyright 2004 Thorsten Haude ! Copyright 2004-2013 Volker Kuhlmann ! This file can be copied and distributed under the same licence as NEdit ! or, at your option, under the GNU General Public Licence, Version 2. ! nedit.languageModes: \ Mail:.email .mail .mbox .eml:"^(?:(?iDate|From|To|Subject):\\s|From )"::::::\n\ nedit.highlightPatterns: \ Mail:2:0{\n\ README:"Mail highlighting patterns, version 3.1, original author and maintainer Thorsten Haude, nedit at thorstenhau.de. Improved by Volker Kuhlmann, VolkerKuhlmann at gmx.de, 2013-09-06.":::Warning::\n\ header:"^(?:From .*(?=(?:\\n.+)*\\n(?iFrom|Date):)|(?=(?:(?:.+\\n)*(?iFrom|To|Subject|Date):){4})).*(?#Can't enforce leading blank line and also match at start of file.)\n\ ":"\\n\\n":"\\n\\n":Text Arg2::\n\ main header:"^(?iFrom|To|Subject|Date|Reply-To):\\s*.*(\\n\\s.*)*":::Text Arg:header:\n\ attribution:"^(?:\\* <.*> \\<[-_.\\l\\d]+@[-_.\\l\\d]+\\> \\[\\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d:\\d\\d\\]:|\\l.*[^\\l\\d]\\d\\d\\d\\d[^\\l\\d].*:)$(?# These are only two examples, please provide a pattern for your own attribution line. )":::Storage Type::D\n\ quote level 1:"^\\>\\s*(?:|[^>\\s].*)$":::Preprocessor1::D\n\ quote level 2:"^\\>\\s*\\>\\s*(?:|[^>\\s].*)$":::String::D\n\ quote level 3:"^\\>\\s*\\>\\s*\\>\\s*(?:|[^>\\s].*)$":::Text Key1::D\n\ quote level 4:"^\\>\\s*\\>\\s*\\>\\s*\\>\\s*(?:|[^>\\s].*)$":::Subroutine1::D\n\ quote level 5:"^\\>\\s*\\>\\s*\\>\\s*\\>\\s*\\>\\s*(?:|[^>\\s].*)$":::Preprocessor::D\n\ quote level 6plus:"^\\>\\s*\\>\\s*\\>\\s*\\>\\s*\\>\\s*\\>.*$":::String1::D\n\ signature:"^-- \\n(?:[^\\n]+\\n)*":::Text Comment::\n\ } ! Change Log: ! ! 2004-01-11 Volker Kuhlmann ! - improved from Thorsten Haude's basic version: ! - quoted lines which are empty coloured correctly ! - 2. and 4. colour swapped, the new 2. colour is easier to read ! - regex for attribution line extended, though nothing will ever fit ! all possibilities there ! ! 2004-01-12 Volker Kuhlmann ! - extended to colour the headers if present, and the important headers ! in a different colour ! - handles pseudo-mbox format mailboxes ! Note: This takes about 1.2s/MB on a P3-450 on first load of the file ! - changed some constructs to non-capturing (faster) ! - need context-rescan-lines of 2 for editing headers ! - extended language mode ! ! 2004-01-12 Thorsten Haude ! - changed some formalities on Volker's work ! - changed some colors ! - changed some pattern names ! - use only required headers (From and Date) to recognize a header block ! - brushed up language mode ! - removed some false case insensitivities ! - make signature pattern more strict ! ! 2004-01-15 Volker Kuhlmann ! - Tried to come up with a new expression which also highlights headers in ! mails not in mbox format (doesn't have a From_), but the expression isn't ! very nice. In this case there will be only one mail per file. When ! composing with mutt, there is no Date: line (as that gets added during ! sending). ! - Made header field names case-insensitive again. Is there an application ! which requires them to be case-sensitive? This remains to be decided on. ! - Header fields are delimited by colon and possible *white* space (not ! space). Dunno whether this white space is even optional. ! - experimentally changed colour of attribution line ! - created a third test file ! ! 2004-07-20 Thorsten Haude ! - Bumped up version number to 3.0. This is unchanged from what was ! called 1.2, but I saw a version 2.0 which was clearly less evolved. ! ! 2004-08-14 Thorsten Haude ! - Bumped up version number to 3.0.1 because I forgot to change the ! README pattern (doh). ! - Header *are* case-insensitive according to the RFC 2822. ! ! 2013-09-06 Volker Kuhlmann ! - Allow certain headers to appear in any order when detecting the start of ! the headers. Require 3 of them. ! - Make language detection pattern more flexible, add extension ".eml". ! - Show quotes at level higher than 6 in the same colour as level 6.