X-Git-Url: http://git.kpe.io/?p=lml.git;a=blobdiff_plain;f=files.lisp;h=0194ba6592a763a0d930773a2b7e338fc037a603;hp=fe3c4261a85004f4cd08d6245e728127ed979af5;hb=5da5fb17e3c3e1c3a2fa289666e0f50dc3b223c4;hpb=f87e11ae126e3cb6ef60c0d0da93f9afdcd6e1f6 diff --git a/files.lisp b/files.lisp index fe3c426..0194ba6 100644 --- a/files.lisp +++ b/files.lisp @@ -33,19 +33,19 @@ (setq f (concatenate 'string f ".html")))) (if *sources-dir* (make-pathname :defaults (ecase type - (:source *sources-dir*) - (:output *output-dir*)) - :name (pathname-name f) - :type (pathname-type f)) + (:source *sources-dir*) + (:output *output-dir*)) + :name (pathname-name f) + :type (pathname-type f)) (if (stringp f) - (nth-value 0 (parse-namestring f)) - f))) + (nth-value 0 (parse-namestring f)) + f))) (defmacro with-dir ((output &key sources) &body body) (let ((output-dir (gensym)) - (sources-dir (gensym))) + (sources-dir (gensym))) `(let ((,output-dir ,output) - (,sources-dir ,sources)) + (,sources-dir ,sources)) (when (stringp ,output-dir) (setq ,output-dir (parse-namestring ,output-dir))) (when (stringp ,sources-dir) @@ -53,26 +53,26 @@ (unless ,sources-dir (setq ,sources-dir ,output-dir)) (let ((*output-dir* ,output-dir) - (*sources-dir* ,sources-dir)) + (*sources-dir* ,sources-dir)) ,@body)))) (defun lml-load-path (file) (if (probe-file file) (with-open-file (in file :direction :input) (do ((form (read in nil 'eof) (read in nil 'eof))) - ((eq form 'eof)) - (eval form))) + ((eq form 'eof)) + (eval form))) (format *trace-output* "Warning: unable to load LML file ~S" file))) (defun process-dir (dir &key sources) (with-dir (dir :sources sources) (let ((lml-files (directory - (make-pathname :defaults *sources-dir* - :name :wild - :type "lml")))) + (make-pathname :defaults *sources-dir* + :name :wild + :type "lml")))) (dolist (file lml-files) - (format *trace-output* "~&; Processing ~A~%" file) - (lml-load-path file))))) + (format *trace-output* "~&; Processing ~A~%" file) + (lml-load-path file))))) (defun lml-load (file) (lml-load-path (eval `(lml-file-name ,file :source))))