* riece-rdcc.el (riece-rdcc-server-port): New user option.
[riece] / lisp / riece-signal.el
index c239a02..d5fe870 100644 (file)
@@ -19,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -30,6 +30,7 @@
 ;;; Code:
 
 (require 'riece-options)
+(require 'riece-debug)
 
 (defvar riece-signal-slot-obarray
   (make-vector 31 0))
@@ -89,6 +90,10 @@ This function is for internal use only."
          (set symbol (delq (car slots) (symbol-value symbol))))
       (setq slots (cdr slots)))))
 
+(defun riece-clear-signal-slots ()
+  "Remove all functions from listeners list."
+  (fillarray riece-signal-slot-obarray 0))
+
 (defun riece-emit-signal (signal-name &rest args)
   "Emit SIGNAL."
   (let ((symbol (intern-soft (symbol-name signal-name)
@@ -99,22 +104,16 @@ This function is for internal use only."
       (setq signal (riece-make-signal signal-name args)
            slots (symbol-value symbol))
       (while slots
-       (condition-case error
-           (if (or (null (riece-slot-filter (car slots)))
-                   (condition-case error
-                       (funcall (riece-slot-filter (car slots)) signal)
-                     (error
-                      (if riece-debug
-                          (message
-                           "Error in signal filter for \"%S\": %S"
-                           signal-name error)))
-                     nil))
-               (funcall (riece-slot-function (car slots))
-                        signal (riece-slot-handback (car slots))))
-         (error
-          (if riece-debug
-              (message "Error in slot function for \"%S\": %S"
-                       signal-name error))))
+       (if (or (null (riece-slot-filter (car slots)))
+               (riece-funcall-ignore-errors (format "signal filter for \"%S\""
+                                                    signal-name)
+                                            (riece-slot-filter (car slots))
+                                            signal))
+           (riece-funcall-ignore-errors (format "slot function for \"%S\""
+                                                signal-name)
+                                        (riece-slot-function (car slots))
+                                        signal
+                                        (riece-slot-handback (car slots))))
        (setq slots (cdr slots))))))
 
 (provide 'riece-signal)