changeset 85087:1876f72f31dd

(follow-mode): Don't run hooks twice. Use `when'.
author Juanma Barranquero <lekktu@gmail.com>
date Mon, 08 Oct 2007 16:06:15 +0000
parents 475e4a800591
children f3b4c3cf62f0
files lisp/follow.el
diffstat 1 files changed, 6 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/follow.el	Mon Oct 08 14:48:39 2007 +0000
+++ b/lisp/follow.el	Mon Oct 08 16:06:15 2007 +0000
@@ -523,20 +523,18 @@
 Keys specific to Follow mode:
 \\{follow-mode-map}"
   :keymap follow-mode-map
-  (if (and follow-mode follow-intercept-processes)
-      (follow-intercept-process-output))
+  (when (and follow-mode follow-intercept-processes)
+    (follow-intercept-process-output))
   (cond (follow-mode ; On
          ;; XEmacs: If this is non-nil, the window will scroll before
          ;; the point will have a chance to get into the next window.
-         (if (boundp 'scroll-on-clipped-lines)
-             (setq scroll-on-clipped-lines nil))
+         (when (boundp 'scroll-on-clipped-lines)
+	   (setq scroll-on-clipped-lines nil))
          (force-mode-line-update)
-         (add-hook 'post-command-hook 'follow-post-command-hook t)
-         (run-hooks 'follow-mode-hook))
+         (add-hook 'post-command-hook 'follow-post-command-hook t))
 
         ((not follow-mode) ; Off
-         (force-mode-line-update)
-         (run-hooks 'follow-mode-off-hook))))
+         (force-mode-line-update))))
 
 ;;}}}
 ;;{{{ Find file hook