Commits

Michele Bini committed e5726da

scroll-into.jl (scroll-into-window-with-delay): make sure that a window is actually focused

Comments (0)

Files changed (1)

 (defun scroll-into-window-with-delay ()
   (interactive)
   (let ((w (input-focus)))
-    (when (window-on-top-p w)
-      (when scroll-into-window-timer
-	(delete-timer scroll-into-window-timer)
-	(setq scroll-into-window-timer nil))
-      (when w
+    (when w
+      (when (window-on-top-p w)
+	(when scroll-into-window-timer
+	  (delete-timer scroll-into-window-timer)
+	  (setq scroll-into-window-timer nil))
 	(setq scroll-into-window-timer
 	      (make-timer scroll-into-window 0
 			  (if (scroll-into-window-offscreen-p w)