[version 0.10.0 ediware**20070725050014] { hunk ./CHANGELOG 1 +Version 0.10.0 +2007-07-25 +Added ESCAPE-CHAR-... functions (based on a patch by Volkan Yazici) + hunk ./cl-who.asd 2 -;;; $Header: /usr/local/cvsrep/cl-who/cl-who.asd,v 1.16 2007/05/28 18:31:31 edi Exp $ +;;; $Header: /usr/local/cvsrep/cl-who/cl-who.asd,v 1.17 2007/07/24 21:53:30 edi Exp $ hunk ./cl-who.asd 31 - :version "0.9.1" + :version "0.10.0" hunk ./doc/index.html 77 -CL-WHO is used by ERGO and Heike Stephan. +CL-WHO is used by clutu, ERGO, and Heike Stephan. hunk ./doc/index.html 105 +
escape-char
hunk ./doc/index.html 112
+ escape-char-minimal
+ escape-char-minimal-plus-quotes
+ escape-char-iso-8859-1
+ escape-char-all
hunk ./doc/index.html 259
-current version is 0.9.1.
+current version is 0.10.0.
hunk ./doc/index.html 605
+
[Function]
+
escape-char character &key test => escaped-string
+
+
+ hunk ./doc/index.html 616 -This is the default for the
+This function works identical toESCAPE-STRING
, except that it operates on characters instead of strings. +
test
keyword argument to ESCAPE-STRING
. Its initial value is
+This is the default for the test
keyword argument to ESCAPE-STRING
and ESCAPE-CHAR
. Its initial value is
hunk ./doc/index.html 635
+
-These are convenience function based onESCAPE-STRING
. They are defined as follows: +
These are convenience function based +onESCAPE-STRING
+andESCAPE-CHAR
. The string +functions are defined in a way similar to this one: hunk ./doc/index.html 675 +The character functions are defined in an analogous manner. hunk ./doc/index.html 803 -$Header: /usr/local/cvsrep/cl-who/doc/index.html,v 1.54 2007/05/28 18:31:32 edi Exp $ +$Header: /usr/local/cvsrep/cl-who/doc/index.html,v 1.57 2007/07/24 21:53:31 edi Exp $ hunk ./packages.lisp 2 -;;; $Header: /usr/local/cvsrep/cl-who/packages.lisp,v 1.15 2007/04/27 09:33:42 edi Exp $ +;;; $Header: /usr/local/cvsrep/cl-who/packages.lisp,v 1.16 2007/07/24 21:53:30 edi Exp $ hunk ./packages.lisp 46 + :escape-char + :escape-char-all + :escape-char-iso-8859-1 + :escape-char-minimal + :escape-char-minimal-plus-quotes hunk ./who.lisp 2 -;;; $Header: /usr/local/cvsrep/cl-who/who.lisp,v 1.33 2007/05/28 18:31:31 edi Exp $ +;;; $Header: /usr/local/cvsrep/cl-who/who.lisp,v 1.34 2007/07/24 21:53:30 edi Exp $ hunk ./who.lisp 57 +(declaim (inline escape-char)) +(defun escape-char (char &key (test *escape-char-p*)) + (declare (optimize speed)) + "Returns an escaped version of the character CHAR if CHAR satisfies +the predicate TEST. Always returns a string." + (if (funcall test char) + (case char + (#\< "<") + (#\> ">") + (#\& "&") + (#\' "'") + (#\" """) + (t (format nil (if (eq *html-mode* :xml) "~x;" "~d;") + (char-code char)))) + (make-string 1 :initial-element char))) + hunk ./who.lisp 110 -(defun escape-string-minimal (string) - "Escape only #\<, #\>, and #\& in STRING." - (escape-string string :test #'(lambda (char) (find char "<>&")))) +(flet ((minimal-escape-char-p (char) (find char "<>&"))) + (defun escape-char-minimal (char) + "Escapes only #\<, #\>, and #\& characters." + (escape-char char :test #'minimal-escape-char-p)) + (defun escape-string-minimal (string) + "Escapes only #\<, #\>, and #\& in STRING." + (escape-string string :test #'minimal-escape-char-p))) hunk ./who.lisp 118 -(defun escape-string-minimal-plus-quotes (string) - "Like ESCAPE-STRING-MINIMAL but also escapes quotes." - (escape-string string :test #'(lambda (char) (find char "<>&'\"")))) +(flet ((minimal-plus-quotes-escape-char-p (char) (find char "<>&'\""))) + (defun escape-char-minimal-plus-quotes (char) + "Like ESCAPE-CHAR-MINIMAL but also escapes quotes." + (escape-char char :test #'minimal-plus-quotes-escape-char-p)) + (defun escape-string-minimal-plus-quotes (string) + "Like ESCAPE-STRING-MINIMAL but also escapes quotes." + (escape-string string :test #'minimal-plus-quotes-escape-char-p))) hunk ./who.lisp 126 -(defun escape-string-iso-8859-1 (string) - "Escapes all characters in STRING which aren't defined in -ISO-8859-1." - (escape-string string :test #'(lambda (char) - (or (find char "<>&'\"") - (> (char-code char) 255))))) +(flet ((iso-8859-1-escape-char-p (char) + (or (find char "<>&'\"") + (> (char-code char) 255)))) + (defun escape-char-iso-8859-1 (char) + "Escapes characters that aren't defined in ISO-8859-9." + (escape-char char :test #'iso-8859-1-escape-char-p)) + (defun escape-string-iso-8859-1 (string) + "Escapes all characters in STRING which aren't defined in ISO-8859-1." + (escape-string string :test #'iso-8859-1-escape-char-p))) hunk ./who.lisp 137 - "Identical to ESCAPE-STRING-8859-1. Kept for backward -compatibility." + "Identical to ESCAPE-STRING-8859-1. Kept for backward compatibility." hunk ./who.lisp 140 -(defun escape-string-all (string) - "Escapes all characters in STRING which aren't in the 7-bit ASCII +(flet ((non-7bit-ascii-escape-char-p (char) + (or (find char "<>&'\"") + (> (char-code char) 127)))) + (defun escape-char-all (char) + "Escapes characters which aren't in the 7-bit ASCII character set." + (escape-char char :test #'non-7bit-ascii-escape-char-p)) + (defun escape-string-all (string) + "Escapes all characters in STRING which aren't in the 7-bit ASCII hunk ./who.lisp 149 - (escape-string string :test #'(lambda (char) - (or (find char "<>&'\"") - (> (char-code char) 127))))) + (escape-string string :test #'non-7bit-ascii-escape-char-p))) hunk ./who.lisp 165 - if (keywordp (first rest)) - collect (cons (first rest) (second rest)) into attr - else - do (progn (setq attr-list attr) - (setq body rest) - (return)) - finally (setq attr-list attr))) + if (keywordp (first rest)) + collect (cons (first rest) (second rest)) into attr + else + do (progn (setq attr-list attr) + (setq body rest) + (return)) + finally (setq attr-list attr))) hunk ./who.lisp 175 - if (keywordp (first rest)) + if (keywordp (first rest)) hunk ./who.lisp 177 - finally (setq attr-list attr)) + finally (setq attr-list attr)) }