From: Christophe Rhodes Date: Tue, 25 Jun 2013 20:03:46 +0000 (+0100) Subject: fix preset-handling code on emacs24 X-Git-Tag: v0.1~9 X-Git-Url: http://christophe.rhodes.io/gitweb/?a=commitdiff_plain;h=ceba71290c00410efa51aeaaa543e2fa89a3cddc;p=iplayer-el.git fix preset-handling code on emacs24 only observable symptom was that £ for Radio 3 didn't work --- diff --git a/iplayer.el b/iplayer.el index a27450b..b134ccf 100644 --- a/iplayer.el +++ b/iplayer.el @@ -163,13 +163,19 @@ Used in the `iplayer-preset' command.") +(defun iplayer-frob-presets (presets) + (cond + ((version< emacs-version "24") + (mapcar (lambda (x) (cons (read-kbd-macro (car x)) (cdr x))) presets)) + (t presets))) + (define-iplayer-command iplayer-preset (&optional keys) "Switch display to a preset channel. The presets are defined in the variable `iplayer-presets'." (interactive) (let ((keys (or (and keys (concat keys)) (this-command-keys))) - (presets (mapcar (lambda (x) (cons (read-kbd-macro (car x)) (cdr x))) iplayer-presets))) + (presets (iplayer-frob-presets iplayer-presets))) (cond ((= (length keys) 1) (let ((channel (cdr (assoc keys presets))))