* riece-xface.el (riece-xface-user-list-mode-hook): New function.
authorueno <ueno>
Fri, 26 Aug 2005 07:44:15 +0000 (07:44 +0000)
committerueno <ueno>
Fri, 26 Aug 2005 07:44:15 +0000 (07:44 +0000)
(riece-xface-insinuate): Use it.
(riece-xface-uninstall): New function.
* riece-url.el (riece-url-command-mode-hook): New function.
(riece-url-insinuate): Use it.
(riece-url-uninstall): New function.
* riece-unread.el (riece-unread-uninstall): New function.
* riece-toolbar.el (riece-toolbar-uninstall): New function.
* riece-rdcc.el (riece-rdcc-uninstall): New function.
* riece-ndcc.el (riece-ndcc-uninstall): New function.
* riece-mini.el (riece-mini-uninstall): New function.
* riece-menu.el (riece-menu-uninstall): New function.
* riece-lsdb.el: New function.
* riece-log.el (riece-log-uninstall): New function.
* riece-keyword.el (riece-keyword-uninstall): New function.
* riece-keepalive.el (riece-keepalive-uninstall): New function.
* riece-kakasi.el (riece-kakasi-uninstall): New function.
* riece-ignore.el (riece-ignore-uninstall): New function.
* riece-icon.el (riece-icon-user-list-mode-hook): New function.
(riece-icon-channel-list-mode-hook): New function.
(riece-icon-original-mode-line-buffer-identification): New variable.
(riece-icon-insinuate): Use them.
(riece-icon-uninstall): New function.
* riece-history.el
(riece-history-after-switch-to-channel-functions): New function.
(riece-history-insinuate): Use it.
(riece-history-uninstall): New function.
* riece-highlight.el (riece-highlight-uninstall): New function.
* riece-hangman.el (riece-hangman-uninstall): New function.
* riece-google.el (riece-google-uninstall): New function.
* riece-foolproof.el (riece-foolproof-uninstall): New function.
* riece-eval.el (riece-eval-uninstall): New function.
* riece-eval-ruby.el (riece-eval-ruby-uninstall): New function.
* riece-doctor.el (riece-doctor-uninstall): New function.
* riece-ctlseq.el (riece-ctlseq-uninstall): New function.
* riece-ctcp.el (riece-ctcp-dialogue-font-lock-keywords): New variable.
(riece-ctcp-uninstall): New function.
* riece-button.el (riece-button-channel-list-mode-hook): New function.
* riece-biff.el (riece-biff-uninstall): New function.

28 files changed:
lisp/ChangeLog
lisp/riece-biff.el
lisp/riece-button.el
lisp/riece-ctcp.el
lisp/riece-ctlseq.el
lisp/riece-doctor.el
lisp/riece-eval-ruby.el
lisp/riece-eval.el
lisp/riece-foolproof.el
lisp/riece-google.el
lisp/riece-hangman.el
lisp/riece-highlight.el
lisp/riece-history.el
lisp/riece-icon.el
lisp/riece-ignore.el
lisp/riece-kakasi.el
lisp/riece-keepalive.el
lisp/riece-keyword.el
lisp/riece-log.el
lisp/riece-lsdb.el
lisp/riece-menu.el
lisp/riece-mini.el
lisp/riece-ndcc.el
lisp/riece-rdcc.el
lisp/riece-toolbar.el
lisp/riece-unread.el
lisp/riece-url.el
lisp/riece-xface.el

index ac184ca..800896a 100644 (file)
@@ -1,5 +1,49 @@
 2005-08-26  Daiki Ueno  <ueno@unixuser.org>
 
