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

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 ".")
  (write-file "~/.taglines.random-emacs-symbols")
  (delete-matching-lines "Plist")
  (delete-matching-lines "not documented")
  (replace-regexp "\n  " " - " nil)
  (delete-non-matching-lines " - "))

Et voila! Random Emacs taglines together with the code:

(defun sacha/random-tagline (&optional file)
  "Return a random tagline and put it in the kill ring."
  (interactive)
  (with-current-buffer (find-file-noselect (or file "~/.taglines"))
    (goto-char (random (point-max)))
    (let ((string
           (buffer-substring (line-beginning-position)
                             (line-end-position))))
      (kill-new string)
      string)))

(defadvice remember (after sacha-tagline activate)
  "Add random tagline."
  (save-excursion
  (goto-char (point-max))
  (insert "\n\nRandom Emacs symbol: "
          (sacha/random-tagline "~/.taglines.random-emacs-symbols")
          "\n\n")))))

On Technorati: , ,

Random Emacs symbol: eshell-remove-entries – Function: From PATH, remove all of the given FILES, perhaps interactively.

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

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 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 [...]
  • 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 [...]