5065 comments
2219 subscribers
4799 on Twitter
Subscribe! Feed reader E-mail

flashcard-import-from-kill

The following code snippet makes it easier for me to import segments
from my dictionary files. It uses ../emacs/flashcard.el.

(defun flashcard-import-from-kill (deck)
  "Import cards for DECK from the clipboard, which should be colon-separated.

Question : Answer"
  (interactive (list flashcard-deck))
  (unless (eq major-mode 'flashcard-mode)
    (error "You're not in a deckfile."))
  (with-temp-buffer
    (yank)
    (goto-char (point-min))
    (while (re-search-forward "^ *\\(.*\\) +: +\\(.*\\)$" nil t)
      (flashcard-add-card deck
                          (flashcard-make-card (match-string 1)
                                               (match-string 2)))))
  (when (and (interactive-p)
             (not flashcard-card))
    (flashcard-ask)))

../emacs/flashcard-config.el

On Technorati:

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

Comment, share a thought, ask a question...

Please comment as you, not your organization.





 

On This Day...

  • 2012: Thinking about how to experiment with business and what I might want to do — “So, what are you going to do?” That’s always what people ask after I tell them that I’m leaving IBM [...]
  • 2010: Learning more about interviewing — David Ing let me tag along on a client interview for a Smarter Cities engagement. He and Donald Seymour interviewed [...]
  • 2009: LifeCampTO social graph — After LifeCampTO, I asked people to give me the list of people they wanted to talk to (or, well, those [...]
  • 2008: Testing from Emacs — I’m using weblogger.el and xml-rpc.el to post directly to my WordPress. I wonder how well it works… Sorry about the RSS thrashing! [...]
  • 2007: At the Hong Kong International Airport — I’m at the HKIA. I’ve snagged a sleep pillow from one of the airport shops. I couldn’t find a buckwheat lavender-scented [...]
  • 2007: All my bags are packed — Props to my mom for mad repacking skills which allowed us to cram even more dried mangoes into my luggage. Random Emacs [...]
  • 2006: MIE1407F results — … although my day isn’t all _that_ bad. I just got my results back from MIE1407: Engineering Psychology and Human [...]
  • 2006: Gave a talk at Toronto Interacts — I was part of a panel on transitioning to AJAX (Asynchronous Javascript and XML) hosted by the Toronto Interacts society for usability [...]
  • 2005: Mob? — Sean Uy wrote: Congratulations, everyone. We put a stop to an issue that ‘insulted’ the dignity of women in the IT industry. And [...]
  • 2005: My answers to [[http://home.uchicago.edu/~alexis/ostan.htm][Which OStan are you?]] — You are Linux. You’re not as well known as the others, but you have a devoted following bordering on [...]
  • 2005: PCS cancels Digital Pinay contest, cites violent reactions — Check out Philippine Computer Society cancels ‘Digital Pinay’ tilt for PCS’ announcement. Asked what he has learned from the experience, Querubin [...]
  • 2004: Miguel Paraz on Livejournal — Miguel Paraz has a new blog on http://www.livejournal.com/users/mparaz/ . http://www.mparaz.com/wordpress/ still has some notes.
  • 2004: More geek personality tests — http://www.innergeek.us/geek.html
  • 2004: Old computers — http://www.old-computers.com E-Mail from Dominique Cimafranca
  • 2004: Jerome topped the JITSE! — (Unofficially) topped the exams :-P. Got the word from the JITSE trainor Amil’s talking to re training. Amil’s 3rd, so we’re figuring [...]