Crazy Emacs: Personalized signatures with random taglines
Of course, that naturally leads to the crazy idea: "What if I can personalize my signatures?" Knowing that Paul Lussier is an Emacs geek, I can reward him for reading all the way to the bottom of my message... ;)
(defun sacha/gnus-personalize-signature ()
"Personalizes signature based on BBDB signature field.
BBDB signature field should be a lambda expression.
First person with a custom signature field gets used."
(let* ((bbdb-get-addresses-headers
(list (assoc 'recipients bbdb-get-addresses-headers)))
(records (bbdb-update-records
(bbdb-get-addresses
nil
gnus-ignored-from-addresses 'gnus-fetch-field)
nil
nil))
signature)
(while (and records (not signature))
(when (bbdb-record-getprop (car records) 'signature)
(setq signature
(eval (read (bbdb-record-getprop (car records)
'signature)))))
(setq records (cdr records)))
(or signature t)))
(setq-default message-signature 'sacha/gnus-personalize-signature)
So then all I have to do is add the following field to his record:
signature: (concat "Sacha Chua - Emacs geek
What crazy idea can I help you hack next?
Random Emacs symbol: "
(sacha/random-tagline
"~/.taglines.random-emacs-symbols"))
Emacs. One crazy idea at a time. Now I can use this to select random information, like my favorite networking books or a list of my upcoming events...
On Technorati: emacs, bbdb, elisp, hack
Random Emacs symbol: sort-coding-systems-predicate - Variable: If non-nil, a predicate function to sort coding systems.
Save to - del.icio.us - Digg it - reddit - StumbleUpon
Interesting idea. I tried using BBDB once (not for signatures), but it didn't work as expected, so I dropped it.
With respect to doing this kind of integration (BBDB and fortune-style delimiters), that's interesting. I'd probably look at something like that if I were actively developing it for sure. The only catch I see with the fortune delimiters is that sig-quote needs a way to group the quotes together. Perhaps it could be changed to be a directory, with one file per quote (fortune delimited). Hmmm…