From: Kevin M. Rosenberg Date: Fri, 6 Jun 2003 21:59:30 +0000 (+0000) Subject: r5062: return from san diego X-Git-Tag: v2.5.5~94 X-Git-Url: http://git.kpe.io/?p=lml.git;a=commitdiff_plain;h=5151ac10e8472126199e05ff8e5ab382ecba3c68 r5062: return from san diego --- diff --git a/api.lisp b/api.lisp index eb584d4..6530189 100644 --- a/api.lisp +++ b/api.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg based on Matthew Danish's code ;;;; Date Started: Nov 2002 ;;;; -;;;; $Id: api.lisp,v 1.1 2002/11/08 06:00:12 kevin Exp $ +;;;; $Id: api.lisp,v 1.2 2003/06/06 21:59:30 kevin Exp $ ;;;; ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 2002 Matthew Danish @@ -17,8 +17,7 @@ ;;;; (http://www.gnu.org/licenses/gpl.html) ;;;; ************************************************************************* -(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) -(in-package :lml) +(in-package #:lml) ;;; Copyright (c) 2002 Matthew Danish. ;;; All rights reserved. diff --git a/base.lisp b/base.lisp index 2411ffd..5944405 100644 --- a/base.lisp +++ b/base.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: base.lisp,v 1.15 2003/05/26 14:53:33 kevin Exp $ +;;;; $Id: base.lisp,v 1.16 2003/06/06 21:59:30 kevin Exp $ ;;;; ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -16,8 +16,7 @@ ;;;; (http://www.gnu.org/licenses/gpl.html) ;;;; ************************************************************************* -(declaim (optimize (debug 3) (speed 3) (safety 3) (compilation-speed 0))) -(in-package :lml) +(in-package lml) (defun html4-prologue-string () "") diff --git a/downloads.lisp b/downloads.lisp index 8cd2e32..36f599c 100644 --- a/downloads.lisp +++ b/downloads.lisp @@ -2,12 +2,12 @@ ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; -;;;; Name: downloads.cl +;;;; Name: downloads.lisp ;;;; Purpose: Generate downloads page ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: downloads.lisp,v 1.8 2003/02/03 00:43:36 kevin Exp $ +;;;; $Id: downloads.lisp,v 1.9 2003/06/06 21:59:30 kevin Exp $ ;;;; ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -16,8 +16,7 @@ ;;;; (http://www.gnu.org/licenses/gpl.html) ;;;; ************************************************************************* -(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) -(in-package :lml) +(in-package lml) (defvar *dl-base*) @@ -70,7 +69,7 @@ (defun display-footer () (when *signed* (lml-princ "

GPG Public Key

