6071 comments
2357 subscribers
6186 on Twitter
Subscribe! Feed reader E-mail

Emacs Gnus hack: Prioritize based on the number of recipients

Ever found yourself confronted with an inbox overflowing with general
messages that you can ignore and messages that you and only you can
act on? Here’s something to help you sort the wheat from the chaff.

This indicates how personal messages are so you can immediately see which messages are just for you and which are part of a long Cc. Stephen Perelgut showed me the feature in Lotus Notes and I wanted to steal it sometime, so I did it while waiting for the Instant Rails archive.

To use it, add %ur to your gnus-summary-line-format.

(add-to-list 'nnmail-extra-headers 'To)
(add-to-list 'nnmail-extra-headers 'Cc)
(defvar sacha/gnus-count-recipients-threshold 5
  "*Number of recipients to consider as large.")

(defun sacha/gnus-count-recipients (header)
  "Given a Gnus message header, returns priority mark.
If I am the only recipient, return \"!\".
If I am one of a few recipients, but I'm listed in To:, return \"*\".
If I am one of a few recipients, return \"/\".
If I am one of many recipients, return \".\".
Else, return \" \"."
  (let* ((to (or (cdr (assoc 'To (mail-header-extra header))) ""))
         (cc (or (cdr (assoc 'Cc (mail-header-extra header))) "")))
    (cond
     ((string-match gnus-ignored-from-addresses to)
      (let ((len (length (bbdb-split to ","))))
        (cond
         ((= len 1) "!")
         ((< len sacha/gnus-count-recipients-threshold) "*")
         (t "/"))))
     ((string-match gnus-ignored-from-addresses
                    (concat to ", " cc))
      (if (< (length (bbdb-split (concat to ", " cc) ","))
             sacha/gnus-count-recipients-threshold)
          "/"
        "."))
     (t " "))))

(defalias 'gnus-user-format-function-r 'sacha/gnus-count-recipients)

Random Emacs symbol: dired-listing-switches - Variable: *Switches passed to `ls' for Dired. MUST contain the `l' option.

On Technorati: , , ,

Short URL: http://sachachua.com/blog/p/3920

On This Day...

  • 2011: From the feeds: Saving money, making money, balancing life, reading books, and making rainbows — PassionSaving shares ten money-saving tips: focus on getting over the $100,000 hump (yay!), add income tax when you [...]
  • 2009: Weekly review: Week ending October 4, 2009 — From last week’s plans: Update the market scans for innovations and forces of change. Moved to a lower priority. Instead, working [...]
  • 2009: Seeing in three dimensions — The last few movies I’ve watched in an actual movie theatre have been in 3D. Whenever I see the opening [...]
  • 2008: New domain name: livinganawesomelife.com — I like having my name as my domain name. It makes sense, and it’s very searchable… if you can remember [...]
  • 2008: WordPress and lifestreaming – check out my draft firehose interface — Inspired by WordCamp Toronto (and the Flutter plugin in particular), I decided to spend some time figuring out if I [...]
  • 2008: — Attend WordCamp Cut out sewing patterns Set up my blog as a tumblelog/lifestream without overwhelming people
  • 2008: Firehose
  • 2008: Notes from WordCamp — wordcamptoronto on Twitter #wpto08, #wcto08, which one? Joseph Thornley search.twitter.com sociology + technology RSS changed it from pastime to productivity tool Magazine analogy – doesn’t make [...]
  • 2007: Time to exercise — Day 2. So far, so good. I did another fifteen minutes of core exercises today: five minutes of crunches, five minutes [...]
  • 2007: PostReach’s ClickComment — I’ve just added Postreach to my blog. That’s the row of little icons that shows up on my website. If [...]
  • 2007: Sorted out Emacs problem — I compiled Emacs from CVS yesterday, badly breaking it in X11. It would die horribly in a segmentation fault whenever [...]
  • 2006: Developing a better sense of time — One of the things I want to do is develop a good sense of how long it takes me to do [...]
  • 2005: Humorous speech — Whoa, went way out of my comfort zone there. Giving in to social pressure, I volunteered to do a humorous speech [...]
  • 2004: Osaka accommodations — Might be a good idea to get an international youth hostel association card. Offices: Place Address Tel Fax Japan Youth Hostels, Inc Suidobashi Nishiguchi Kaikan 2-20-7 Misaki-cho [...]
  • 2004: Haiku — We took up haiku in class today, just for fun. I wrote a lot. =) Then just for kicks, I translated [...]
  • 2003: best practices of e-commerce for farmers — This is actually a pretty cool project… Wow!
  • 2003: http://www.B2BPriceNow.com — B2B R3 RICE B2B R6 SUGAR Send to 2333 for Globe subscribers 211 for Smart subscribers
  • 2003: Wearable notes — Medical transcription, wearables, taking notes

Get the highlights as a PDF!

Stories from my Twenties: Highlights from a Decade of Blogging