comparison lisp/progmodes/compile.el @ 105573:e7f57b24c0a2

(compilation-next-error-function): Fix the timestamps if the buffer has been visited before
author Sam Steingold <sds@gnu.org>
date Mon, 12 Oct 2009 20:42:45 +0000
parents 9caaade61f03
children 5d7b16939e28
comparison
equal deleted inserted replaced
105572:be1e297cc4d5 105573:e7f57b24c0a2
1942 ;; If the marker is invalid the buffer has been killed. 1942 ;; If the marker is invalid the buffer has been killed.
1943 ;; If the file is newer than the timestamp, it has been modified 1943 ;; If the file is newer than the timestamp, it has been modified
1944 ;; (`omake -P' polls filesystem for changes and recompiles when needed 1944 ;; (`omake -P' polls filesystem for changes and recompiles when needed
1945 ;; in the same process and buffer). 1945 ;; in the same process and buffer).
1946 ;; So, recalculate all markers for that file. 1946 ;; So, recalculate all markers for that file.
1947 (unless (and (nth 3 loc) (marker-buffer (nth 3 loc)) 1947 (unless (and (nth 3 loc) (marker-buffer (nth 3 loc)) (nthcdr 4 loc)
1948 ;; There may be no timestamp info if the loc is a `fake-loc'. 1948 ;; There may be no timestamp info if the loc is a `fake-loc',
1949 ;; So we skip the time-check here, although we should maybe 1949 ;; but we just checked that the file has been visited before!
1950 ;; change `compilation-fake-loc' to add timestamp info. 1950 (equal (nth 4 loc)
1951 (or (null (nth 4 loc)) 1951 (setq timestamp
1952 (equal (nth 4 loc) 1952 (with-current-buffer (marker-buffer (nth 3 loc))
1953 (setq timestamp 1953 (visited-file-modtime)))))
1954 (with-current-buffer
1955 (marker-buffer (nth 3 loc))
1956 (visited-file-modtime))))))
1957 (with-current-buffer (compilation-find-file marker (caar (nth 2 loc)) 1954 (with-current-buffer (compilation-find-file marker (caar (nth 2 loc))
1958 (cadr (car (nth 2 loc)))) 1955 (cadr (car (nth 2 loc))))
1959 (save-restriction 1956 (save-restriction
1960 (widen) 1957 (widen)
1961 (goto-char (point-min)) 1958 (goto-char (point-min))