+       * Make add-ons uninstallable.
+
+       * riece-xface.el (riece-xface-user-list-mode-hook): New function.
+       (riece-xface-insinuate): Use it.
+       (riece-xface-uninstall): New function.
+       * riece-url.el (riece-url-command-mode-hook): New function.
+       (riece-url-insinuate): Use it.
+       (riece-url-uninstall): New function.
+       * riece-unread.el (riece-unread-uninstall): New function.
+       * riece-toolbar.el (riece-toolbar-uninstall): New function.
+       * riece-rdcc.el (riece-rdcc-uninstall): New function.
+       * riece-ndcc.el (riece-ndcc-uninstall): New function.
+       * riece-mini.el (riece-mini-uninstall): New function.
+       * riece-menu.el (riece-menu-uninstall): New function.
+       * riece-lsdb.el: New function.
+       * riece-log.el (riece-log-uninstall): New function.
+       * riece-keyword.el (riece-keyword-uninstall): New function.
+       * riece-keepalive.el (riece-keepalive-uninstall): New function.
+       * riece-kakasi.el (riece-kakasi-uninstall): New function.
+       * riece-ignore.el (riece-ignore-uninstall): New function.
+       * riece-icon.el (riece-icon-user-list-mode-hook): New function.
+       (riece-icon-channel-list-mode-hook): New function.
+       (riece-icon-original-mode-line-buffer-identification): New variable.
+       (riece-icon-insinuate): Use them.
+       (riece-icon-uninstall): New function.
+       * riece-history.el
+       (riece-history-after-switch-to-channel-functions): New function.
+       (riece-history-insinuate): Use it.
+       (riece-history-uninstall): New function.
+       * riece-highlight.el (riece-highlight-uninstall): New function.
+       * riece-hangman.el (riece-hangman-uninstall): New function.
+       * riece-google.el (riece-google-uninstall): New function.
+       * riece-foolproof.el (riece-foolproof-uninstall): New function.
+       * riece-eval.el (riece-eval-uninstall): New function.
+       * riece-eval-ruby.el (riece-eval-ruby-uninstall): New function.
+       * riece-doctor.el (riece-doctor-uninstall): New function.
+       * riece-ctlseq.el (riece-ctlseq-uninstall): New function.
+       * riece-ctcp.el (riece-ctcp-dialogue-font-lock-keywords): New variable.
+       (riece-ctcp-uninstall): New function.
+       * riece-button.el (riece-button-channel-list-mode-hook): New function.
+       * riece-biff.el (riece-biff-uninstall): New function.
+
+2005-08-26  Daiki Ueno  <ueno@unixuser.org>
+
        * riece-options.el (riece-saved-forms): Added riece-addons.
 
        * riece-addon.el: Require 'riece-addon-modules.
index 0e26d2f..b05df0e 100644 (file)
   (add-hook 'riece-after-switch-to-channel-functions 'riece-biff-clear)
   (add-hook 'riece-exit-hook 'riece-biff-disable))
 
