aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-09-24 20:42:08 +0000
committerRichard M. Stallman2006-09-24 20:42:08 +0000
commit63522e3aded5c56f75dca56bc1c0fce8d468ce26 (patch)
tree7c7d064e508b27e4278cdd639d582dd4346ede6e
parente00c3f6fb6adb73db3ffcdf4bf69a125c49e5b6c (diff)
downloademacs-63522e3aded5c56f75dca56bc1c0fce8d468ce26.tar.gz
emacs-63522e3aded5c56f75dca56bc1c0fce8d468ce26.zip
(compilation-goto-locus-delete-o): New fn.
(compilation-goto-locus): Use compilation-goto-locus-delete-o to delete the overlay. Put it on pre-command-hook.
-rw-r--r--lisp/progmodes/compile.el28
1 files changed, 21 insertions, 7 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index e6a6a8ed9c5..7d9ce41229c 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1784,17 +1784,31 @@ and overlay is highlighted between MK and END-MK."
1784 (current-buffer))) 1784 (current-buffer)))
1785 (move-overlay compilation-highlight-overlay 1785 (move-overlay compilation-highlight-overlay
1786 (point) end (current-buffer))) 1786 (point) end (current-buffer)))
1787 (if (numberp next-error-highlight) 1787 (if (or (eq next-error-highlight t)
1788 (setq next-error-highlight-timer 1788 (numberp next-error-highlight))
1789 (run-at-time next-error-highlight nil 'delete-overlay 1789 ;; We want highlighting: delete overlay on next input.
1790 compilation-highlight-overlay))) 1790 (add-hook 'pre-command-hook
1791 (if (not (or (eq next-error-highlight t) 1791 'compilation-goto-locus-delete-o)
1792 (numberp next-error-highlight))) 1792 ;; We don't want highlighting: delete overlay now.
1793 (delete-overlay compilation-highlight-overlay)))))) 1793 (delete-overlay compilation-highlight-overlay))
1794 ;; We want highlighting for a limited time:
1795 ;; set up a timer to delete it.
1796 (when (numberp next-error-highlight)
1797 (setq next-error-highlight-timer
1798 (run-at-time next-error-highlight nil
1799 'compilation-goto-locus-delete-o)))))))
1794 (when (and (eq next-error-highlight 'fringe-arrow)) 1800 (when (and (eq next-error-highlight 'fringe-arrow))
1801 ;; We want a fringe arrow (instead of highlighting).
1795 (setq next-error-overlay-arrow-position 1802 (setq next-error-overlay-arrow-position
1796 (copy-marker (line-beginning-position)))))) 1803 (copy-marker (line-beginning-position))))))
1797 1804
1805(defun compilation-goto-locus-delete-o ()
1806 (delete-overlay compilation-highlight-overlay)
1807 ;; Get rid of timer and hook that would try to do this again.
1808 (if (timerp next-error-highlight-timer)
1809 (cancel-timer next-error-highlight-timer))
1810 (remove-hook 'pre-command-hook
1811 'compilation-goto-locus-delete-o))
1798 1812
1799(defun compilation-find-file (marker filename directory &rest formats) 1813(defun compilation-find-file (marker filename directory &rest formats)
1800 "Find a buffer for file FILENAME. 1814 "Find a buffer for file FILENAME.