aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Steingold2010-03-23 14:22:46 -0400
committerSam Steingold2010-03-23 14:22:46 -0400
commitf4087766ce0aebb7c205ccd7ec28dfceb808d567 (patch)
tree380d6ed5e73becc45c1b8c79618536bed82ecd50
parenta764697e5fa14bc650e35a5a0e68a070f755fcc5 (diff)
downloademacs-f4087766ce0aebb7c205ccd7ec28dfceb808d567.tar.gz
emacs-f4087766ce0aebb7c205ccd7ec28dfceb808d567.zip
Fix bug#5620: recalculate all markers on compilation buffer
modifications, not on file modifications. (buffer-modtime): New buffer-local variable: the buffer modification time, for buffers not associated with files. (compilation-mode): Create it. (compilation-filter): Update it. (compilation-next-error-function): Use it instead of `visited-file-modtime' for timestamp.
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/progmodes/compile.el9
2 files changed, 17 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c417eb7246e..6eb3260f445 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12010-03-23 Sam Steingold <sds@gnu.org>
2
3 Fix bug#5620: recalculate all markers on compilation buffer
4 modifications, not on file modifications.
5 * progmodes/compile.el (buffer-modtime): New buffer-local variable:
6 the buffer modification time, for buffers not associated with files.
7 (compilation-mode): Create it.
8 (compilation-filter): Update it.
9 (compilation-next-error-function): Use it instead of
10 `visited-file-modtime' for timestamp.
11
12010-03-23 Juri Linkov <juri@jurta.org> 122010-03-23 Juri Linkov <juri@jurta.org>
2 13
3 Implement Occur multi-line matches. 14 Implement Occur multi-line matches.
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 7e013b87c19..8a858d74dcd 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -733,6 +733,9 @@ Faces `compilation-error-face', `compilation-warning-face',
733 "If non-nil, automatically jump to the next error encountered.") 733 "If non-nil, automatically jump to the next error encountered.")
734(make-variable-buffer-local 'compilation-auto-jump-to-next) 734(make-variable-buffer-local 'compilation-auto-jump-to-next)
735 735
736(defvar buffer-modtime nil
737 "The buffer modification time, for buffers not associated with files.")
738(make-variable-buffer-local 'buffer-modtime)
736 739
737(defvar compilation-skip-to-next-location t 740(defvar compilation-skip-to-next-location t
738 "*If non-nil, skip multiple error messages for the same source location.") 741 "*If non-nil, skip multiple error messages for the same source location.")
@@ -1566,6 +1569,7 @@ Runs `compilation-mode-hook' with `run-mode-hooks' (which see).
1566 mode-name (or name-of-mode "Compilation")) 1569 mode-name (or name-of-mode "Compilation"))
1567 (set (make-local-variable 'page-delimiter) 1570 (set (make-local-variable 'page-delimiter)
1568 compilation-page-delimiter) 1571 compilation-page-delimiter)
1572 (set (make-local-variable 'buffer-modtime) nil)
1569 (compilation-setup) 1573 (compilation-setup)
1570 (setq buffer-read-only t) 1574 (setq buffer-read-only t)
1571 (run-mode-hooks 'compilation-mode-hook)) 1575 (run-mode-hooks 'compilation-mode-hook))
@@ -1781,6 +1785,7 @@ and runs `compilation-filter-hook'."
1781 (unless comint-inhibit-carriage-motion 1785 (unless comint-inhibit-carriage-motion
1782 (comint-carriage-motion (process-mark proc) (point))) 1786 (comint-carriage-motion (process-mark proc) (point)))
1783 (set-marker (process-mark proc) (point)) 1787 (set-marker (process-mark proc) (point))
1788 (set (make-local-variable buffer-modtime) (current-time))
1784 (run-hooks 'compilation-filter-hook)) 1789 (run-hooks 'compilation-filter-hook))
1785 (goto-char pos) 1790 (goto-char pos)
1786 (narrow-to-region min max) 1791 (narrow-to-region min max)
@@ -1954,9 +1959,7 @@ This is the value of `next-error-function' in Compilation buffers."
1954 ;; There may be no timestamp info if the loc is a `fake-loc', 1959 ;; There may be no timestamp info if the loc is a `fake-loc',
1955 ;; but we just checked that the file has been visited before! 1960 ;; but we just checked that the file has been visited before!
1956 (equal (nth 4 loc) 1961 (equal (nth 4 loc)
1957 (setq timestamp 1962 (setq timestamp buffer-modtime)))
1958 (with-current-buffer (marker-buffer (nth 3 loc))
1959 (visited-file-modtime)))))
1960 (with-current-buffer (compilation-find-file marker (caar (nth 2 loc)) 1963 (with-current-buffer (compilation-find-file marker (caar (nth 2 loc))
1961 (cadr (car (nth 2 loc)))) 1964 (cadr (car (nth 2 loc))))
1962 (save-restriction 1965 (save-restriction