projects
/
elisp
/
riece.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Translate
[elisp/riece.git]
/
lisp
/
riece-foolproof.el
diff --git
a/lisp/riece-foolproof.el
b/lisp/riece-foolproof.el
index
aa7bb86
..
1894634
100644
(file)
--- a/
lisp/riece-foolproof.el
+++ b/
lisp/riece-foolproof.el
@@
-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>
;; Copyright (C) 2004 TAKAHASHI Kaoru
;; Author: TAKAHASHI "beatmaria" Kaoru <kaoru@kaisei.org>
@@
-18,8
+18,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
;; 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:
;;; Commentary:
@@
-31,10
+31,8
@@
(require 'riece-identity)
(require 'riece-display))
(require 'riece-identity)
(require 'riece-display))
-(defvar riece-foolproof-enabled nil)
-
(defconst riece-foolproof-description
(defconst riece-foolproof-description
- "Channel miss killer")
+ "Prevent miss-operation in the command buffer.")
(defun riece-foolproof-get-channel-window (identity)
(get-buffer-window
(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 ()
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))
(unless (or (not riece-channel-buffer-mode)
(riece-foolproof-get-channel-window
riece-current-channel))
@@
-62,11
+60,9
@@
(add-hook 'riece-command-send-message-hook
'riece-foolproof-command-send-message-function))
(add-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))
+(defun riece-foolproof-uninstall ()
+ (remove-hook 'riece-command-send-message-hook
+ 'riece-foolproof-command-send-message-function))
(provide 'riece-foolproof)
(provide 'riece-foolproof)