branch: externals/ebdb
commit 94749fd8ce25145186e8c3b9127ffccc332198e0
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>
Expand gnus-user-format-function-%s
* ebdb-gnus.el (ebdb-insinuate-gnus): Incorporate the guts of
`gnus-summary-from-or-to-or-newsgroups', so that we get the proper
behavior in sent-message/archive groups. Essentially, make
`gnus-user-format-function-E' behave like Gnus' %f formatting code,
rather than %F. Copying code is bad, it would be nice if this could
be refactored out.
---
ebdb-gnus.el | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/ebdb-gnus.el b/ebdb-gnus.el
index 4bcc463..ae4e69d 100644
--- a/ebdb-gnus.el
+++ b/ebdb-gnus.el
@@ -494,7 +494,30 @@ quoted replies."
(fset (intern (concat "gnus-user-format-function-"
ebdb-mua-summary-unify-format-letter))
(lambda (header)
- (ebdb-mua-summary-unify (mail-header-from header)))))
+ (let ((from (mail-header-from header)))
+ (or
+ (and gnus-ignored-from-addresses
+ (cond ((functionp gnus-ignored-from-addresses)
+ (funcall gnus-ignored-from-addresses
+ (mail-strip-quoted-names from)))
+ (t (string-match (gnus-ignored-from-addresses)
from)))
+ (let ((extra-headers (mail-header-extra header))
+ to
+ newsgroups)
+ (cond
+ ((setq to (cdr (assq 'To extra-headers)))
+ (concat gnus-summary-to-prefix
+ (ebdb-mua-summary-unify to)))
+ ((setq newsgroups
+ (or
+ (cdr (assq 'Newsgroups extra-headers))
+ (and
+ (memq 'Newsgroups gnus-extra-headers)
+ (eq (car (gnus-find-method-for-group
+ gnus-newsgroup-name)) 'nntp)
+ (gnus-group-real-name gnus-newsgroup-name))))
+ (concat gnus-summary-newsgroup-prefix newsgroups)))))
+ (ebdb-mua-summary-unify (mail-header-from header)))))))
;; (2) Small solution: a mark for messages whos sender is in EBDB.
(if ebdb-mua-summary-mark-format-letter