[cl-irc-cvs] r232 - trunk

ehuelsmann at common-lisp.net ehuelsmann at common-lisp.net
Sun Jan 13 13:00:45 UTC 2013


Author: ehuelsmann
Date: Sun Jan 13 05:00:44 2013
New Revision: 232

Log:
Patch submitted by Julien Danjou.

Modified:
   trunk/package.lisp
   trunk/protocol.lisp

Modified: trunk/package.lisp
==============================================================================
--- trunk/package.lisp	Sun Sep 23 09:44:44 2012	(r231)
+++ trunk/package.lisp	Sun Jan 13 05:00:44 2013	(r232)
@@ -48,6 +48,7 @@
              :client-stream
              :channels
              :add-hook
+             :append-hook
              :remove-hook
              :remove-hooks
              :remove-all-hooks

Modified: trunk/protocol.lisp
==============================================================================
--- trunk/protocol.lisp	Sun Sep 23 09:44:44 2012	(r231)
+++ trunk/protocol.lisp	Sun Jan 13 05:00:44 2013	(r232)
@@ -199,6 +199,7 @@
 (defgeneric send-irc-message (connection command &rest arguments))
 (defgeneric get-hooks (connection class))
 (defgeneric add-hook (connection class hook))
+(defgeneric append-hook (connection class hook))
 (defgeneric remove-hook (connection class hook))
 (defgeneric remove-hooks (connection class))
 (defgeneric remove-all-hooks (connection))
@@ -383,6 +384,11 @@
   (setf (gethash class (hooks connection))
         (pushnew hook (gethash class (hooks connection)))))
 
+(defmethod append-hook (connection class hook)
+  "Append `hook' to `class'."
+  (setf (gethash class (hooks connection))
+        (append (gethash class (hooks connection)) (list hook))))
+
 (defmethod remove-hook ((connection connection) class hook)
   "Remove `hook' from `class'."
   (setf (gethash class (hooks connection))




More information about the cl-irc-cvs mailing list