6197 comments
2357 subscribers
Follow me on Twitter (@sachac)
Subscribe! Feed reader E-mail

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: , , ,

Random Emacs symbol: sort-coding-systems-predicate – Variable: If non-nil, a predicate function to sort coding systems.

Short URL: http://sachachua.com/blog/p/3904
  • http://trey-jackson.blogspot.com Trey Jackson

    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…

On This Day...

  • 2012: Toolmaking — My first full day back at consulting after a month-long vacation, and it felt great. I started digging into the [...]
  • 2011: Weekly review: Week ending September 30, 2011 — Lots of scrambling, but we’re through! From last week’s plans Work [X] Add summary to project T [-] Migrate [...]
  • 2010: Married! — Married!
  • 2008: Gen Y Perspective: Why Gen Y Won’t Stay at Jobs that Suck — In yesterday’s talk by Bea Fields on managing Gen Y, one of the listeners asked how much of a fun [...]
  • 2007: okay, so what’s involved in this trapeze thing? — i like watching the other students. i would like to be able to do the kinds of stuff they do, someday. [...]
  • 2007: Can’t type — my palms are wide awake and revolting. just came back from trapeze lessons. lots of fun. have a long way to [...]
  • 2007: Switched to PCFinancial for savings — I sent a void check to PCFinancial to set up a link between PCFinancial and TD. I followed up on the [...]
  • 2007: Emacs and Google Calendar; writing for a moving target — While searching for Emacs calendar sync, I came across Bill Clementson’s post on Emacs and Google Calendars. He showed how [...]
  • 2007: planner-appt — Now that I’ve taken a closer look at it, I can see that planner-appt’s much cooler than the little hacks I’d [...]
  • 2006: So many resources! — Every so often, I just stop and wonder what I’ve been doing with my time. This usually happens when I go [...]
  • 2006: 43folders blogger and GTD guru Merlin Mann in Toronto tomorrow — Merlin Mann of 43Folders and uber-cool GTD/productivity lifehacking will be in town for a podcast tomorrow (Tuesday). http://upcoming.org/event/111696/ I will probably not be [...]
  • 2006: Must be a better way to reserve books at the library — I’m going on another reading spree, this time on relationship marketing. At some point in time, I will be annoyed enough to [...]
  • 2006: Crazy idea for Emacs: Random Emacs taglines — Would anyone happen to know of a way to select a random symbol with a description? Actually. Hmm. (progn (apropos ".") [...]
  • 2006: Sweet! The Peer Review: Graduate Studies and Academic Life — I opened my mailbox to find a small publication called “The Peer Review: Graduate Studies and Academic Life.” The cover [...]
  • 2006: Also of note: East West Books — I picked up a pretty set of postcards from East West Books in New York City (78 Fifth Avenue at [...]
  • 2006: Places to eat in New York City — Things to remember next time I’m in New York: Jim Suto highly recommends Little Lad’s Restaurant and Cafe, which has a [...]
  • 2006: Poetry — One of our friends blogs poetry between stories of his work. It’s always interesting reading, although you wonder sometimes if [...]
  • 2006: Life! — Since childhood, I have had a gift for working with computers. For a while, this seemed like the perfect fit for [...]
  • 2006: Compassion — I am also very, very lucky to have people who remind me that this experience of great love is not yet [...]
  • 2006: Reaching out and being human — Most of the time, I’m on the top of the world. People wonder where I get the energy to be so [...]
  • 2006: Waking up with wonder — I’ve figured out a great way to start my day. I love waking up to the alarm on my cellphone, hitting [...]
  • 2006: Little joys — On the way back from Simon’s place last night, I took a streetcar with a wonderful surprise. The streetcar driver sang [...]
  • 2004: Today — We reviewed all the grammatical structures taken up over the last 25 chapters. I found grammar easy to remember. I think [...]
  • 2004: I wonder what this means — plannerのPlansディレクトリを無理やりWikiと合わせた。こんなことしていいのか 、わからないけど、まあいいか。 Planner’s Plans directory has been forcibly combined with Wiki. I’m not sure if this is a good thing. I guess it’s [...]
  • 2003: Head First Java
  • 2003: 20 Questions — Gino says: I gave this as an exercise to my CS119.2 class. Too bad I couldn’t stretch it too much because it’s [...]