;;; mh-scan.el --- MH-E scan line constants and utilities
-;; Copyright (C) 1993, 1995, 1997,
-;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1995, 1997, 2000-2013 Free Software Foundation,
+;; Inc.
;; Author: Bill Wohler <wohler@newt.com>
;; Maintainer: Bill Wohler <wohler@newt.com>
"%{subject}%<{body}<<%{body}%>")
"*Scan format string for MH.
This string is passed to the scan program via the -format
-argument. This format is identical to the default except that
+argument. This format is identical to the default except that
additional hints for fontification have been added to the fifth
column (remember that in Emacs, the first column is 0).
Note that the default setting of `mh-folder-font-lock-keywords'
expects this expression to contain at least one parenthesized
expression which matches the body text as in the default of
-\"\\\\(<<\\\\([^\\n]+\\\\)?\\\\)\". If this regular expression is
+\"\\\\(<<\\\\([^\\n]+\\\\)?\\\\)\". If this regular expression is
not correct, the body fragment will not be highlighted with the
face `mh-folder-body'.")
+(defvar mh-scan-blacklisted-msg-regexp "^\\( *[0-9]+\\)B"
+ "This regular expression matches blacklisted (spam) messages.
+
+It must match from the beginning of the line. Note that the
+default setting of `mh-folder-font-lock-keywords' expects this
+expression to contain at least one parenthesized expression which
+matches the message number as in the default of
+
+ \"^\\\\( *[0-9]+\\\\)B\".
+
+This expression includes the leading space within parenthesis
+since it looks better to highlight it as well. The highlighting
+is done with the face `mh-folder-blacklisted'. This regular
+expression should be correct as it is needed by non-fontification
+functions. See also `mh-note-blacklisted'.")
+
(defvar mh-scan-cur-msg-number-regexp "^\\( *[0-9]+\\+\\).*"
"This regular expression matches the current message.
-It must match from the beginning of the line. Note that the
+It must match from the beginning of the line. Note that the
default setting of `mh-folder-font-lock-keywords' expects this
expression to contain at least one parenthesized expression which
matches the message number as in the default of
This expression includes the leading space and current message
marker \"+\" within the parenthesis since it looks better to
-highlight these items as well. The highlighting is done with the
-face `mh-folder-cur-msg-number'. This regular expression should
-be correct as it is needed by non-fontification functions. See
+highlight these items as well. The highlighting is done with the
+face `mh-folder-cur-msg-number'. This regular expression should
+be correct as it is needed by non-fontification functions. See
also `mh-note-cur'.")
(defvar mh-scan-date-regexp "\\([0-9][0-9]/[0-9][0-9]\\)"
Note that the default setting of `mh-folder-font-lock-keywords'
expects this expression to contain only one parenthesized
expression which matches the date field as in the default of
-\"\\\\([0-9][0-9]/[0-9][0-9]\\\\)\"}. If this regular expression
+\"\\\\([0-9][0-9]/[0-9][0-9]\\\\)\"}. If this regular expression
is not correct, the date will not be highlighted with the face
`mh-folder-date'.")
(defvar mh-scan-deleted-msg-regexp "^\\( *[0-9]+\\)D"
"This regular expression matches deleted messages.
-It must match from the beginning of the line. Note that the
+It must match from the beginning of the line. Note that the
default setting of `mh-folder-font-lock-keywords' expects this
expression to contain at least one parenthesized expression which
matches the message number as in the default of
\"^\\\\( *[0-9]+\\\\)D\".
This expression includes the leading space within the parenthesis
-since it looks better to highlight it as well. The highlighting
-is done with the face `mh-folder-deleted'. This regular
+since it looks better to highlight it as well. The highlighting
+is done with the face `mh-folder-deleted'. This regular
expression should be correct as it is needed by non-fontification
-functions. See also `mh-note-deleted'.")
+functions. See also `mh-note-deleted'.")
-(defvar mh-scan-good-msg-regexp "^\\( *[0-9]+\\)[^D^0-9]"
+(defvar mh-scan-good-msg-regexp "^\\( *[0-9]+\\)[^^DBW0-9]"
"This regular expression matches \"good\" messages.
-It must match from the beginning of the line. Note that the
+It must match from the beginning of the line. Note that the
default setting of `mh-folder-font-lock-keywords' expects this
expression to contain at least one parenthesized expression which
matches the message number as in the default of
- \"^\\\\( *[0-9]+\\\\)[^D^0-9]\".
+ \"^\\\\( *[0-9]+\\\\)[^^DBW0-9]\".
This expression includes the leading space within the parenthesis
-since it looks better to highlight it as well. The highlighting
-is done with the face `mh-folder-msg-number'. This regular
+since it looks better to highlight it as well. The highlighting
+is done with the face `mh-folder-msg-number'. This regular
expression should be correct as it is needed by non-fontification
functions.")
"This regular expression finds the message number width in a scan format.
Note that the message number must be placed in a parenthesized
-expression as in the default of \"%\\\\([0-9]*\\\\)(msg)\". This
+expression as in the default of \"%\\\\([0-9]*\\\\)(msg)\". This
variable is only consulted if `mh-scan-format-file' is set to
\"Use MH-E scan Format\".")
(defvar mh-scan-msg-format-string "%d"
"This is a format string for width of the message number in a scan format.
-Use \"0%d\" for zero-filled message numbers. This variable is only
+Use \"0%d\" for zero-filled message numbers. This variable is only
consulted if `mh-scan-format-file' is set to \"Use MH-E scan
Format\".")
(defvar mh-scan-msg-number-regexp "^ *\\([0-9]+\\)"
"This regular expression extracts the message number.
-It must match from the beginning of the line. Note that the
+It must match from the beginning of the line. Note that the
message number must be placed in a parenthesized expression as in
the default of \"^ *\\\\([0-9]+\\\\)\".")
Note that the default setting of `mh-folder-font-lock-keywords'
expects this expression to contain two parenthesized expressions.
The first is expected to match the \"To:\" that the default scan
-format file generates. The second is expected to match the
+format file generates. The second is expected to match the
recipient's name as in the default of
-\"\\\\(To:\\\\)\\\\(..............\\\\)\". If this regular
+\"\\\\(To:\\\\)\\\\(..............\\\\)\". If this regular
expression is not correct, the \"To:\" string will not be
highlighted with the face `mh-folder-to' and the recipient will
not be highlighted with the face `mh-folder-address'")
(defvar mh-scan-refiled-msg-regexp "^\\( *[0-9]+\\)\\^"
"This regular expression matches refiled messages.
-It must match from the beginning of the line. Note that the
+It must match from the beginning of the line. Note that the
default setting of `mh-folder-font-lock-keywords' expects this
expression to contain at least one parenthesized expression which
matches the message number as in the default of
\"^\\\\( *[0-9]+\\\\)\\\\^\".
This expression includes the leading space within the parenthesis
-since it looks better to highlight it as well. The highlighting
-is done with the face `mh-folder-refiled'. This regular
+since it looks better to highlight it as well. The highlighting
+is done with the face `mh-folder-refiled'. This regular
expression should be correct as it is needed by non-fontification
-functions. See also `mh-note-refiled'.")
+functions. See also `mh-note-refiled'.")
(defvar mh-scan-sent-to-me-sender-regexp
"^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)"
Note that the default setting of `mh-folder-font-lock-keywords'
expects this expression to contain at least two parenthesized
-expressions. The first should match the fontification hint (see
+expressions. The first should match the fontification hint (see
`mh-scan-format-nmh') and the second should match the user name
as in the default of
"^ *[0-9]+........[ ]*...................\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)"
"This regular expression matches the subject.
-It must match from the beginning of the line. Note that the
+It must match from the beginning of the line. Note that the
default setting of `mh-folder-font-lock-keywords' expects this
expression to contain at least three parenthesized expressions.
The first is expected to match the \"Re:\" string, if any, and is
-highlighted with the face `mh-folder-followup'. The second
+highlighted with the face `mh-folder-followup'. The second
matches an optional bracketed number after \"Re:\", such as in
\"Re[2]:\" (and is thus a sub-expression of the first expression)
and the third is expected to match the subject line itself which
-is highlighted with the face `mh-folder-subject'. For example,
+is highlighted with the face `mh-folder-subject'. For example,
the default (broken on multiple lines for readability) is
^ *[0-9]+........[ ]*...................
This is used to eliminate error messages that are occasionally
produced by \"inc\".")
+(defvar mh-scan-whitelisted-msg-regexp "^\\( *[0-9]+\\)W"
+ "This regular expression matches whitelisted (non-spam) messages.
+
+It must match from the beginning of the line. Note that the
+default setting of `mh-folder-font-lock-keywords' expects this
+expression to contain at least one parenthesized expression which
+matches the message number as in the default of
+
+ \"^\\\\( *[0-9]+\\\\)W\".
+
+This expression includes the leading space within parenthesis
+since it looks better to highlight it as well. The highlighting
+is done with the face `mh-folder-whitelisted'. This regular
+expression should be correct as it is needed by non-fontification
+functions. See also `mh-note-whitelisted'.")
+
\f
;;; Widths, Offsets and Columns
(defvar mh-scan-cmd-note-width 1
"Number of columns consumed by the cmd-note field in `mh-scan-format'.
-This column will have one of the values: \" \", \"D\", \"^\", \"+\" and
-where \" \" is the default value,
+This column will have one of the values: \" \", \"^\", \"D\", \"B\", \"W\", \"+\", where
+ \" \" is the default value,
+ \"^\" is the `mh-note-refiled' character,
\"D\" is the `mh-note-deleted' character,
- \"^\" is the `mh-note-refiled' character, and
+ \"B\" is the `mh-note-blacklisted' character,
+ \"W\" is the `mh-note-whitelisted' character, and
\"+\" is the `mh-note-cur' character.")
(defvar mh-scan-destination-width 1
in it.
\" \" blank space is the default character.
- \"%\" indicates that the message in in a named MH sequence.
+ \"%\" indicates that the message in a named MH sequence.
\"-\" indicates that the message has been annotated with a replied field.
\"t\" indicates that the message contains mymbox in the To: field.
\"c\" indicates that the message contains mymbox in the Cc: field.
;; Alphabetical.
+(defvar mh-note-blacklisted ?B
+ "Messages that have been blacklisted are marked by this character.
+See also `mh-scan-blacklisted-msg-regexp'.")
+
(defvar mh-note-cur ?+
"The current message (in MH, not in MH-E) is marked by this character.
See also `mh-scan-cur-msg-number-regexp'.")
Messages in the \"search\" sequence are marked by this character as
well.")
+(defvar mh-note-whitelisted ?W
+ "Messages that have been whitelisted are marked by this character.
+See also `mh-scan-whitelisted-msg-regexp'.")
+
\f
;;; Utilities
"Return a scan format with the (msg) width in the FMT replaced with WIDTH.
The message number width portion of the format is discovered
-using `mh-scan-msg-format-regexp'. Its replacement is controlled
+using `mh-scan-msg-format-regexp'. Its replacement is controlled
with `mh-scan-msg-format-string'."
(or (and
(string-match mh-scan-msg-format-regexp fmt)
If `mh-scan-format-file' is set to \"Use MH-E scan Format\" this
means that either `mh-scan-format-mh' or `mh-scan-format-nmh' are
-in use. This function therefore assumes that the first column is
+in use. This function therefore assumes that the first column is
empty (to provide room for the cursor), the following WIDTH
columns contain the message number, and the column for notations
comes after that."
;; sentence-end-double-space: nil
;; End:
-;; arch-tag: 5ab35d46-101e-443b-a2b6-5a908cf97528
;;; mh-scan.el ends here