emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/compile.el,v


From: Sam Steingold
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/compile.el,v
Date: Sun, 03 Jun 2007 18:56:18 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Sam Steingold <sds>     07/06/03 18:56:17

Index: progmodes/compile.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/compile.el,v
retrieving revision 1.425
retrieving revision 1.426
diff -u -b -r1.425 -r1.426
--- progmodes/compile.el        23 May 2007 08:11:59 -0000      1.425
+++ progmodes/compile.el        3 Jun 2007 18:56:15 -0000       1.426
@@ -38,11 +38,14 @@
 ;; LINE will be nil for a message that doesn't contain them.  Then the
 ;; location refers to a indented beginning of line or beginning of file.
 ;; Once any location in some file has been jumped to, the list is extended to
-;; (COLUMN LINE FILE-STRUCTURE MARKER . VISITED) for all LOCs pertaining to
-;; that file.
+;; (COLUMN LINE FILE-STRUCTURE MARKER TIMESTAMP . VISITED)
+;; for all LOCs pertaining to that file.
 ;; MARKER initially points to LINE and COLUMN in a buffer visiting that file.
 ;; Being a marker it sticks to some text, when the buffer grows or shrinks
 ;; before that point.  VISITED is t if we have jumped there, else nil.
+;; TIMESTAMP is necessary because of "incremental compilation": `omake -P'
+;; polls filesystem for changes and recompiles when a file is modified
+;; using the same *compilation* buffer. this necessitates re-parsing markers.
 
 ;;   FILE-STRUCTURE is a list of
 ;;   ((FILENAME . DIRECTORY) FORMATS (LINE LOC ...) ...)
@@ -1516,7 +1519,7 @@
               (eq (prog1 last (setq last (nth 2 (car msg))))
                   last))
           (if compilation-skip-visited
-              (nthcdr 4 (car msg)))
+              (nthcdr 5 (car msg)))
           (if compilation-skip-to-next-location
               (eq (car msg) loc))
           ;; count this message only if none of the above are true
@@ -1619,7 +1622,7 @@
   (when reset
     (setq compilation-current-error nil))
   (let* ((columns compilation-error-screen-columns) ; buffer's local value
-        (last 1)
+        (last 1) timestamp
         (loc (compilation-next-error (or n 1) nil
                                      (or compilation-current-error
                                          compilation-messages-start
@@ -1632,10 +1635,17 @@
                compilation-current-error
              (copy-marker (line-beginning-position)))
          loc (car loc))
-    ;; If loc contains no marker, no error in that file has been visited.  If
-    ;; the marker is invalid the buffer has been killed.  So, recalculate all
-    ;; markers for that file.
-    (unless (and (nth 3 loc) (marker-buffer (nth 3 loc)))
+    ;; If loc contains no marker, no error in that file has been visited.
+    ;; If the marker is invalid the buffer has been killed.
+    ;; If the file is newer than the timestamp, it has been modified
+    ;; (`omake -P' polls filesystem for changes and recompiles when needed
+    ;;  in the same process and buffer).
+    ;; So, recalculate all markers for that file.
+    (unless (and (nth 3 loc) (marker-buffer (nth 3 loc))
+                 (equal (nth 4 loc)
+                        (setq timestamp
+                              (with-current-buffer (marker-buffer (nth 3 loc))
+                                (visited-file-modtime)))))
       (with-current-buffer (compilation-find-file marker (caar (nth 2 loc))
                                                  (cadr (car (nth 2 loc))))
        (save-restriction
@@ -1658,7 +1668,8 @@
                  (set-marker (nth 3 col) (point))
                (setcdr (nthcdr 2 col) `(,(point-marker)))))))))
     (compilation-goto-locus marker (nth 3 loc) (nth 3 end-loc))
-    (setcdr (nthcdr 3 loc) t)))                ; Set this one as visited.
+    (setcdr (nthcdr 3 loc) (list timestamp))
+    (setcdr (nthcdr 4 loc) t)))                ; Set this one as visited.
 
 (defvar compilation-gcpro nil
   "Internal variable used to keep some values from being GC'd.")




reply via email to

[Prev in Thread] Current Thread [Next in Thread]