X-Git-Url: http://git.kpe.io/?p=lml2.git;a=blobdiff_plain;f=htmlgen.lisp;h=b920ec0e8baf953b19b96db5fe83c3ccd9831b01;hp=ade02768dcec83f390dd072151da943b6fa236d7;hb=9301f992fc419b10953de8fd2075099c00b90d0e;hpb=6ec49bfd3b5c1d91421258e9452ce38f99f49681 diff --git a/htmlgen.lisp b/htmlgen.lisp index ade0276..b920ec0 100644 --- a/htmlgen.lisp +++ b/htmlgen.lisp @@ -1,6 +1,6 @@ ;; -*- mode: common-lisp; package: lml2 -*- ;; -;; $Id: htmlgen.lisp,v 1.17 2003/07/21 16:20:47 kevin Exp $ +;; $Id: htmlgen.lisp,v 1.18 2003/07/21 16:36:22 kevin Exp $ ;; ;; copyright (c) 1986-2000 Franz Inc, Berkeley, CA ;; copyright (c) 2003 Kevin Rosenberg @@ -44,15 +44,11 @@ ) (defmacro html (&rest forms &environment env) - ;; just emit html to the current stream - ;;(process-html-forms forms env) - (post-process-html-forms - (process-html-forms forms env)) - ) + (process-html-forms forms env))) (defun post-process-html-forms (input-forms) - "KMR: Walk through forms and combining write-strings" + "KMR: Walk through forms and combine write-strings" (let (res strs last-stream) (flet ((flush-strings () (when strs @@ -70,7 +66,8 @@ (push form res)) (t (cond - ((eq (car form) 'cl:write-string) + ((and (eq (car form) 'cl:write-string) + (stringp (cadr form))) (if strs (if (eq last-stream (third form)) (setq strs (concatenate 'string strs (second form))) @@ -889,9 +886,11 @@ (named-function html-write-string-function (lambda (ent args argsp body) (declare (ignore ent args argsp)) - `(progn ,@(mapcar #'(lambda (bod) - `(write-string ,bod *html-stream*)) - body)))) + (if (= (length body) 1) + `(write-string ,(car body) *html-stream*) + `(progn ,@(mapcar #'(lambda (bod) + `(write-string ,bod *html-stream*)) + body))))) (named-function html-write-string-print-function (lambda (ent cmd args form subst unknown stream)