Christophe Weblog Wiki Code Publications Music
fix preset-handling code on emacs24
[iplayer-el.git] / iplayer.el
index a27450b6da1250ab823320641887dceb5dcd15ab..b134ccf6be43c4554cc180ab9a02a151fc186cb5 100644 (file)
 
 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))))