2012-06-06

euro 2012 games in your org-mode agenda

Things have been rather quiet at emacs-fu - reason for this is that most of my emacs hacking time has been spent on mu4e, the emacs e-mail client I wrote. It's been shaping up pretty nicely, I should probably write some emacs-fu posts about it :)

Another interesting pastime (esp. in Europe) is football/soccer, in particular the Euro2012 games; long-time readers will remember the schedule for world cup games; I made a new one for Euro2012: https://github.com/djcb/org-euro2012.

In order to have the games show up in your agenda, make sure the file is in your org-agenda-files. If needed, you could add it with something like this in your org-mode settings (change the directory path to wherever you have put euro2012.org):

(add-to-list 'org-agenda-files "~/org/euro2012.org")

One small issue with the schedule is that it uses the central-european summer time (UTC+2), and there is no automatic way to adjust times for the local time zone. As a work-around, Juan Pechiar provided the following function which makes it easy to update all org-timestamps in a file:

(defun update-org-hours (n)
  "Change all org-mode timestamps in the current buffer by N hours."
  (interactive "nAdd hours: ")
  (save-excursion
    (goto-char (point-min))
    (while (re-search-forward "[[<]" nil t)
      (when (org-at-timestamp-p t)
        (org-timestamp-change n 'hour)))))

Evaluate this function. After that, you can go to the file with the schedule, and give an M-x update-org-hours, provide the offset for your timezone, compared to UTC+2.

Let the games begin!

6 comments:

Rafael said...

Thanks, this is a good complement to FootieFox (addon for Firefox).

Oleg said...

Nice idea and thanks for sharing!

I had a problem with 'update-org-hours'. It seems that the timestamps are not in the format that it expects (day of the week is missing). Because of that, it messes up the timestamps for me.

Neto said...

Interesting idea. I made a mess of myself the first few times when I saw local times (Ukraine and Poland's time differ by 1 hour).

I'm mainly a vim guy at the moment but I want to give emacs a try some day. I specially like it's ability to use lisp (of which I know only a little).

So, on my next vacations, after I'm really comfortable with touchtyping, I'm picking a boof of lisp and some good emacs tutorials and I'll see how it goes.

This might look a bit spammy but If you're looking for a Euro Cup predictor to compete with friends this is pretty cool (xls file and simple explanation in post):
http://www.bay12forums.com/smf/index.php?topic=109977.0

Anonymous said...

Please write about your new emacs mua and if you do please compare them to the existing vm, mew, wanderlust and gnus?

sergio said...

Sorry about the Netherlands Dirk :/

djcb said...

@Sergio: :-/ good luck to Spain!