projects
/
lml.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r3926: Auto commit for Debian build
[lml.git]
/
base.lisp
diff --git
a/base.lisp
b/base.lisp
index feca6b151a1f79dc54e24e938d1de29546bf515f..577622cc0c70c367ea3d472a2ed1741fe6c74623 100644
(file)
--- a/
base.lisp
+++ b/
base.lisp
@@
-7,7
+7,7
@@
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Aug 2002
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Aug 2002
;;;;
-;;;; $Id: base.lisp,v 1.
4 2003/01/14 08:41:22
kevin Exp $
+;;;; $Id: base.lisp,v 1.
6 2003/01/26 21:35:27
kevin Exp $
;;;;
;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;;
;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
@@
-33,7
+33,7
@@
(defun reset-indent ()
(setq *indent* 0))
(defun reset-indent ()
(setq *indent* 0))
-(defun lml-
prin
t (str &rest args)
+(defun lml-
forma
t (str &rest args)
(when (streamp *html-output*)
(when *print-spaces* (indent-spaces *indent* *html-output*))
(if args
(when (streamp *html-output*)
(when *print-spaces* (indent-spaces *indent* *html-output*))
(if args
@@
-42,11
+42,17
@@
(when *print-spaces* (format *html-output* "~%"))
(values)))
(when *print-spaces* (format *html-output* "~%"))
(values)))
-(defmacro lml-line (str &rest args)
- `(lml-print ,str ,@args))
+(defun lml-princ (s)
+ (princ s *html-output*))
+
+(defun lml-print (s)
+ (format *html-output* "~A~%" s))
+
+(defun lml-write-char (char)
+ (write-char char *html-output))
(defun lml-print-date (date)
(defun lml-print-date (date)
- (lml-prin
t
(date-string date)))
+ (lml-prin
c
(date-string date)))
(defmacro lml-exec-body (&body forms)
`(progn
(defmacro lml-exec-body (&body forms)
`(progn
@@
-54,12
+60,12
@@
#'(lambda (form)
(etypecase form
(string
#'(lambda (form)
(etypecase form
(string
- `(lml-prin
t
,form))
+ `(lml-prin
c
,form))
(number
(number
- `(lml-
prin
t "~D" ,form))
+ `(lml-
forma
t "~D" ,form))
(symbol
(when form
(symbol
(when form
- `(lml-prin
t
,form)))
+ `(lml-prin
c
,form)))
(cons
form)))
forms)))
(cons
form)))
forms)))
@@
-67,19
+73,19
@@
(defmacro with-attr-string (tag attr-string &body body)
(let ((attr (gensym)))
`(let ((,attr ,attr-string))
(defmacro with-attr-string (tag attr-string &body body)
(let ((attr (gensym)))
`(let ((,attr ,attr-string))
- (lml-
prin
t "<~(~A~)~A>" ',tag
+ (lml-
forma
t "<~(~A~)~A>" ',tag
(if (and (stringp ,attr) (plusp (length ,attr)))
(format nil "~A" ,attr)
""))
(incf *indent*)
(lml-exec-body ,@body)
(decf *indent*)
(if (and (stringp ,attr) (plusp (length ,attr)))
(format nil "~A" ,attr)
""))
(incf *indent*)
(lml-exec-body ,@body)
(decf *indent*)
- (lml-
prin
t "</~(~A~)>" ',tag))))
+ (lml-
forma
t "</~(~A~)>" ',tag))))
(defmacro with-no-endtag-attr-string (tag attr-string)
(let ((attr (gensym)))
`(let ((,attr ,attr-string))
(defmacro with-no-endtag-attr-string (tag attr-string)
(let ((attr (gensym)))
`(let ((,attr ,attr-string))
- (lml-
prin
t "<~(~A~)~A />" ',tag
+ (lml-
forma
t "<~(~A~)~A />" ',tag
(if (and (stringp ,attr) (plusp (length ,attr)))
(format nil "~A" ,attr)
"")))))
(if (and (stringp ,attr) (plusp (length ,attr)))
(format nil "~A" ,attr)
"")))))
@@
-180,8
+186,8
@@
(defmacro xhtml-prologue ()
`(progn
(defmacro xhtml-prologue ()
`(progn
- (lml-
prin
t "~A~%" (xml-prologue-string))
- (lml-
prin
t "~A~%" (xhtml-prologue-string))))
+ (lml-
forma
t "~A~%" (xml-prologue-string))
+ (lml-
forma
t "~A~%" (xhtml-prologue-string))))
(defmacro link (dest &body body)
`(with a :href ,dest ,@body))
(defmacro link (dest &body body)
`(with a :href ,dest ,@body))
@@
-222,8
+228,8
@@
(eval-when (:compile-toplevel :load-toplevel :execute)
(defparameter *macro-list*
(eval-when (:compile-toplevel :load-toplevel :execute)
(defparameter *macro-list*
- '(a div span h1 h2 h3 h4 h5 h6 i b p li ul ol table tbody td tr body head
- html title pre tt u dl dt dd kbd code form))
+ '(a div span h1 h2 h3 h4 h5 h6 i b p li ul ol table tbody td t
h t
r body head
+ html title pre tt u dl dt dd kbd code form
textarea
))
(export '(link link-c br hr img input meta meta-key))
(export *macro-list*))
(export '(link link-c br hr img input meta meta-key))
(export *macro-list*))
@@
-267,7
+273,7
@@
#+cmu
(setf curr-string (coerce curr-string `(simple-array character (*))))
#+cmu
(setf curr-string (coerce curr-string `(simple-array character (*))))
- (push `(lml-prin
t
,curr-string) forms)
+ (push `(lml-prin
c
,curr-string) forms)
(setq curr-string (new-string))
(setq got-comma nil)
(vector-push #\( curr-string)
(setq curr-string (new-string))
(setq got-comma nil)
(vector-push #\( curr-string)
@@
-288,7
+294,7
@@
(push
`(let ((,res ,eval-string))
(when ,res
(push
`(let ((,res ,eval-string))
(when ,res
- (lml-prin
t
,res)))
+ (lml-prin
c
,res)))
forms))
(setq curr-string (new-string)))
;; read comma, then non #\( char
forms))
(setq curr-string (new-string)))
;; read comma, then non #\( char
@@
-307,7
+313,7
@@
#+cmu
(setf curr-string (coerce curr-string `(simple-array character (*))))
#+cmu
(setf curr-string (coerce curr-string `(simple-array character (*))))
- (push `(lml-prin
t
,curr-string) forms)
+ (push `(lml-prin
c
,curr-string) forms)
`(progn ,@(nreverse forms)))))
`(progn ,@(nreverse forms)))))