r5371: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 21 Jul 2003 16:36:22 +0000 (16:36 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 21 Jul 2003 16:36:22 +0000 (16:36 +0000)
debian/changelog
htmlgen.lisp

index 47a8376905192c133c676bf666646e4cd6c2e470..c8f40078dc76b5439ff07ee06a4c9a41576979bd 100644 (file)
@@ -1,3 +1,9 @@
+cl-lml2 (1.4-1) unstable; urgency=low
+
+  * Add code walker to collapse sequential constant strings
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Mon, 21 Jul 2003 10:31:40 -0600
+
 cl-lml2 (1.3-1) unstable; urgency=low
 
   * New upstream
index ade02768dcec83f390dd072151da943b6fa236d7..b920ec0e8baf953b19b96db5fe83c3ccd9831b01 100644 (file)
@@ -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
   )
 
 (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)))
     (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)