; Provide documentation example for gnus-alter-header-function
authorAndrew G Cohen <cohen@andy.bu.edu>
Thu, 9 May 2024 08:44:21 +0000 (16:44 +0800)
committerAndrew G Cohen <cohen@andy.bu.edu>
Fri, 10 May 2024 00:25:48 +0000 (08:25 +0800)
* doc/misc/gnus.texi (Low-Level Threading): Provide an example of using
gnus-alter-header-function to remove unwanted items in References
header.

doc/misc/gnus.texi

index 8aa7f855aea9ebbbd174330a88451ae586bf293e..c5e4c885ccf92ea3093941f3fc96defee41e99bb 100644 (file)
@@ -7423,6 +7423,22 @@ meaningful.  Here's one example:
        header))))
 @end lisp
 
+And another example:  the protonmail bridge adds fake message-ids to
+@code{References} in message headers, which can confuse threading. To
+remove these spurious ids
+
+@lisp
+(setq gnus-alter-header-function 'fix-protonmail-references)
+
+(defun fix-protonmail-references (header)
+  (setf (mail-header-references header)
+        (mapconcat
+         #'(lambda (x) (if (string-search "protonmail.internalid" x) "" x))
+         (gnus-split-references (mail-header-references header)) " "))
+  header)
+
+ @end lisp
+
 @end table