]> git.eshelyaron.com Git - emacs.git/commitdiff
(follow-mode): Don't run hooks twice. Use `when'.
authorJuanma Barranquero <lekktu@gmail.com>
Mon, 8 Oct 2007 16:13:18 +0000 (16:13 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Mon, 8 Oct 2007 16:13:18 +0000 (16:13 +0000)
lisp/ChangeLog
lisp/follow.el

index b98dac1e432ab53f8a712df83634441de2f3b9d6..b8dab0b4989f491ddbd53d6391f84af3dae55782 100644 (file)
@@ -1,3 +1,7 @@
+2007-10-08  Juanma Barranquero  <lekktu@gmail.com>
+
+       * follow.el (follow-mode): Don't run hooks twice.  Use `when'.
+
 2007-10-07  Glenn Morris  <rgm@gnu.org>
 
        * simple.el (bad-packages-alist): Clarify Semantic and CEDET
index e28edae846e0138a2f0df54968c8efd4ae3aa9ce..eddb1037a43e67f40dfc60c96b187b38aaf1e3e0 100644 (file)
@@ -602,20 +602,18 @@ is called.  When turned off, `follow-mode-off-hook' is called.
 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