emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103198: Fix tracking visibility in E


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103198: Fix tracking visibility in ERC.
Date: Tue, 08 Feb 2011 23:08:25 -0500
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103198
author: Julien Danjou <address@hidden>
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Tue 2011-02-08 23:08:25 -0500
message:
  Fix tracking visibility in ERC.
  
  * lisp/erc/erc-track.el (erc-window-configuration-change): New function.
  This will allow to track buffer visibility when a command is
  finished to executed.  Idea stolen from rcirc.
  (track): Put erc-window-configuration-change in
  window-configuration-change-hook.
  (erc-modified-channels-update): Remove
  erc-modified-channels-update from post-command-hook after update.
modified:
  lisp/erc/ChangeLog
  lisp/erc/erc-track.el
=== modified file 'lisp/erc/ChangeLog'
--- a/lisp/erc/ChangeLog        2011-01-31 23:54:50 +0000
+++ b/lisp/erc/ChangeLog        2011-02-09 04:08:25 +0000
@@ -1,3 +1,13 @@
+2011-02-07  Julien Danjou  <address@hidden>
+
+       * erc-track.el (erc-window-configuration-change): New function.
+       This will allow to track buffer visibility when a command is
+       finished to executed.  Idea stolen from rcirc.
+       (track): Put erc-window-configuration-change in
+       window-configuration-change-hook.
+       (erc-modified-channels-update): Remove
+       erc-modified-channels-update from post-command-hook after update.
+
 2011-01-31  Antoine Levitt  <address@hidden>  (tiny change)
 
        * erc-track.el (track): Don't reset erc-modified-channels-object

=== modified file 'lisp/erc/erc-track.el'
--- a/lisp/erc/erc-track.el     2011-01-31 23:54:50 +0000
+++ b/lisp/erc/erc-track.el     2011-02-09 04:08:25 +0000
@@ -653,7 +653,7 @@
           (defadvice switch-to-buffer (after erc-update (&rest args) activate)
             (erc-modified-channels-update))
         (add-hook 'window-configuration-change-hook
-                  'erc-modified-channels-update))
+                  'erc-window-configuration-change))
        (add-hook 'erc-insert-post-hook 'erc-track-modified-channels)
        (add-hook 'erc-disconnected-hook 'erc-modified-channels-update))
      ;; enable the tracking keybindings
@@ -675,7 +675,7 @@
        (if (featurep 'xemacs)
           (ad-disable-advice 'switch-to-buffer 'after 'erc-update)
         (remove-hook 'window-configuration-change-hook
-                     'erc-modified-channels-update))
+                     'erc-window-configuration-change))
        (remove-hook 'erc-disconnected-hook 'erc-modified-channels-update)
        (remove-hook 'erc-insert-post-hook 'erc-track-modified-channels))
      ;; disable the tracking keybindings
@@ -730,6 +730,12 @@
 
 ;;; Tracking the channel modifications
 
+(defun erc-window-configuration-change ()
+  (unless (minibuffer-window-active-p (minibuffer-window))
+    ;; delay this until command has finished to make sure window is
+    ;; actually visible before clearing activity
+    (add-hook 'post-command-hook 'erc-modified-channels-update)))
+
 (defvar erc-modified-channels-update-inside nil
   "Variable to prevent running `erc-modified-channels-update' multiple
 times.  Without it, you cannot debug `erc-modified-channels-display',
@@ -757,8 +763,9 @@
                  (erc-modified-channels-remove-buffer buffer))))
            erc-modified-channels-alist)
       (when removed-channel
-      (erc-modified-channels-display)
-       (force-mode-line-update t)))))
+       (erc-modified-channels-display)
+       (force-mode-line-update t)))
+    (remove-hook 'post-command-hook 'erc-modified-channels-update)))
 
 (defvar erc-track-mouse-face (if (featurep 'xemacs)
                                 'modeline-mousable


reply via email to

[Prev in Thread] Current Thread [Next in Thread]