changeset 61071:e779ff0ee192

(compilation-goto-locus): Use `next-error-highlight-timer' instead of `sit-for'.
author Juri Linkov <juri@jurta.org>
date Tue, 29 Mar 2005 04:56:44 +0000
parents ed6d9a5fc534
children c37cbd3119bc
files lisp/progmodes/compile.el
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Tue Mar 29 04:55:43 2005 +0000
+++ b/lisp/progmodes/compile.el	Tue Mar 29 04:56:44 2005 +0000
@@ -1613,6 +1613,8 @@
     (compilation-set-window-height w)
 
     (when highlight-regexp
+      (if (timerp next-error-highlight-timer)
+	  (cancel-timer next-error-highlight-timer))
       (unless compilation-highlight-overlay
 	(setq compilation-highlight-overlay
 	      (make-overlay (point-min) (point-min)))
@@ -1632,8 +1634,11 @@
 	      (move-overlay compilation-highlight-overlay
 			    (point) end (current-buffer)))
 	    (if (numberp next-error-highlight)
-		(sit-for next-error-highlight))
-	    (if (not (eq next-error-highlight t))
+		(setq next-error-highlight-timer
+		      (run-at-time next-error-highlight nil 'delete-overlay
+				   compilation-highlight-overlay)))
+	    (if (not (or (eq next-error-highlight t)
+			 (numberp next-error-highlight)))
 		(delete-overlay compilation-highlight-overlay))))))
     (when (and (eq next-error-highlight 'fringe-arrow))
       (set (make-local-variable 'overlay-arrow-position)