From: ueno Date: Mon, 2 Jun 2003 02:10:28 +0000 (+0000) Subject: * Riece: Version 0.0.3 released. X-Git-Tag: riece-0_0_3~1 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a67e122e93febb6eb08e8e78ce8f77ddecddd54f;p=elisp%2Friece.git * Riece: Version 0.0.3 released. * riece-version.el (riece-version-number): Bump up to 0.0.3. * riece-ctcp.el (riece-handle-ctcp-request): Catch errors occured in hooks. (riece-handle-ctcp-response): Ditto. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 678c6f3..f3ae1a0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2003-06-02 Daiki Ueno + + * Riece: Version 0.0.3 released. + * riece-version.el (riece-version-number): Bump up to 0.0.3. + + * riece-ctcp.el (riece-handle-ctcp-request): Catch errors occured + in hooks. + (riece-handle-ctcp-response): Ditto. + 2003-06-01 Daiki Ueno * riece-user.el (riece-rename-user): Don't modify entry when diff --git a/lisp/riece-ctcp.el b/lisp/riece-ctcp.el index d333af1..f13a1d6 100644 --- a/lisp/riece-ctcp.el +++ b/lisp/riece-ctcp.el @@ -47,12 +47,21 @@ (let ((request (downcase (match-string 1 message)))) (if (match-beginning 2) (setq message (substring (match-string 2 message) 1))) - (unless (run-hook-with-args-until-success - (intern (concat "riece-ctcp-" request "-request-hook")) - prefix (car targets) message) - (let ((function (intern-soft (concat "riece-handle-ctcp-" - request - "-request")))) + (let ((hook + (intern (concat "riece-ctcp-" request "-request-hook"))) + (function + (intern-soft (concat "riece-handle-ctcp-" request + "-request"))) + (after-hook + (intern (concat "riece-ctcp-after-" request + "-request-hook")))) + (unless (condition-case error + (run-hook-with-args-until-success + hook prefix (car targets) message) + (error + (if riece-debug + (message "Error occurred in `%S': %S" hook error)) + nil)) (if function (condition-case error (funcall function prefix (car targets) message) @@ -60,9 +69,13 @@ (if riece-debug (message "Error occurred in `%S': %S" function error)))))) - (run-hook-with-args-until-success - (intern (concat "riece-ctcp-after-" request "-request-hook")) - prefix (car targets) message)) + (condition-case error + (run-hook-with-args-until-success + after-hook prefix (car targets) message) + (error + (if riece-debug + (message "Error occurred in `%S': %S" + after-hook error))))) t))))) (defun riece-handle-ctcp-version-request (prefix target string) @@ -121,12 +134,20 @@ (let ((response (downcase (match-string 1 message)))) (if (match-beginning 2) (setq message (substring (match-string 2 message) 1))) - (unless (run-hook-with-args-until-success - (intern (concat "riece-ctcp-" response "-response-hook")) - prefix (car targets) message) - (let ((function (intern-soft (concat "riece-handle-ctcp-" - response - "-response")))) + (let ((hook + (intern (concat "riece-ctcp-" response "-response-hook"))) + (function (intern-soft (concat "riece-handle-ctcp-" + response "-response"))) + (after-hook + (intern (concat "riece-ctcp-after-" response + "-response-hook")))) + (unless (condition-case error + (run-hook-with-args-until-success + hook prefix (car targets) message) + (error + (if riece-debug + (message "Error occurred in `%S': %S" hook error)) + nil)) (if function (condition-case error (funcall function prefix (car targets) message) @@ -134,9 +155,13 @@ (if riece-debug (message "Error occurred in `%S': %S" function error)))))) - (run-hook-with-args-until-success - (intern (concat "riece-ctcp-after-" response "-response-hook")) - prefix (car targets) message)) + (condition-case error + (run-hook-with-args-until-success + after-hook prefix (car targets) message) + (error + (if riece-debug + (message "Error occurred in `%S': %S" + after-hook error))))) t))))) (defun riece-handle-ctcp-version-response (prefix target string) diff --git a/lisp/riece-version.el b/lisp/riece-version.el index b4bdc32..2bf3fa3 100644 --- a/lisp/riece-version.el +++ b/lisp/riece-version.el @@ -48,7 +48,7 @@ string, be sure to use a valid format, see RFC 2616." (defconst riece-product-name "Riece") -(defconst riece-version-number "0.0.2" +(defconst riece-version-number "0.0.3" "Version number for this version of Riece.") (defconst riece-version (format "Riece v%s" riece-version-number)