Update of /project/net-nittin-irc/cvsroot/net-nittin-irc/example In directory common-lisp.net:/tmp/cvs-serv23428
Modified Files: cliki.lisp Log Message: Minor fixes
Date: Sat Dec 13 18:44:34 2003 Author: bmastenbrook
Index: net-nittin-irc/example/cliki.lisp diff -u net-nittin-irc/example/cliki.lisp:1.4 net-nittin-irc/example/cliki.lisp:1.5 --- net-nittin-irc/example/cliki.lisp:1.4 Sat Dec 13 18:08:26 2003 +++ net-nittin-irc/example/cliki.lisp Sat Dec 13 18:44:33 2003 @@ -1,4 +1,4 @@ -;;;; $Id: cliki.lisp,v 1.4 2003/12/13 23:08:26 bmastenbrook Exp $ +;;;; $Id: cliki.lisp,v 1.5 2003/12/13 23:44:33 bmastenbrook Exp $ ;;;; $Source: /project/net-nittin-irc/cvsroot/net-nittin-irc/example/cliki.lisp,v $
;;;; cliki.lisp - CLiki as an infobot; only works on SBCL. @@ -24,11 +24,13 @@ (defun write-small-definitions () (with-open-file (sd-file "sd.lisp-expr" :direction :output :if-exists :supersede) (mapc #'(lambda (defn) - (prin1 defn sd-file)) *small-definitions*))) + (prin1 defn sd-file) + (format sd-file "~%")) *small-definitions*)))
(defun write-top-definition () (with-open-file (sd-file "sd.lisp-expr" :direction :output :if-exists :append) - (prin1 (car *small-definitions*) sd-file))) + (prin1 (car *small-definitions*) sd-file) + (format sd-file "~%")))
(defun add-small-definition (term defn) (push (cons term defn) *small-definitions*) @@ -131,7 +133,7 @@
(defparameter *cliki-attention-prefix* "cliki: ")
-(defparameter *cliki-bot-help* "The CLiki bot supplies small definitions and performs lookups on CLiki. To add a term for IRC, try saying ``cliki: add "term" as: definition''.") +(defparameter *cliki-bot-help* "The CLiki bot supplies small definitions and performs lookups on CLiki. To use it, try ``cliki: term?''. To add a term for IRC, try saying ``cliki: add "term" as: definition''; otherwise, edit the corresponding CLiki page.")
(defun cliki-lookup (term-with-question) (let ((first-pass (regex-replace-all "^(\s*)([^?]+)(\?*)$" term-with-question "\2")))