Category Archives: gnus

That’s my dad!

Beauty is in eye of autistic youth –, Philippine News for Filipinos

He has come up with “the kind of shots that have eluded some of us, even with years of training,” said ace advertising photographer John Chua, who introduced Ian to his new hobby by chance.

That’s my dad – random acts of kindness turn into front-page news! =D

Faster mail with Emacs

I spent a few minutes getting offlineimap to synchronize my Gmail messages with dovecot, an IMAP server on my laptop. I also set up Gnus to work with the messages. Now I’m having fun speeding through my inbox. I don’t know why, but my text-based terminal seems a lot zippier and a lot easier to work with than Gmail… =)

I’m glad I’m back to doing my mail in Emacs!

Gnus multi-pane tricks, or I heart Planet Emacsen

The tips Joseph Miklojcik shared for reading e-mail in Gnus included this _really_ nifty thing that I hadn’t come across when I set up my Gnus before: multi-pane reading.

You know how modern news readers have a folder pane, a summary pane
and a preview pane?

Well, you can have that too.

   (horizontal 1.0
        (vertical 60 (group 1.0))
        (vertical 1.0
    (summary 0.20 point)
    (article 1.0)))))

   (horizontal 1.0
        (vertical 60 (group 1.0))
        (vertical 1.0 (summary 1.0 point)))))

This is good stuff. =)

On Technorati: ,

Random Emacs symbol: sacha/gnus-add-subject-to-bbdb-record – Function: Add datestamped subject note for each person this message has been sent to.

Contact report

I started tracking e-mail sent on 2006.09.01 with a
nifty piece of Emacs Lisp code I wrote just for the
purpose. Now I have two months of interesting data which include not
only e-mail but also the occasional in-person contact or phone call
that I remember to note. It’s not complete – e-mail’s the only thing
that gets automatically tracked – but it does give me interesting
information. Here’s the contact report for your amusement:

Contact report

It’s sorted by overall frequency and then by regular frequency.
Warning! Parentheses follow.

(defun sacha/count-matches (regexp string)
  (let ((count 0)
        (start 0))
    (while (string-match regexp string start)
      (setq start (match-end 0)
            count (1+ count)))

(defun sacha/bbdb-contact-report-as-alist (&rest regexps)
  "Creates a list of (name count-regexp1 count-regexp2 count-regexp3)..."
  (setq regexps (reverse regexps))
  (delq nil
         (lambda (rec)
           (when (bbdb-record-name (car rec))
             (let ((reg regexps)
                   (notes (bbdb-record-notes (car rec)))
               (while reg
                 (setq list (cons (sacha/count-matches (car reg) notes)
                 (setq reg (cdr reg)))
               (cons (sacha/planner-bbdb-annotation-from-bbdb rec)

(defun sacha/bbdb-alist-sort-by-total (alist)
  "Sort ALIST by total contact."
  (sort alist 'sacha/bbdb-contact-sort-predicate))

(defun sacha/bbdb-contact-sort-predicate (a b)
  (and a b
       (let ((count-a (apply '+ (cdr a)))
             (count-b (apply '+ (cdr b))))
          (> count-a count-b)
          (and (= count-a count-b)
               ;; If equal, look at the subtotal of the rest
               (sacha/bbdb-contact-sort-predicate (cdr a) (cdr b)))))))

(defun sacha/bbdb-kill-contact-barchart (alist)
  "Kill a barchart with the contact report for ALIST."
    (lambda (entry)
       (car entry)
       " | "
       (mapconcat (lambda (count)
                    (if (= count 0)
                        " "
                      (make-string count ?-)))
                  (cdr entry)
                  " | ")))

;; Usage: (sacha/bbdb-kill-contact-barchart
;;         (sacha/bbdb-alist-sort-by-total
;;          (sacha/bbdb-contact-report-as-alist "2006.09" "2006.10")))
;; Then yank (paste) this into another buffer

On Technorati: , , , ,

Random Emacs symbol: standard-display-cyrillic-translit – Command: Display a cyrillic buffer using a transliteration.

Keeping track of the age of messages

I can get pretty bad at responding to e-mail. This is an experiment to
see whether the negative reinforcement of seeing just how old a
message is will help me be more responsive. Either that, or I can
strive for a Mean Time Between Responses of whatever… ;)

Hmm, maybe I should combine this with my blog and start distinguishing
between E-mail to and Reply to…

(defadvice gnus-post-news (around sacha/gnus-track-message-age activate)
  "Insert a header showing how old a message is, to shame me into replying faster."
  ;; Before you post the news, figure out how old it is
  (let (days)
    (when article-buffer
      (setq days
            (- (time-to-days (current-time))
    (when days
      (goto-char (point-min))
      (when (re-search-forward "--text follows this line--" nil t)
        (forward-line 1)
        (insert "In reply to a message sent by "
                (mail-header-from message-reply-headers)
                " "
                 ((= days 0) "today")
                 ((= days 1) "yesterday")
                 (t (format "%d days ago" days)))
                ": \n\n")))))
(setq message-citation-line-function nil)

On Technorati: , ,

Random Emacs symbol: tramp-perl-directory-files-and-attributes – Variable: Perl script implementing `directory-files-attributes’ as Lisp `read’able

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))) "")))
     ((string-match gnus-ignored-from-addresses to)
      (let ((len (length (bbdb-split to ","))))
         ((= 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) ","))
     (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: , , ,