* riece-highlight.el (riece-highlight-uninstall): Use
[riece] / lisp / riece-history.el
index 79dd389..497a272 100644 (file)
 
 (require 'riece-options)
 (require 'riece-globals)
-(require 'riece-highlight)
 (require 'riece-identity)
 (require 'riece-signal)
 (require 'ring)
+(require 'riece-highlight)
 
 (defgroup riece-history nil
   "Manage history of channel shifting."
 ;;;   (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-requires ()
+  (if (memq 'riece-highlight riece-addons)
+      '(riece-highlight)))
+
 (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))