Created
April 9, 2010 18:25
-
-
Save death/361435 to your computer and use it in GitHub Desktop.
mingus-bind-plist patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 9af6a8a4a9b64875ec17a128539f5c5f1ef8f2b9 | |
Author: death <death@nessers.org> | |
Date: Fri Apr 9 21:23:41 2010 +0300 | |
a working solution for the unexpected tags problem | |
The previous version dropped the variables for unexpected | |
tags, but not their values. | |
diff --git a/mingus.el b/mingus.el | |
index 84a296f..2f25069 100644 | |
--- a/mingus.el | |
+++ b/mingus.el | |
@@ -1757,15 +1757,15 @@ see function `mingus-help' for instructions. | |
(defmacro mingus-bind-plist (plist &rest body) | |
"Execute BODY with KEYS from PLIST bound to VALUES; downcase KEYS in the act." | |
(let* ((plist (eval plist))) | |
- `(multiple-value-bind | |
- ,(loop for i in plist by #'cddr | |
- ;; or: use simply intern (e.g. MUSIC_BRAINZ tags won't come through now) | |
- when | |
- (intern-soft (downcase (symbol-name i))) | |
- collect | |
- (intern-soft (downcase (symbol-name i)))) | |
- (quote ,(loop for i in (cdr plist) by #'cddr collect i)) | |
- ,@body))) | |
+ (multiple-value-bind (key-vars values) | |
+ (loop for (key value) on plist by #'cddr | |
+ for key-var = (intern-soft (downcase (symbol-name key))) | |
+ when key-var | |
+ collect key-var into key-vars | |
+ and collect value into values | |
+ finally (return (values key-vars values))) | |
+ `(multiple-value-bind ,key-vars ',values | |
+ ,@body)))) | |
(defun mingus-make-status-string () | |
"Make status string of elapsed time, volume, repeat and random status etc." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment