From: Lucian Mogosanu Date: Fri, 24 May 2019 17:31:15 +0000 (+0300) Subject: cl-who: Mostly cosmetic code changes X-Git-Tag: v0.11~52 X-Git-Url: https://git.mogosanu.ro/?a=commitdiff_plain;h=e93d05d9430ac9a02e944dc75820da29b680cd9f;p=thetarpit.git cl-who: Mostly cosmetic code changes - Indent code to max. 80 lines - Remove UTF characters from changelog --- diff --git a/cl-who/CHANGELOG b/cl-who/CHANGELOG index 599facb..18df861 100644 --- a/cl-who/CHANGELOG +++ b/cl-who/CHANGELOG @@ -117,12 +117,12 @@ Allow for optional LHTML syntax (patch by Kevin Rosenberg) Version 0.3.0 2003-08-02 -Changed behaviour of attributes (incompatible with 0.2.0 syntax!) due to a question by Jörg-Cyril Höhle +Changed behaviour of attributes (incompatible with 0.2.0 syntax!) due to a question by Jorg-Cyril Hohle Changed ' back to ' because of IE Version 0.2.0 2003-07-27 -Changed default for :PROLOGUE (I was convinced by Rob Warnock and Eduardo Muñoz) +Changed default for :PROLOGUE (I was convinced by Rob Warnock and Eduardo Munoz) Version 0.1.1 2003-07-20 diff --git a/cl-who/who.lisp b/cl-who/who.lisp index b2d0337..377d673 100644 --- a/cl-who/who.lisp +++ b/cl-who/who.lisp @@ -147,7 +147,8 @@ can use EQL specializers on the first argument." (let ((tag (if *downcase-tokens-p* (string-downcase tag) (string tag))) (body-indent ;; increase *INDENT* by 2 for body -- or disable it - (when (and *indent* (not (member tag *html-no-indent-tags* :test #'string-equal))) + (when (and *indent* (not (member tag *html-no-indent-tags* + :test #'string-equal))) (+ 2 *indent*)))) (nconc (if *indent* @@ -177,7 +178,7 @@ can use EQL specializers on the first argument." (defun tree-to-template (tree) "Transforms an HTML tree into an intermediate format - mainly a -flattened list of strings. Utility function used by TREE-TO-COMMANDS-AUX." +flattened list of strings. Utility function used by TREE-TO-COMMANDS." (loop for element in tree if (or (keywordp element) (and (listp element) @@ -219,7 +220,8 @@ flattened list of strings. Utility function used by TREE-TO-COMMANDS-AUX." "Concatenates all arguments which should be string into one string." (funcall #'string-list-to-string string-list)) -(defun tree-to-commands (tree stream &key prologue ((:indent *indent*) *indent*)) +(defun tree-to-commands (tree stream + &key prologue ((:indent *indent*) *indent*)) (declare (optimize speed space)) (when (and *indent* (not (integerp *indent*))) @@ -282,14 +284,17 @@ supplied." ,@declarations (check-type ,var stream) (macrolet ((htm (&body body) - `(with-html-output (,',var nil :prologue nil :indent ,,indent) + `(with-html-output (,',var nil + :prologue nil + :indent ,,indent) ,@body)) (fmt (&rest args) `(format ,',var ,@args)) (esc (thing) (with-unique-names (result) `(let ((,result ,thing)) - (when ,result (write-string (escape-string ,result) ,',var))))) + (when ,result + (write-string (escape-string ,result) ,',var))))) (str (thing) (with-unique-names (result) `(let ((,result ,thing)) @@ -298,10 +303,11 @@ supplied." (defmacro with-html-output-to-string ((var &optional string-form &key #-(or :ecl :cmu :sbcl) - (element-type #-:lispworks ''character - #+:lispworks ''lw:simple-char) - prologue - indent) + (element-type + #-:lispworks ''character + #+:lispworks ''lw:simple-char) + prologue + indent) &body body) "Transform the enclosed BODY consisting of HTML as s-expressions into Lisp code which creates the corresponding HTML as a string."