X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=files.lisp;h=9c5dd2ed95906fb91ceb6749a3d62df9e59fc997;hb=d939ce3d13a5a43ca21d8b34d7ecfd1462a34980;hp=a3dbf6ee34fee826e1df9c29d77bdf1ac6907f09;hpb=733ea685ca7cdeeefbd5494954b308b9dbe51846;p=lml2.git diff --git a/files.lisp b/files.lisp index a3dbf6e..9c5dd2e 100644 --- a/files.lisp +++ b/files.lisp @@ -27,7 +27,8 @@ (when (stringp f) (unless (position #\. f) (setq f (concatenate 'string f ".html")))) - (if *sources-dir* + (if (or (and (eq type :source) *sources-dir*) + (and (eq type :output) *output-dir*)) (merge-pathnames (make-pathname :name (pathname-name f) :type (pathname-type f) @@ -54,13 +55,14 @@ (*sources-dir* ,sources-dir)) ,@body)))) -(defun lml-load-path (file) +(defun lml-load-path (file &key optional) (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))) - (format *trace-output* "Warning: unable to load LML file ~S" file))) + (unless optional + (format *trace-output* "Warning: unable to load LML file ~S" file)))) (defun process-dir (dir &key sources) (with-dir (dir :sources sources) @@ -72,8 +74,8 @@ (format *trace-output* "~&; Processing ~A~%" file) (lml-load-path file))))) -(defun lml-load (file) - (lml-load-path (eval `(lml-file-name ,file :source)))) +(defun lml-load (file &key optional) + (lml-load-path (eval `(lml-file-name ,file :source)) :optional optional)) (defun insert-file (file) (print-file-contents file *html-stream*))