Fixed.
[riece] / lisp / riece-foolproof.el
index f1572b2..1889987 100644 (file)
@@ -1,4 +1,4 @@
-;;; riece-foolproof.el --- channel miss killer
+;;; riece-foolproof.el --- prevent miss-operation in the command buffer
 ;; Copyright (C) 2004 TAKAHASHI Kaoru
 
 ;; Author: TAKAHASHI "beatmaria" Kaoru <kaoru@kaisei.org>
   (require 'riece-identity)
   (require 'riece-display))
 
-(defvar riece-foolproof-enabled nil)
-
 (defconst riece-foolproof-description
-  "Channel miss killer")
+  "Prevent miss-operation in the command buffer.")
 
 (defun riece-foolproof-get-channel-window (identity)
   (get-buffer-window
@@ -42,7 +40,7 @@
         identity riece-channel-buffer-alist))))
 
 (defun riece-foolproof-command-send-message-function ()
-  (when riece-foolproof-enabled
+  (when (get 'riece-foolproof 'riece-addon-enabled)
     (unless (or (not riece-channel-buffer-mode)
                (riece-foolproof-get-channel-window
                 riece-current-channel))
   (remove-hook 'riece-command-send-message-hook
               'riece-foolproof-command-send-message-function))
 
-(defun riece-foolproof-enable ()
-  (setq riece-foolproof-enabled t))
-
-(defun riece-foolproof-disable ()
-  (setq riece-foolproof-enabled nil))
-
 (provide 'riece-foolproof)
 
 ;;; riece-foolproof.el ends here