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: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/compile.el,v
Date: Fri, 19 Jan 2007 02:25:48 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      07/01/19 02:25:48

Index: compile.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/compile.el,v
retrieving revision 1.414
retrieving revision 1.415
diff -u -b -r1.414 -r1.415
--- compile.el  9 Jan 2007 03:12:53 -0000       1.414
+++ compile.el  19 Jan 2007 02:25:48 -0000      1.415
@@ -1494,13 +1494,22 @@
   (with-current-buffer buffer
     (compilation-buffer-internal-p)))
 
-(defmacro compilation-loop (< property-change 1+ error)
-  `(while (,< n 0)
+(defmacro compilation-loop (< property-change 1+ error limit)
+  `(let (opt)
+     (while (,< n 0)
+       (setq opt pt)
       (or (setq pt (,property-change pt 'message))
-         (error ,error compilation-error))
-      ;; prop 'message usually has 2 changes, on and off, so re-search if off
+          ;; Handle the case where where the first error message is
+          ;; at the start of the buffer, and n < 0.
+          (if (or (eq (get-text-property ,limit 'message)
+                      (get-text-property opt 'message))
+                  (eq pt opt))
+              (error ,error compilation-error)
+            (setq pt ,limit)))
+       ;; prop 'message usually has 2 changes, on and off, so
+       ;; re-search if off
       (or (setq msg (get-text-property pt 'message))
-         (if (setq pt (,property-change pt 'message))
+          (if (setq pt (,property-change pt 'message nil ,limit))
              (setq msg (get-text-property pt 'message)))
          (error ,error compilation-error))
       (or (< (cadr msg) compilation-skip-threshold)
@@ -1512,7 +1521,7 @@
          (if compilation-skip-to-next-location
              (eq (car msg) loc))
          ;; count this message only if none of the above are true
-         (setq n (,1+ n)))))
+          (setq n (,1+ n))))))
 
 (defun compilation-next-error (n &optional different-file pt)
   "Move point to the next error in the compilation buffer.
@@ -1542,12 +1551,13 @@
          (compilation-loop > next-single-property-change 1-
                            (if (get-buffer-process (current-buffer))
                                "No more %ss yet"
-                             "Moved past last %s"))
+                             "Moved past last %s")
+                           (point-max))
        ;; Don't move "back" to message at or before point.
        ;; Pass an explicit (point-min) to make sure pt is non-nil.
        (setq pt (previous-single-property-change pt 'message nil (point-min)))
        (compilation-loop < previous-single-property-change 1+
-                         "Moved back before first %s")))
+                         "Moved back before first %s" (point-min))))
     (goto-char pt)
     (or msg
        (error "No %s here" compilation-error))))




reply via email to

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