") - (lml-princ "Use this key to verify file signtatures")) + (lml-princ "Use this key to verify file signtatures")) (lml-princ "")) (defun print-sect-title (title) @@ -79,40 +78,28 @@ (defun match-base-name? (name) (let ((len-base-name (length *base-name*))) (when (>= (length name) len-base-name) - (dotimes (i len-base-name) - (declare (fixnum i)) - (unless (char= (char *base-name* i) - (char name i)) - (return-from match-base-name? nil))))) - t) + (string= name *base-name* :end1 len-base-name :end2 len-base-name)))) (defun filter-against-base (files) - (let ((filtered '())) - (dolist (f files) - (let ((name (pathname-name f))) - (when (match-base-name? name) - (push f filtered)))) - (when filtered - (sort filtered #'(lambda (a b) (when (and a b) - (string< - (namestring a) - (namestring b)))))))) + (delete-if-not #'(lambda (f) (match-base-name? (pathname-name f))) files)) + +(defun sort-pathnames (list) + (sort list #'(lambda (a b) (string< (namestring a) (namestring b))))) (defun display-one-section (title pat) - (let ((files (filter-against-base (directory pat)))) + (let ((files (sort-pathnames (filter-against-base (directory pat))))) (when files (print-sect-title title) (lml-princ "
") (list-files files) (lml-princ "
")))) - (defun display-sections (sects) (when sects (let ((title (car sects)) (value (cadr sects))) (if (consp title) - (map nil #'display-sections sects) + (dolist (sect sects) (display-sections sect)) (if (consp value) (progn (print-sect-title title) diff --git a/files.lisp b/files.lisp index bdf4e96..cf1633f 100644 --- a/files.lisp +++ b/files.lisp @@ -14,8 +14,7 @@ ;;;; (http://www.gnu.org/licenses/gpl.html) ;;;; ************************************************************************* -(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) -(in-package :lml) +(in-package #:lml) (eval-when (:compile-toplevel :load-toplevel :execute) (defvar *output-dir* nil) @@ -61,8 +60,8 @@ (defun lml-load-path (file) (if (probe-file file) (with-open-file (in file :direction :input) - (do ((form (read in nil 'lml::eof) (read in nil 'lml::eof))) - ((eq form 'lml::eof)) + (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))) diff --git a/lml.asd b/lml.asd index ec28c2e..b07bcb0 100644 --- a/lml.asd +++ b/lml.asd @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: lml.asd,v 1.14 2003/04/19 03:56:40 kevin Exp $ +;;;; $Id: lml.asd,v 1.15 2003/06/06 21:59:30 kevin Exp $ ;;;; ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -16,12 +16,14 @@ ;;;; (http://www.gnu.org/licenses/gpl.html) ;;;; ************************************************************************* -(in-package :asdf) +(in-package #:cl-user) +(defpackage #:lml-system (:use #:asdf #:cl)) +(in-package #:lml-system) -(defsystem :lml - :name "cl-lml" +(defsystem lml + :name "lml" :author "Kevin M. Rosenberg " - :version "2.4.0" + :version "2.4" :maintainer "Kevin M. Rosenberg " :licence "GNU General Public License" :description "Lisp Markup Language" @@ -37,6 +39,6 @@ (:file "downloads" :depends-on ("base")) )) - - - +(defmethod perform ((o test-op) (c (eql (find-system 'lml)))) + (operate 'load-op 'lml-tests) + (operate 'test-op 'lml-tests)) diff --git a/package.lisp b/package.lisp index f919107..d3eae52 100644 --- a/package.lisp +++ b/package.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: package.lisp,v 1.5 2003/05/26 14:53:33 kevin Exp $ +;;;; $Id: package.lisp,v 1.6 2003/06/06 21:59:30 kevin Exp $ ;;;; ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -16,9 +16,9 @@ ;;;; (http://www.gnu.org/licenses/gpl.html) ;;;; ************************************************************************* -(in-package :cl-user) +(in-package cl-user) -(defpackage #:lisp-markup-language +(defpackage lisp-markup-language (:use #:common-lisp) (:nicknames #:lml) (:export diff --git a/read-macro.lisp b/read-macro.lisp index 4ce43d2..0981add 100644 --- a/read-macro.lisp +++ b/read-macro.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: read-macro.lisp,v 1.1 2003/04/27 17:53:16 kevin Exp $ +;;;; $Id: read-macro.lisp,v 1.2 2003/06/06 21:59:30 kevin Exp $ ;;;; ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -16,8 +16,7 @@ ;;;; (http://www.gnu.org/licenses/gpl.html) ;;;; ************************************************************************* -(declaim (optimize (debug 3) (speed 3) (safety 3) (compilation-speed 0))) -(in-package :lml) +(in-package #:lml) (set-macro-character #\[ diff --git a/stdsite.lisp b/stdsite.lisp index a0e9984..1836d7c 100644 --- a/stdsite.lisp +++ b/stdsite.lisp @@ -2,12 +2,12 @@ ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; -;;;; Name: stdsite.cl +;;;; Name: stdsite.lisp ;;;; Purpose: Functions to create my standard style sites ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: stdsite.lisp,v 1.3 2003/01/24 08:51:41 kevin Exp $ +;;;; $Id: stdsite.lisp,v 1.4 2003/06/06 21:59:30 kevin Exp $ ;;;; ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -24,8 +24,7 @@ ;;; content.lml_ ;;; footer.lml_ -(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) -(in-package :lml) +(in-package #:lml) (defmacro std-head (title &body body) `(head diff --git a/utils.lisp b/utils.lisp index dcd0995..6ce2384 100644 --- a/utils.lisp +++ b/utils.lisp @@ -1,9 +1,8 @@ -;;; $Id: utils.lisp,v 1.7 2003/03/12 17:01:48 kevin Exp $ +;;; $Id: utils.lisp,v 1.8 2003/06/06 21:59:30 kevin Exp $ ;;;; ;;;; General purpose utilities -(in-package :lml) - +(in-package #:lml) (defmacro aif (test then &optional else) `(let ((it ,test)) @@ -19,14 +18,19 @@ (string-equal "keyword" (package-name (symbol-package x))))) (defun list-to-spaced-string (list) - (if (consp list) - (format nil "~A~{ ~A~}" (first list) (rest list)) - "")) + (format nil "~{~A~^ ~}" list)) +(defun print-n-chars (char n stream) + (declare (fixnum n) + (optimize (speed 3) (safety 0) (space 0))) + (do ((i 0 (1+ i))) + ((= i n) char) + (declare (fixnum i)) + (write-char char stream))) + (defun indent-spaces (n &optional (stream *standard-output*)) "Indent n*2 spaces to output stream" - (let ((fmt (format nil "~~~DT" (+ n n)))) - (format stream fmt))) + (print-n-chars #\space (+ n n) stream)) (defun print-file-contents (file &optional (strm *standard-output*)) "Opens a reads a file. Returns the contents as a single string" @@ -35,22 +39,19 @@ (do ((line (read-line in nil 'eof) (read-line in nil 'eof))) ((eql line 'eof)) - (format strm "~A~%" line))))) + (write-string line strm) + (write-char #\newline strm))))) (defun date-string (ut) - (if (typep ut 'integer) - (multiple-value-bind (sec min hr day mon year dow daylight-p zone) - (decode-universal-time ut) - (declare (ignore daylight-p zone)) - (format nil "~[Mon~;Tue~;Wed~;Thu~;Fri~;Sat~;Sun~], ~d ~[Jan~;Feb~;Mar~;Apr~;May~;Jun~;Jul~;Aug~;Sep~;Oct~;Nov~;Dec~] ~d ~2,'0d:~2,'0d:~2,'0d" - dow - day - (1- mon) - year - hr min sec)))) + (check-type ut integer) + (multiple-value-bind (sec min hr day mon year dow daylight-p zone) + (decode-universal-time ut) + (declare (ignore daylight-p zone)) + (format nil "~[Mon~;Tue~;Wed~;Thu~;Fri~;Sat~;Sun~], ~d ~[Jan~;Feb~;Mar~;Apr~;May~;Jun~;Jul~;Aug~;Sep~;Oct~;Nov~;Dec~] ~d ~2,'0d:~2,'0d:~2,'0d" + dow day (1- mon) year hr min sec))) (defun lml-quit (&optional (code 0)) - "Function to exit the Lisp implementation. Copied from CLOCC's QUIT function." + "Function to exit the Lisp implementation." #+allegro (excl:exit code) #+clisp (#+lisp=cl ext:quit #-lisp=cl lisp:quit code) #+(or cmu scl) (ext:quit code) @@ -78,4 +79,4 @@ #+mcl (ccl:mac-default-directory) #-(or allegro clisp cmu scl sbcl cormanlisp lispworks lucid mcl) (truename ".")) - +