From: Sean Whitton Date: Mon, 21 Jul 2025 08:54:02 +0000 (+0100) Subject: (gnus)Scoring Tips: New tip regarding header continuation lines X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=042d3294e9f2474e64f837e73cca196d91573647;p=emacs.git (gnus)Scoring Tips: New tip regarding header continuation lines * doc/misc/gnus.texi (Scoring Tips): New "Continuation lines when scoring on other headers" tip. (cherry picked from commit 8f00d36b63dc6c57ad2fd4f387841e4ac9e68225) --- diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index bd99eb7234a..23be6b9c47d 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -21164,6 +21164,29 @@ You may also consider doing something similar with @code{expunge}. If you say stuff like @code{[^abcd]*}, you may get unexpected results. That will match newlines, which might lead to, well, The Unknown. Say @code{[^abcd\n]*} instead. + +@item Continuation lines when scoring on other headers +When scoring on other headers using the @code{Head} or @code{All} match +keys and regexp matching, your regular expression must take into account +header continuation lines. For example, this naive attempt to match +messages including a particular address in the @code{To} field: + +@lisp +("head" "^To: .*\\bspwhitton@@spwhitton\\.name\\b" r) +@end lisp + +will fail to match a message with a @code{To} header like this: + +@example +To: A long description of the Emacs devel list , + spwhitton@@spwhitton.name, 12345@@debbugs.gnu.org +@end example + +You can handle this issue with a regexp of this form: + +@lisp +("head" "^To: .*\\(?:\n[\s\t].*\\)*\\bspwhitton@@spwhitton\\.name\\b" r) +@end lisp @end table