From 5bee16635e465c11fd695ae04e5248d652abfff0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtes Date: Thu, 26 Jul 2007 15:28:37 +0000 Subject: `outline' reader: Fixed `append-trees'. * src/guile/skribilo/reader/outline.scm (append-trees): Make sure only symbols can appear as the head of the resulting list. git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-139 --- ChangeLog | 17 +++++++++++++++++ src/guile/skribilo/reader/outline.scm | 20 +++++++++++++------- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0f77ede..b9891f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,23 @@ # arch-tag: automatic-ChangeLog--skribilo@sv.gnu.org--2006/skribilo--devo--1.2 # +2007-07-26 15:28:37 GMT Ludovic Courtes patch-139 + + Summary: + `outline' reader: Fixed `append-trees'. + Revision: + skribilo--devo--1.2--patch-139 + + * src/guile/skribilo/reader/outline.scm (append-trees): Make sure only + symbols can appear as the head of the resulting list. + + modified files: + ChangeLog src/guile/skribilo/reader/outline.scm + + new patches: + lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2--patch-123 + + 2007-07-18 06:50:29 GMT Ludovic Courtes patch-138 Summary: diff --git a/src/guile/skribilo/reader/outline.scm b/src/guile/skribilo/reader/outline.scm index 7411892..1e64d01 100644 --- a/src/guile/skribilo/reader/outline.scm +++ b/src/guile/skribilo/reader/outline.scm @@ -83,15 +83,21 @@ equal to @var{name}, a markup name." (let loop ((trees trees) (result '())) (if (null? trees) - result + (let ((result (reverse! result))) + (cond ((and (pair? result) + (not (symbol? (car result)))) + ;; Make sure only symbols end up in the head. + (cons 'list result)) + (else + result))) (let ((tree (car trees))) (loop (cdr trees) - (append result - (if (list? tree) - (cond ((null? tree) '()) - ((symbol? (car tree)) (list tree)) - (else tree)) - (list tree)))))))) + (append (if (list? tree) + (cond ((null? tree) '()) + ((symbol? (car tree)) (list tree)) + (else tree)) + (list tree)) + result)))))) (define (null-string? s) (and (string? s) (string=? s ""))) -- cgit v1.2.3