X-Git-Url: https://cgit.sxemacs.org/?p=riece;a=blobdiff_plain;f=lisp%2Friece-ctcp.el;h=8c458693ad542b901b11c725916b0dafae51ea64;hp=b3bec43b233c4f3bbe7fb1714cb603bce9e0d1d9;hb=47898fb5994cace98d43140cf65ce5785e75c28c;hpb=e369475dc77ade8e75b400607107669fdda61ee5 diff --git a/lisp/riece-ctcp.el b/lisp/riece-ctcp.el index b3bec43..8c45869 100644 --- a/lisp/riece-ctcp.el +++ b/lisp/riece-ctcp.el @@ -28,6 +28,7 @@ (require 'riece-misc) (require 'riece-highlight) (require 'riece-display) +(require 'riece-debug) (defface riece-ctcp-action-face '((((class color) @@ -51,6 +52,9 @@ (defvar riece-ctcp-enabled nil) +(defconst riece-ctcp-description + "CTCP (Client To Client Protocol) support") + (defun riece-handle-ctcp-request (prefix string) (when (and riece-ctcp-enabled prefix string (riece-prefix-nickname prefix)) @@ -69,27 +73,15 @@ (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 in `%S': %S" hook error)) - nil)) + (unless (riece-ignore-errors (symbol-name hook) + (run-hook-with-args-until-success + hook prefix (car targets) message)) (if function - (condition-case error - (funcall function prefix (car targets) message) - (error - (if riece-debug - (message "Error in `%S': %S" - function error)))))) - (condition-case error + (riece-ignore-errors (symbol-name function) + (funcall function prefix (car targets) message))) + (riece-ignore-errors (symbol-name after-hook) (run-hook-with-args-until-success - after-hook prefix (car targets) message) - (error - (if riece-debug - (message "Error in `%S': %S" - after-hook error))))) + after-hook prefix (car targets) message)))) t))))) (defun riece-handle-ctcp-version-request (prefix target string) @@ -204,27 +196,15 @@ (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 in `%S': %S" hook error)) - nil)) + (unless (riece-ignore-errors (symbol-name hook) + (run-hook-with-args-until-success + hook prefix (car targets) message)) (if function - (condition-case error - (funcall function prefix (car targets) message) - (error - (if riece-debug - (message "Error in `%S': %S" - function error)))))) - (condition-case error + (riece-ignore-errors (symbol-name function) + (funcall function prefix (car targets) message))) + (riece-ignore-errors (symbol-name after-hook) (run-hook-with-args-until-success - after-hook prefix (car targets) message) - (error - (if riece-debug - (message "Error in `%S': %S" - after-hook error))))) + after-hook prefix (car targets) message)))) t))))) (defun riece-handle-ctcp-version-response (prefix target string)