Gnus development mailing list
 help / color / mirror / Atom feed
* "@" for addressed-to-you in summary line
@ 2005-08-11  7:14 Karl Chen
  2005-09-18 20:23 ` Michael Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Karl Chen @ 2005-08-11  7:14 UTC (permalink / raw)



I've been using the following code successfully for over a year to
mark mail addressed to me with a "@".  This is the same as the "+"
character used by pine and mutt.  To use add "%u+" to
gnus-summary-line-format.  I hope someone finds this useful.
Something similar is suitable for inclusion in Gnus.



(setq gnus-extra-headers '(To Cc Newsgroups Original-To))

(defun kc-mail-header-recipients (header)
  "Returns string of recipients extracted from To: and Cc: headers."
  (mapconcat (lambda (h) (gnus-extra-header h header)) '(To Cc Original-To) ", "))

(defvar kc-gnus-interesting-recipients nil
  "*Regexp of addresses for which to mark \"@\" in summary buffer.")

(defun kc-gnus-interesting-recipients-p (to)
  "Returns non-nil if any string in TO is \"interesting\".

A string is interesting if it is matched by `kc-gnus-interesting-recipients'"
  (and kc-gnus-interesting-recipients
       to
       (string-match kc-gnus-interesting-recipients to)))

(defun gnus-user-format-function-+ (header)
  (if (kc-gnus-interesting-recipients-p (kc-mail-header-recipients header))
      "@"
    " "))


-- 
Karl 2005-08-11 00:08




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: "@" for addressed-to-you in summary line
  2005-08-11  7:14 "@" for addressed-to-you in summary line Karl Chen
@ 2005-09-18 20:23 ` Michael Cook
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Cook @ 2005-09-18 20:23 UTC (permalink / raw)


Karl Chen <quarl@NOSPAM.quarl.org> writes:

> I've been using the following code successfully for over a year to
> mark mail addressed to me with a "@".  This is the same as the "+"
> character used by pine and mutt.  To use add "%u+" to
> gnus-summary-line-format.  I hope someone finds this useful.
> Something similar is suitable for inclusion in Gnus.
[...]
> (defun gnus-user-format-function-+ (header)
>   (if (kc-gnus-interesting-recipients-p (kc-mail-header-recipients header))
>       "@"
>     " "))

cool.  here's a slightly different version of your
gnus-user-format-function-+ that distinguishes between emails where
you're on the To list versus the Cc list:

(defun gnus-user-format-function-+ (header)
  (let ((case-fold-search t))
    (cond ((string-match gnus-ignored-from-addresses
			 (gnus-extra-header 'To header))
	   "To ")
	  ((string-match gnus-ignored-from-addresses
			 (gnus-extra-header 'Cc header))
	   "Cc ")
	  ("   "))))

m.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-09-18 20:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-11  7:14 "@" for addressed-to-you in summary line Karl Chen
2005-09-18 20:23 ` Michael Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).