aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/lexers
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-03-08 22:03:48 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-03-08 22:03:48 +0300
commitbdf35b89fe8d653847ab077d4183b71feebd48d2 (patch)
tree462dac400ceddb4f44b11551f2c52116e433f43c /lib/lexers
parent7bcd3d8fee485d2fdd6af2d0362d2a59b374c724 (diff)
downloadsciteco-bdf35b89fe8d653847ab077d4183b71feebd48d2.tar.gz
added "email" lexer for writing mails
* Highlights both 1st level and 2nd level quotes and signatures. * This also sets the edge to 78 columns, as is recommended for email and enables word wrapping. The edge mode is not set, since it kind of looks ugly in Scinterm. * Helps when using SciTECO as the email editor for instance in the Aerc mail client. * Unfortunately, we cannot set up Scintilla to automatically break words after 78 columns (or perhaps that's a good thing). You can use the M#rf reformat-paragraph macro to reflow paragraphs before sending the mail. This will take the edge column into account even if no edge mode is set.
Diffstat (limited to 'lib/lexers')
-rw-r--r--lib/lexers/email.tes34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/lexers/email.tes b/lib/lexers/email.tes
new file mode 100644
index 0000000..895aeea
--- /dev/null
+++ b/lib/lexers/email.tes
@@ -0,0 +1,34 @@
+!*
+ * E-Mail messages with signatures and quotes.
+ *
+ * NOTE: This is not a real lexer.
+ * It only styles the document once.
+ *!
+
+@[lexer.test.email]{
+ :EN*.emlQ*
+}
+
+@[lexer.set.email]{[:
+ 78ESSETEDGECOLUMN 1ESSETWRAPMODE
+ !!1ESSETEDGEMODE
+
+ :M[color.comment],1M[color.set]
+ :M[color.preproc],2M[color.set]
+ :M[color.preproc2],3M[color.set]
+
+ ZU.z
+ ZJ [_-:S^J-- ^J]_"S !* signatures *!
+ 4R .U.z
+ ESSTARTSTYLING 1,(:-)ESSETSTYLING
+ '
+
+ J< .-Q.z"= 1; '
+ 0A->"= !* quotes *!
+ U.s
+ <:C; 0A- "N 1; '> .-Q.z"= 1; '
+ Q.sESSTARTSTYLING
+ (0A->"=3|2'),(Q.lESLINELENGTH)ESSETSTYLING
+ '
+ :L; %.l>
+]:}