mu-scm: add support for mailing-list

method + doc + test
This commit is contained in:
Dirk-Jan C. Binnema
2025-06-28 11:54:35 +03:00
parent f66172db3b
commit cc39c9cae6
3 changed files with 24 additions and 1 deletions

View File

@ -79,6 +79,12 @@
"20051209233303.GA13812@gauss.org" "439B41ED.2080402@euler.org" "20051209233303.GA13812@gauss.org" "439B41ED.2080402@euler.org"
"439A1E03.3090604@euler.org" "20051211184308.GB13513@gauss.org") "439A1E03.3090604@euler.org" "20051211184308.GB13513@gauss.org")
(references msg))) (references msg)))
(let ((msg (car (mfind "subject:\"gcc include search order\""))))
(test-equal "gcc include search order" (subject msg))
(test-equal "klub" (header msg "precedence"))
(test-equal "gcc-help.gcc.gnu.org" (mailing-list msg))
(test-equal #f (references msg)))
(test-end "test-message-more")) (test-end "test-message-more"))
(define (test-options) (define (test-options)

View File

@ -33,7 +33,6 @@
sexp sexp
date date
iso-date
last-change last-change
message-id message-id
@ -42,6 +41,7 @@
subject subject
references references
mailing-list
language language
size size
@ -223,6 +223,10 @@ fake-message-id (see impls) are filtered out. If there are no references, return
#f." #f."
(find-field message ':references)) (find-field message ':references))
(define-method (mailing-list (message <message>))
"Get the mailing-list id for MESSAGE or #f if not available."
(find-field message ':list))
;; Flags. ;; Flags.
(define-method (flags (message <message>)) (define-method (flags (message <message>))

View File

@ -630,6 +630,7 @@ Get the list of references (message-ids of related messages) for this message.
This combines the @t{References} and @t{In-Reply-To} fields, from oldest to the This combines the @t{References} and @t{In-Reply-To} fields, from oldest to the
immediate parent. Returns @code{#f} if there are no references. immediate parent. Returns @code{#f} if there are no references.
For example:
@lisp @lisp
(references msg) (references msg)
=> ("439C1136.90504@@euler.org" "4399DD94.5070309@@euler.org" => ("439C1136.90504@@euler.org" "4399DD94.5070309@@euler.org"
@ -637,6 +638,18 @@ immediate parent. Returns @code{#f} if there are no references.
439A1E03.3090604@@euler.org" "20051211184308.GB13513@@gauss.org") 439A1E03.3090604@@euler.org" "20051211184308.GB13513@@gauss.org")
@end lisp @end lisp
@deffn {Scheme Procedure} mailing-list message
@end deffn
Get the mailing-list id for this message (corresponding with the @t{List-Id:}
field), or @code{#f} if there is none.
For example:
@lisp
(mailing-list msg)
=> "gnu-emacs-sources.gnu.org"
@end lisp
@c @deffn {Scheme Procedure} sexp message @c @deffn {Scheme Procedure} sexp message
@c @end deffn @c @end deffn
@c Get the message's s-expression. @c Get the message's s-expression.