[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Erc-commit] [commit][emacs22] erc-track: Assimilate two modules into on
From: |
mwolson |
Subject: |
[Erc-commit] [commit][emacs22] erc-track: Assimilate two modules into one |
Date: |
Sun, 14 Oct 2007 00:48:51 -0400 |
commit e0d7ef316cd19bd21e74e56c76301cd28f81ef30
Author: Michael Olson <address@hidden>
Date: Fri Mar 30 01:14:06 2007 +0000
erc-track: Assimilate two modules into one
2007-03-30 Michael Olson <address@hidden>
* erc-autoaway.el (erc-autoaway-idle-method): Use `if' rather than
`cond' and `set' rather than `set-default'.
* erc-track.el (track): Assimilate track-when-active module, since
there's no need to have two modules in one file -- an option will
do. Remove track-modified-channels alias.
(erc-track-when-inactive): New option which determines whether to
track visible buffers when inactive. The default is not to do so.
git-archimport-id: address@hidden/erc--main--0--patch-121
diff --git a/ChangeLog b/ChangeLog
index 862463e..11ee037 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-03-30 Michael Olson <address@hidden>
+
+ * erc-autoaway.el (erc-autoaway-idle-method): Use `if' rather than
+ `cond' and `set' rather than `set-default'.
+
+ * erc-track.el (track): Assimilate track-when-active module, since
+ there's no need to have two modules in one file -- an option will
+ do. Remove track-modified-channels alias.
+ (erc-track-when-inactive): New option which determines whether to
+ track visible buffers when inactive. The default is not to do so.
+
2007-03-17 Michael Olson <address@hidden>
* erc.texi (Development): Mention ErcDevelopment page on
diff --git a/erc-autoaway.el b/erc-autoaway.el
index 9c0450d..91a1150 100644
--- a/erc-autoaway.el
+++ b/erc-autoaway.el
@@ -154,11 +154,12 @@ definitions of being idle."
(const :tag "Emacs idle time" emacs)
(const :tag "Last IRC action" irc))
:set (lambda (sym val)
- (cond (erc-autoaway-mode
- (erc-autoaway-disable)
- (set-default sym val)
- (erc-autoaway-enable))
- (t (set-default sym val)))))
+ (if erc-autoaway-mode
+ (progn
+ (erc-autoaway-disable)
+ (set sym val)
+ (erc-autoaway-enable))
+ (set sym val))))
(defcustom erc-auto-set-away t
"*If non-nil, set away after `erc-autoaway-idle-seconds' seconds of idling.
diff --git a/erc-track.el b/erc-track.el
index 188e8ee..994d767 100644
--- a/erc-track.el
+++ b/erc-track.el
@@ -492,42 +492,61 @@ START is the minimum length of the name used."
;;; Module
;;;###autoload (autoload 'erc-track-mode "erc-track" nil t)
-(define-erc-module track track-modified-channels
+(define-erc-module track nil
"This mode tracks ERC channel buffers with activity."
- ((erc-track-add-to-mode-line erc-track-position-in-mode-line)
- (setq erc-modified-channels-object (erc-modified-channels-object nil))
- (erc-update-mode-line)
- (if (featurep 'xemacs)
- (defadvice switch-to-buffer (after erc-update (&rest args) activate)
- (erc-modified-channels-update))
- (add-hook 'window-configuration-change-hook
'erc-modified-channels-update))
- (add-hook 'erc-insert-post-hook 'erc-track-modified-channels)
- (add-hook 'erc-disconnected-hook 'erc-modified-channels-update))
- ((erc-track-remove-from-mode-line)
- (if (featurep 'xemacs)
- (ad-disable-advice 'switch-to-buffer 'after 'erc-update)
- (remove-hook 'window-configuration-change-hook
- 'erc-modified-channels-update))
- (remove-hook 'erc-disconnected-hook 'erc-modified-channels-update)
- (remove-hook 'erc-insert-post-hook 'erc-track-modified-channels)))
-
-;;;###autoload (autoload 'erc-track-when-inactive-mode "erc-track" nil t)
-(define-erc-module track-when-inactive nil
- "This mode enables channel tracking even for visible buffers,
-if you are inactivity."
- ((if (featurep 'xemacs)
- (defadvice switch-to-buffer (after erc-update-when-inactive (&rest
args) activate)
- (erc-user-is-active))
- (add-hook 'window-configuration-change-hook 'erc-user-is-active))
- (add-hook 'erc-send-completed-hook 'erc-user-is-active)
- (add-hook 'erc-server-001-functions 'erc-user-is-active))
- ((erc-track-remove-from-mode-line)
- (if (featurep 'xemacs)
- (ad-disable-advice 'switch-to-buffer 'after 'erc-update-when-inactive)
- (remove-hook 'window-configuration-change-hook 'erc-user-is-active))
- (remove-hook 'erc-send-completed-hook 'erc-user-is-active)
- (remove-hook 'erc-server-001-functions 'erc-user-is-active)
- (remove-hook 'erc-timer-hook 'erc-user-is-active)))
+ ;; Enable:
+ ((when (boundp 'erc-track-when-inactive)
+ (if erc-track-when-inactive
+ (progn
+ (if (featurep 'xemacs)
+ (defadvice switch-to-buffer (after erc-update-when-inactive
+ (&rest args) activate)
+ (erc-user-is-active))
+ (add-hook 'window-configuration-change-hook 'erc-user-is-active))
+ (add-hook 'erc-send-completed-hook 'erc-user-is-active)
+ (add-hook 'erc-server-001-functions 'erc-user-is-active))
+ (erc-track-add-to-mode-line erc-track-position-in-mode-line)
+ (setq erc-modified-channels-object (erc-modified-channels-object nil))
+ (erc-update-mode-line)
+ (if (featurep 'xemacs)
+ (defadvice switch-to-buffer (after erc-update (&rest args) activate)
+ (erc-modified-channels-update))
+ (add-hook 'window-configuration-change-hook
+ 'erc-modified-channels-update))
+ (add-hook 'erc-insert-post-hook 'erc-track-modified-channels)
+ (add-hook 'erc-disconnected-hook 'erc-modified-channels-update))))
+ ;; Disable:
+ ((when (boundp 'erc-track-when-inactive)
+ (erc-track-remove-from-mode-line)
+ (if erc-track-when-inactive
+ (progn
+ (if (featurep 'xemacs)
+ (ad-disable-advice 'switch-to-buffer 'after
+ 'erc-update-when-inactive)
+ (remove-hook 'window-configuration-change-hook
+ 'erc-user-is-active))
+ (remove-hook 'erc-send-completed-hook 'erc-user-is-active)
+ (remove-hook 'erc-server-001-functions 'erc-user-is-active)
+ (remove-hook 'erc-timer-hook 'erc-user-is-active))
+ (if (featurep 'xemacs)
+ (ad-disable-advice 'switch-to-buffer 'after 'erc-update)
+ (remove-hook 'window-configuration-change-hook
+ 'erc-modified-channels-update))
+ (remove-hook 'erc-disconnected-hook 'erc-modified-channels-update)
+ (remove-hook 'erc-insert-post-hook 'erc-track-modified-channels)))))
+
+(defcustom erc-track-when-inactive nil
+ "Enable channel tracking even for visible buffers, if you are
+inactive."
+ :group 'erc-track
+ :type 'boolean
+ :set (lambda (sym val)
+ (if erc-track-mode
+ (progn
+ (erc-track-disable)
+ (set sym val)
+ (erc-track-enable))
+ (set sym val))))
;;; Visibility
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Erc-commit] [commit][emacs22] erc-track: Assimilate two modules into one,
mwolson <=