diff options
Diffstat (limited to '')
-rwxr-xr-x | code.scm | 4 | ||||
-rw-r--r-- | guile_interface.scm.c | 11 |
2 files changed, 9 insertions, 6 deletions
@@ -18,8 +18,8 @@ (for-each (lambda (ev) (vcomponent-set-attribute! ev "DTSTART" - (map (cut string->date <> "~Y~m~dT~H~M~S") - (vcomponent-get-attribute ev "DTSTART")))) + ((cut string->date <> "~Y~m~dT~H~M~S") + (vcomponent-get-attribute ev "DTSTART")))) (vcomponent-children cal)) (display (vcomponent-get-attribute (car (vcomponent-children cal)) diff --git a/guile_interface.scm.c b/guile_interface.scm.c index fa4f2f5f..725d16e6 100644 --- a/guile_interface.scm.c +++ b/guile_interface.scm.c @@ -47,12 +47,17 @@ SCM_DEFINE (vcomponent_get_attribute, "vcomponent-get-attribute", 2, 0, 0, if (c == NULL) return SCM_BOOL_F; - // TODO returns the car of list if list is one long. SCM llist = SCM_EOL; FOR (LLIST, content_set, v, &c->val) { llist = scm_cons(scm_from_strbuf(&v->key), llist); } - return llist; + + /* returns the car of list if list is one long. */ + if (scm_to_int(scm_length(llist)) == 1) { + return SCM_CAR(llist); + } else { + return llist; + } } SCM_DEFINE (vcomponent_set_attr_x, "vcomponent-set-attribute!", 3, 0, 0, @@ -66,8 +71,6 @@ SCM_DEFINE (vcomponent_set_attr_x, "vcomponent-set-attribute!", 3, 0, 0, content_line* c = get_property (com, key); free(key); - // TODO if list is a value store it as is, else wrap it in a list - // of length one. scm_gc_unprotect_object(c->val.cur->value->key.scm); c->val.cur->value->key.scm = new_value; scm_gc_protect_object(c->val.cur->value->key.scm); |