+(defun riece-biff-uninstall ()
+  (remove-hook 'riece-after-display-message-functions
+              'riece-biff-after-display-message-function)
+  (remove-hook 'riece-redisplay-buffers-hook 'riece-biff-clear)
+  (remove-hook 'riece-after-switch-to-channel-functions 'riece-biff-clear)
+  (remove-hook 'riece-exit-hook 'riece-biff-disable))
+
 (defun riece-biff-enable ()
   (setq global-mode-string
        (cond
index 6cd9dfe..05dff6b 100644 (file)
@@ -226,28 +226,52 @@ This function is used as a callback for a channel button."
 (defvar riece-channel-list-mode-map)
 (defvar riece-user-list-mode-map)
 (defvar riece-dialogue-mode-map)
+
+(defun riece-button-channel-list-mode-hook ()
+  (set-keymap-parent riece-channel-list-mode-map widget-keymap)
+  (set (make-local-variable 'riece-identity-button-map)
+       (riece-make-identity-button-map))
+  (add-hook 'riece-update-buffer-functions
+           'riece-button-update-buffer t t))
+
+(defun riece-button-user-list-mode-hook ()
+  (set-keymap-parent riece-user-list-mode-map widget-keymap)
+  (set (make-local-variable 'riece-identity-button-map)
+       (riece-make-identity-button-map))
+  (add-hook 'riece-update-buffer-functions
+           'riece-button-update-buffer t t))
+
+(defun riece-button-dialogue-mode-hook ()
+  (set-keymap-parent riece-dialogue-mode-map widget-keymap)
+  (set (make-local-variable 'riece-identity-button-map)
+       (riece-make-identity-button-map)))
+
 (defun riece-button-insinuate ()
   (add-hook 'riece-channel-list-mode-hook
-           (lambda ()
-             (set-keymap-parent riece-channel-list-mode-map widget-keymap)
-             (set (make-local-variable 'riece-identity-button-map)
-                  (riece-make-identity-button-map))
-             (add-hook 'riece-update-buffer-functions
-                       'riece-button-update-buffer t t)))
+           'riece-button-channel-list-mode-hook)
   (add-hook 'riece-user-list-mode-hook
-           (lambda ()
-             (set-keymap-parent riece-user-list-mode-map widget-keymap)
-             (set (make-local-variable 'riece-identity-button-map)
-                  (riece-make-identity-button-map))
-             (add-hook 'riece-update-buffer-functions
-                       'riece-button-update-buffer t t)))
+           'riece-button-user-list-mode-hook)
   (add-hook 'riece-dialogue-mode-hook
-           (lambda ()
-             (set-keymap-parent riece-dialogue-mode-map widget-keymap)
-             (set (make-local-variable 'riece-identity-button-map)
-                  (riece-make-identity-button-map))))
+           'riece-button-dialogue-mode-hook)
   (add-hook 'riece-after-insert-functions 'riece-button-add-identity-button))
 
+(defun riece-button-uninstall ()
+  (let ((buffers riece-buffer-list))
+    (save-excursion
+      (while buffers
+       (set-buffer (car buffers))
+       (remove-hook 'riece-update-buffer-functions
+                    'riece-button-update-buffer)
+       (setq buffers (cdr buffers)))))
+  (remove-hook 'riece-channel-list-mode-hook
+              'riece-button-channel-list-mode-hook)
+  (remove-hook 'riece-user-list-mode-hook
+              'riece-button-user-list-mode-hook)
+  (remove-hook 'riece-dialogue-mode-hook
+              'riece-button-dialogue-mode-hook)
+  (remove-hook 'riece-after-insert-functions
+              'riece-button-add-identity-button)))
+
 (defun riece-button-enable ()
   (setq riece-button-enabled t)
   (let ((pointer riece-buffer-list))
index 1199dc3..50a4cc4 100644 (file)
   (if (memq 'riece-highlight riece-addons)
       '(riece-highlight)))
 
+(defvar riece-ctcp-dialogue-font-lock-keywords
+  (list (concat "^" riece-time-prefix-regexp "\\("
+               (regexp-quote riece-ctcp-action-prefix)
+               ".*\\)$")
+       1 riece-ctcp-action-face t t))
+
 (defun riece-ctcp-insinuate ()
   (add-hook 'riece-privmsg-hook 'riece-handle-ctcp-request)
   (add-hook 'riece-notice-hook 'riece-handle-ctcp-response)
   (if (memq 'riece-highlight riece-addons)
       (setq riece-dialogue-font-lock-keywords
-           (cons (list (concat "^" riece-time-prefix-regexp "\\("
-                               (regexp-quote riece-ctcp-action-prefix)
-                               ".*\\)$")
-                       1 riece-ctcp-action-face t t)
+           (cons riece-ctcp-dialogue-font-lock-keywords
                  riece-dialogue-font-lock-keywords))))
 
+(defun riece-ctcp-uninstall ()
+  (remove-hook 'riece-privmsg-hook 'riece-handle-ctcp-request)
+  (remove-hook 'riece-notice-hook 'riece-handle-ctcp-response)
+  (setq riece-dialogue-font-lock-keywords
+       (delq riece-ctcp-dialogue-font-lock-keywords
+             riece-dialogue-font-lock-keywords)))
+
 (defun riece-ctcp-enable ()
   (define-key riece-dialogue-mode-map "\C-cv" 'riece-command-ctcp-version)
   (define-key riece-dialogue-mode-map "\C-cp" 'riece-command-ctcp-ping)
index 66492eb..c7a54e0 100644 (file)
 (defun riece-ctlseq-insinuate ()
   (add-hook 'riece-message-filter-functions 'riece-ctlseq-message-filter))
 
+(defun riece-ctlseq-uninstall ()
+  (remove-hook 'riece-message-filter-functions 'riece-ctlseq-message-filter))
+
 (defun riece-ctlseq-enable ()
   (setq riece-ctlseq-enabled t))
 
index 3239f0b..1f83c7c 100644 (file)
@@ -126,6 +126,9 @@ Please, describe your problems."
 (defun riece-doctor-insinuate ()
   (add-hook 'riece-after-privmsg-hook 'riece-doctor-after-privmsg-hook))
 
+(defun riece-doctor-uninstall ()
+  (remove-hook 'riece-after-privmsg-hook 'riece-doctor-after-privmsg-hook))
+
 (defun riece-doctor-enable ()
   (setq riece-doctor-enabled t))
 
index 7e1cd7f..60d59b1 100644 (file)
   (add-hook 'riece-after-display-message-functions
            'riece-eval-ruby-display-message-function))
 
+(defun riece-eval-ruby-uninstall ()
+  (remove-hook 'riece-after-display-message-functions
+              'riece-eval-ruby-display-message-function))
+
 (defun riece-eval-ruby-enable ()
   (setq riece-eval-ruby-enabled t))
 
index cbd1c85..ce62e71 100644 (file)
   (add-hook 'riece-after-display-message-functions
            'riece-eval-display-message-function))
 
+(defun riece-eval-uninstall ()
+  (remove-hook 'riece-after-display-message-functions
+              'riece-eval-display-message-function))
+
 (defun riece-eval-enable ()
   (setq riece-eval-enabled t))
 
index aa7bb86..f1572b2 100644 (file)
   (add-hook 'riece-command-send-message-hook
            'riece-foolproof-command-send-message-function))
 
+(defun riece-foolproof-uninstall ()
+  (remove-hook 'riece-command-send-message-hook
+              'riece-foolproof-command-send-message-function))
+
 (defun riece-foolproof-enable ()
   (setq riece-foolproof-enabled t))
 
index de93b90..80812da 100644 (file)
@@ -234,6 +234,10 @@ end
   (add-hook 'riece-after-display-message-functions
            'riece-google-display-message-function))
 
+(defun riece-google-uninstall ()
+  (remove-hook 'riece-after-display-message-functions
+              'riece-google-display-message-function))
+
 (defun riece-google-enable ()
   (setq riece-google-enabled t))
 
index 8865638..d86ed58 100644 (file)
@@ -227,6 +227,9 @@ The wordlist is read from `riece-hangman-words-file'."
 (defun riece-hangman-insinuate ()
   (add-hook 'riece-after-privmsg-hook 'riece-hangman-after-privmsg-hook))
 
+(defun riece-hangman-uninstall ()
+  (remove-hook 'riece-after-privmsg-hook 'riece-hangman-after-privmsg-hook))
+
 (defun riece-hangman-enable ()
   (random t)
   (setq riece-hangman-enabled t))
index 7ea6e09..4955a47 100644 (file)
   (add-hook 'riece-after-insert-functions
            'riece-highlight-put-overlay-faces))
 
+(defun riece-highlight-uninstall ()
+  (remprop 'riece-channel-mode 'font-lock-defaults)
+  (remove-hook 'riece-channel-mode-hook
+              'riece-highlight-setup-dialogue)
+  (remprop 'riece-others-mode 'font-lock-defaults)
+  (remove-hook 'riece-others-mode-hook
+              'riece-highlight-setup-dialogue)
+  (remprop 'riece-dialogue-mode 'font-lock-defaults)
+  (remove-hook 'riece-dialogue-mode-hook
+              'riece-highlight-setup-dialogue)
+  (remprop 'riece-channel-list-mode 'font-lock-defaults)
+  (remove-hook 'riece-channel-list-mode-hook
+              'riece-highlight-setup-channel-list)
+  (remove-hook 'riece-format-identity-for-channel-list-indicator-functions
+              'riece-highlight-format-identity-for-channel-list-indicator)
+  (remove-hook 'riece-after-insert-functions
+              'riece-highlight-put-overlay-faces))
+
 (defun riece-highlight-enable ()
   (let ((buffers riece-buffer-list))
     (while buffers
index 79dd389..64ed6b9 100644 (file)
 ;;;   (if (memq 'riece-guess riece-addons)
 ;;;       '(riece-guess)))
 
+(defun riece-history-after-switch-to-channel-functions (last)
+  (if (and riece-history-enabled last
+          (not (riece-identity-equal last riece-current-channel)))
+      (ring-insert riece-channel-history last)))
+
 (defun riece-history-insinuate ()
   (add-hook 'riece-after-switch-to-channel-functions
-           (lambda (last)
-             (if (and riece-history-enabled last
-                      (not (riece-identity-equal last riece-current-channel)))
-                 (ring-insert riece-channel-history last))))
+           'riece-history-after-switch-to-channel-functions)
   (add-hook 'riece-format-identity-for-channel-list-buffer-functions
            'riece-history-format-identity-for-channel-list-buffer)
   (add-hook 'riece-format-identity-for-channel-list-indicator-functions
 ;;;            'riece-guess-channel-from-history))
   )
 
+(defun riece-history-uninstall ()
+  (remove-hook 'riece-after-switch-to-channel-functions
+              'riece-history-after-switch-to-channel-functions)
+  (remove-hook 'riece-format-identity-for-channel-list-buffer-functions
+              'riece-history-format-identity-for-channel-list-buffer)
+  (remove-hook 'riece-format-identity-for-channel-list-indicator-functions
+              'riece-history-format-identity-for-channel-list-indicator)
+  (setq riece-channel-list-mark-face-alist
+       (delq (assq ?+ riece-channel-list-mark-face-alist)
+             riece-channel-list-mark-face-alist)))
+
 (defun riece-history-enable ()
   (setq riece-channel-history
        (make-ring riece-channel-history-length))
index 890fa95..73792d2 100644 (file)
@@ -308,19 +308,42 @@ Modify whole identification by side effect."
       (error
        (defalias 'riece-icon-modeline-buffer-identification 'identity)))))
 
+(defun riece-icon-user-list-mode-hook ()
+  (if (riece-icon-available-p)
+      (add-hook 'riece-update-buffer-functions
+               'riece-icon-update-user-list-buffer t t)))
+
+(defun riece-icon-channel-list-mode-hook ()
+  (if (riece-icon-available-p)
+      (add-hook 'riece-update-buffer-functions
+               'riece-icon-update-channel-list-buffer t t)))
+
+(defvar riece-icon-original-mode-line-buffer-identification nil)
+
 (defun riece-icon-insinuate ()
+  (setq riece-icon-original-mode-line-buffer-identification
+       (symbol-function 'riece-mode-line-buffer-identification))
   (defalias 'riece-mode-line-buffer-identification
     #'riece-icon-modeline-buffer-identification)
   (add-hook 'riece-user-list-mode-hook
-           (lambda ()
-             (if (riece-icon-available-p)
-                 (add-hook 'riece-update-buffer-functions
-                           'riece-icon-update-user-list-buffer t t))))
+           'riece-icon-user-list-mode-hook)
   (add-hook 'riece-channel-list-mode-hook
-           (lambda ()
-             (if (riece-icon-available-p)
-                 (add-hook 'riece-update-buffer-functions
-                           'riece-icon-update-channel-list-buffer t t)))))
+           'riece-icon-channel-list-mode-hook))
+
+(defun riece-icon-uninstall ()
+  (fset 'riece-mode-line-buffer-identification
+       riece-icon-original-mode-line-buffer-identification)
+  (save-excursion
+    (set-buffer riece-user-list-buffer)
+    (remove-hook 'riece-update-buffer-functions
+                'riece-icon-update-user-list-buffer)
+    (set-buffer riece-channel-list-buffer)
+    (remove-hook 'riece-update-buffer-functions
+                'riece-icon-update-user-list-buffer))
+  (remove-hook 'riece-user-list-mode-hook
+              'riece-icon-user-list-mode-hook)
+  (remove-hook 'riece-channel-list-mode-hook
+              'riece-icon-channel-list-mode-hook))
 
 (defun riece-icon-enable ()
   (setq riece-icon-enabled t)
index 6b091d7..c0dc6a1 100644 (file)
@@ -133,6 +133,10 @@ Otherwise, they are not removed from IRC buffers, but are hidden with
        (mapcar #'riece-parse-identity riece-startup-ignored-user-list))
   (add-hook 'riece-message-filter-functions 'riece-ignore-message-filter))
 
+(defun riece-ignore-uninstall ()
+  (setq riece-ignored-user-list nil)
+  (remove-hook 'riece-message-filter-functions 'riece-ignore-message-filter))
+
 (defun riece-ignore-enable ()
   (define-key riece-command-mode-map
     "\C-ck" 'riece-ignore-user)
index d1fc363..0df4d69 100644 (file)
@@ -58,6 +58,9 @@
 (defun riece-kakasi-insinuate ()
   (add-hook 'riece-message-filter-functions 'riece-kakasi-message-filter))
 
+(defun riece-kakasi-uninstall ()
+  (remove-hook 'riece-message-filter-functions 'riece-kakasi-message-filter))
+
 (defun riece-kakasi-enable ()
   (setq riece-kakasi-process
        (start-process "kakasi" (generate-new-buffer " *riece-kakasi*")
index d357297..739d494 100644 (file)
     (setq riece-keepalive-timer nil)))
 
 (defun riece-keepalive-insinuate ()
-  (add-hook 'riece-after-login-hook #'riece-keepalive-after-login-hook)
-  (add-hook 'riece-after-close-hook #'riece-keepalive-after-close-hook))
+  (add-hook 'riece-after-login-hook 'riece-keepalive-after-login-hook)
+  (add-hook 'riece-after-close-hook 'riece-keepalive-after-close-hook))
+
+(defun riece-keepalive-uninstall ()
+  (remove-hook 'riece-after-login-hook 'riece-keepalive-after-login-hook)
+  (remove-hook 'riece-after-close-hook 'riece-keepalive-after-close-hook))
 
 (provide 'riece-keepalive)
 
index 03b1727..20b479d 100644 (file)
@@ -115,6 +115,9 @@ and the matched message object."
 (defun riece-keyword-insinuate ()
   (add-hook 'riece-message-filter-functions 'riece-keyword-message-filter))
 
+(defun riece-keyword-uninstall ()
+  (remove-hook 'riece-message-filter-functions 'riece-keyword-message-filter))
+
 (defun riece-keyword-enable ()
   (setq riece-keyword-enabled t))
 
index f5ef680..5568996 100644 (file)
@@ -289,6 +289,13 @@ If LINES is t, insert today's logs entirely."
   (add-hook 'riece-channel-buffer-create-functions
            'riece-log-flashback))
 
+(defun riece-log-uninstall ()
+  (setq riece-log-lock-file nil)
+  (remove-hook 'riece-after-display-message-functions
+              'riece-log-display-message-function)
+  (remove-hook 'riece-channel-buffer-create-functions
+              'riece-log-flashback))
+
 (defvar riece-command-mode-map)
 (defun riece-log-enable ()
   (define-key riece-command-mode-map "\C-cd" 'riece-log-dired)
index 43d88e6..f61a11a 100644 (file)
   (add-to-list 'lsdb-after-delete-record-functions
               'riece-lsdb-delete-cache))
 
+(defun riece-lsdb-uninstall ()
+  (setq lsdb-secondary-hash-tables
+       (delq 'riece-lsdb-cache lsdb-secondary-hash-tables)
+       lsdb-after-update-record-functions
+       (delq 'riece-lsdb-update-cache lsdb-after-update-record-functions)
+       lsdb-after-delete-record-functions
+       (delq 'riece-lsdb-delete-cache lsdb-after-delete-record-functions))
+
 (defun riece-lsdb-enable ()
   (define-key riece-command-mode-map
     "\C-c\C-ll" 'riece-lsdb-display-records)
index f658600..612b7b0 100644 (file)
 
 (defvar riece-command-mode-map)
 (defvar riece-menu)
+
+(defun riece-menu-command-mode-hook ()
+  (easy-menu-define riece-menu
+                   riece-command-mode-map
+                   "Riece Menu"
+                   riece-menu-items)
+  (easy-menu-add riece-menu))
+
 (defun riece-menu-insinuate ()
   (add-hook 'riece-command-mode-hook
-           (lambda ()
-             (easy-menu-define riece-menu
-                               riece-command-mode-map
-                               "Riece Menu"
-                               riece-menu-items)
-             (easy-menu-add riece-menu))))
+           'riece-menu-command-mode-hook))
+
+(defun riece-menu-uninstall ()
+  (remove-hook 'riece-command-mode-hook
+              'riece-menu-command-mode-hook)
+  ;;FIXME: couldn't uninstall completely.
+  )
 
 (provide 'riece-menu)
 
index df08384..3d714d8 100644 (file)
@@ -150,6 +150,11 @@ If twice (C-u C-u), then ask the channel."
            'riece-mini-display-message-function)
   (add-hook 'pre-command-hook 'riece-mini-pre-command))
 
+(defun riece-mini-uninstall ()
+  (remove-hook 'riece-after-display-message-functions
+              'riece-mini-display-message-function)
+  (remove-hook 'pre-command-hook 'riece-mini-pre-command))
+
 (defun riece-mini-enable ()
   (setq riece-mini-enabled t))
 
index 1dad2c9..c865df5 100644 (file)
@@ -234,6 +234,9 @@ Only used for sending files."
 (defun riece-ndcc-insinuate ()
   (add-hook 'riece-ctcp-dcc-request-hook 'riece-handle-dcc-request))
 
+(defun riece-ndcc-uninstall ()
+  (remove-hook 'riece-ctcp-dcc-request-hook 'riece-handle-dcc-request))
+
 (defun riece-ndcc-enable ()
   (define-key riece-dialogue-mode-map "\C-ds" 'riece-command-dcc-send)
   (define-key riece-dialogue-mode-map "\C-dr" 'riece-command-dcc-receive))
index 201fd69..3ff44a4 100644 (file)
@@ -355,6 +355,11 @@ end
   (add-to-list 'riece-ctcp-additional-clientinfo "DCC")
   (add-hook 'riece-ctcp-dcc-request-hook 'riece-handle-dcc-request))
 
+(defun riece-rdcc-uninstall ()
+  (setq riece-ctcp-additional-clientinfo
+       (delete "DCC" riece-ctcp-additional-clientinfo))
+  (remove-hook 'riece-ctcp-dcc-request-hook 'riece-handle-dcc-request))
+
 (defun riece-rdcc-enable ()
   (define-key riece-dialogue-mode-map "\C-ds" 'riece-command-dcc-send)
   (define-key riece-dialogue-mode-map "\C-dr" 'riece-command-dcc-receive)
index ef466ce..dcc104d 100644 (file)
            'riece-toolbar-insinuate-in-command-buffer
            t))
 
+(defun riece-toolbar-uninstall ()
+  (remove-hook 'riece-command-mode-hook
+              'riece-toolbar-insinuate-in-command-buffer)
+  ;;FIXME: couldn't uninstall completely.
+  )
+
 (provide 'riece-toolbar)
 
 ;;; riece-toolbar.el ends here
\ No newline at end of file
index e35c0e3..e776f6a 100644 (file)
 ;;;            'riece-guess-channel-from-unread))
   )
 
+(defun riece-unread-uninstall ()
+  (remove-hook 'riece-after-display-message-functions
+              'riece-unread-after-display-message-function)
+  (remove-hook 'riece-after-switch-to-channel-functions
+              'riece-unread-after-switch-to-channel-function)
+  (remove-hook 'riece-format-identity-for-channel-list-buffer-functions
+              'riece-unread-format-identity-for-channel-list-buffer)
+  (remove-hook 'riece-format-identity-for-channel-list-indicator-functions
+              'riece-unread-format-identity-for-channel-list-indicator)
+  (setq riece-channel-list-mark-face-alist
+       (delq (assq ?! riece-channel-list-mark-face-alist)
+             riece-channel-list-mark-face-alist))
+;;;  (if (memq 'riece-guess riece-addons)
+;;;      (add-hook 'riece-guess-channel-try-functions
+;;;            'riece-guess-channel-from-unread))
+  )
+
 (defvar riece-command-mode-map)
 (defvar riece-dialogue-mode-map)
 (defvar riece-channel-list-mode-map)
index 848d24d..dc1c1aa 100644 (file)
@@ -122,16 +122,23 @@ This maps a string \"Bug#12345\" to a URL
          (if (memq 'riece-menu riece-addons)
              '(riece-menu))))
 
+(defun riece-url-command-mode-hook ()
+  (easy-menu-add-item
+   nil (list (car riece-menu-items))
+   '("Open URL..." :filter riece-url-create-menu)))
+
 (defun riece-url-insinuate ()
   (add-hook 'riece-after-insert-functions 'riece-url-scan-region)
   (if (memq 'riece-menu riece-addons)
       (add-hook 'riece-command-mode-hook
-               (lambda ()
-                 (easy-menu-add-item
-                  nil (list (car riece-menu-items))
-                  '("Open URL..." :filter riece-url-create-menu)))
+               'riece-url-command-mode-hook
                t)))
 
+(defun riece-url-uninstall ()
+  (remove-hook 'riece-after-insert-functions 'riece-url-scan-region)
+  (remove-hook 'riece-command-mode-hook
+              'riece-url-command-mode-hook)))
+
 (defun riece-url-enable ()
   (define-key riece-dialogue-mode-map "U" 'riece-command-browse-url)
   (setq riece-url-enabled t))
index 005181b..20b1f4d 100644 (file)
 (defun riece-xface-requires ()
   '(riece-lsdb))
 
+(defun riece-xface-user-list-mode-hook ()
+  (add-hook 'riece-update-buffer-functions
+           'riece-xface-update-user-list-buffer t t))
+
 (defun riece-xface-insinuate ()
   (add-hook 'riece-user-list-mode-hook
-           (lambda ()
-             (add-hook 'riece-update-buffer-functions
-                       'riece-xface-update-user-list-buffer t t))))
+           'riece-xface-user-list-mode-hook))
+
+(defun riece-xface-uninstall ()
+  (remove-hook 'riece-user-list-mode-hook
+              'riece-xface-user-list-mode-hook)
+  (with-current-buffer riece-user-list-buffer
+    (remove-hook 'riece-update-buffer-functions
+                'riece-xface-update-user-list-buffer)))
 
 (defun riece-xface-enable ()
   (setq riece-xface-enabled t)