diff options
Diffstat (limited to 'gnu/home-services/xdg.scm')
-rw-r--r-- | gnu/home-services/xdg.scm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gnu/home-services/xdg.scm b/gnu/home-services/xdg.scm index 457ce999a1..94275f3b65 100644 --- a/gnu/home-services/xdg.scm +++ b/gnu/home-services/xdg.scm @@ -287,9 +287,9 @@ The value of an XDG MIME entry must be a list, string or symbol, was given ~a") @example (merge-duplicates '((key1 . value1) - (key2 . value2) - (key1 . value3) - (key1 . value4)) '()) + (key2 . value2) + (key1 . value3) + (key1 . value4)) '()) @result{} ((key1 . (value4 value3 value1)) (key2 . value2)) @end example" @@ -299,14 +299,16 @@ The value of an XDG MIME entry must be a list, string or symbol, was given ~a") (tail (cdr alist)) (key (first head)) (value (cdr head)) - (duplicate? (assoc key acc))) + (duplicate? (assoc key acc)) + (ensure-list (lambda (x) + (if (list? x) x (list x))))) (if duplicate? ;; XXX: This will change the order of things, ;; though, it shouldn't be a problem for XDG MIME. (merge-duplicates tail (alist-cons key - (cons value (maybe-list (cdr duplicate?))) + (cons value (ensure-list (cdr duplicate?))) (alist-delete key acc))) (merge-duplicates tail (cons head acc))))))) |