aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pfeiffer2004-04-01 10:42:04 +0000
committerDaniel Pfeiffer2004-04-01 10:42:04 +0000
commit51c8ad03e04265489438cb50e6af26935fffe446 (patch)
tree3d26dc9f2cb33cdb90a4d3965fa7ea0fa48794df
parent38253bba6643abe738e9a8c2b04c9151ba509cbc (diff)
downloademacs-51c8ad03e04265489438cb50e6af26935fffe446.tar.gz
emacs-51c8ad03e04265489438cb50e6af26935fffe446.zip
C-x ` fixes
-rw-r--r--lisp/progmodes/compile.el46
1 files changed, 29 insertions, 17 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 8415fd2050e..05fb8ee059d 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -227,7 +227,7 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
227 ("`\\(\\(\\S +?\\)\\(?::\\([0-9]+\\)\\)?\\)'" nil nil 227 ("`\\(\\(\\S +?\\)\\(?::\\([0-9]+\\)\\)?\\)'" nil nil
228 (2 compilation-info-face) 228 (2 compilation-info-face)
229 (3 compilation-line-face nil t) 229 (3 compilation-line-face nil t)
230 (1 (compilation-error-properties 2 3 nil nil nil 2 nil) 230 (1 (compilation-error-properties 2 3 nil nil nil 0 nil)
231 append))) 231 append)))
232 232
233 (mips-1 233 (mips-1
@@ -1076,11 +1076,17 @@ variable exists."
1076 (if (or noconfirm (yes-or-no-p (format "Restart compilation? "))) 1076 (if (or noconfirm (yes-or-no-p (format "Restart compilation? ")))
1077 (apply 'compilation-start compilation-arguments)))) 1077 (apply 'compilation-start compilation-arguments))))
1078 1078
1079;; This points to the location from where the next error will be found.
1080;; The global commands next/previous/first-error... as well as
1081;; (mouse-)goto-error use this.
1082(defvar compilation-current-error nil)
1083
1079;; A function name can't be a hook, must be something with a value. 1084;; A function name can't be a hook, must be something with a value.
1080(defconst compilation-turn-on-font-lock 'turn-on-font-lock) 1085(defconst compilation-turn-on-font-lock 'turn-on-font-lock)
1081 1086
1082(defun compilation-setup (&optional minor) 1087(defun compilation-setup (&optional minor)
1083 "Prepare the buffer for the compilation parsing commands to work." 1088 "Prepare the buffer for the compilation parsing commands to work."
1089 (make-local-variable 'compilation-current-error)
1084 (make-local-variable 'compilation-error-screen-columns) 1090 (make-local-variable 'compilation-error-screen-columns)
1085 (setq compilation-last-buffer (current-buffer)) 1091 (setq compilation-last-buffer (current-buffer))
1086 (if minor 1092 (if minor
@@ -1233,7 +1239,7 @@ Just inserts the text, but uses `insert-before-markers'."
1233 ;; count this message only if none of the above are true 1239 ;; count this message only if none of the above are true
1234 (setq n (,1+ n))))) 1240 (setq n (,1+ n)))))
1235 1241
1236(defun compilation-next-error (n &optional different-file) 1242(defun compilation-next-error (n &optional different-file pt)
1237 "Move point to the next error in the compilation buffer. 1243 "Move point to the next error in the compilation buffer.
1238Prefix arg N says how many error messages to move forwards (or 1244Prefix arg N says how many error messages to move forwards (or
1239backwards, if negative). 1245backwards, if negative).
@@ -1241,11 +1247,11 @@ Does NOT find the source line like \\[next-error]."
1241 (interactive "p") 1247 (interactive "p")
1242 (or (compilation-buffer-p (current-buffer)) 1248 (or (compilation-buffer-p (current-buffer))
1243 (error "Not in a compilation buffer")) 1249 (error "Not in a compilation buffer"))
1250 (or pt (setq pt (point)))
1244 (setq compilation-last-buffer (current-buffer)) 1251 (setq compilation-last-buffer (current-buffer))
1245 (let* ((pt (point)) 1252 (let* ((msg (get-text-property pt 'message))
1246 (msg (get-text-property pt 'message)) 1253 (loc (car msg))
1247 (loc (car msg)) 1254 last)
1248 last)
1249 (if (zerop n) 1255 (if (zerop n)
1250 (unless (or msg ; find message near here 1256 (unless (or msg ; find message near here
1251 (setq msg (get-text-property (max (1- pt) 1) 'message))) 1257 (setq msg (get-text-property (max (1- pt) 1) 'message)))
@@ -1263,13 +1269,15 @@ Does NOT find the source line like \\[next-error]."
1263 (setq msg (get-text-property pt 'message)) 1269 (setq msg (get-text-property pt 'message))
1264 (setq pt (point))))) 1270 (setq pt (point)))))
1265 (setq last (nth 2 (car msg))) 1271 (setq last (nth 2 (car msg)))
1266 ;; These loops search only either forwards or backwards 1272 (if (>= n 0)
1267 (compilation-loop > next-single-property-change 1- 1273 (compilation-loop > next-single-property-change 1-
1268 (if (get-buffer-process (current-buffer)) 1274 (if (get-buffer-process (current-buffer))
1269 "No more %ss yet" 1275 "No more %ss yet"
1270 "Moved past last %s")) 1276 "Moved past last %s"))
1271 (compilation-loop < previous-single-property-change 1+ 1277 ;; don't move "back" to message at or before point
1272 "Moved back before first %s")) 1278 (setq pt (previous-single-property-change pt 'message))
1279 (compilation-loop < previous-single-property-change 1+
1280 "Moved back before first %s")))
1273 (goto-char pt) 1281 (goto-char pt)
1274 (or msg 1282 (or msg
1275 (error "No %s here" compilation-error)))) 1283 (error "No %s here" compilation-error))))
@@ -1327,6 +1335,7 @@ Prefix arg N says how many files to move backwards (or forwards, if negative)."
1327 (mouse-set-point event) 1335 (mouse-set-point event)
1328 (if (get-text-property (point) 'directory) 1336 (if (get-text-property (point) 'directory)
1329 (dired-other-window (car (get-text-property (point) 'directory))) 1337 (dired-other-window (car (get-text-property (point) 'directory)))
1338 (setq compilation-current-error (point))
1330 (next-error 0))) 1339 (next-error 0)))
1331 1340
1332(defun compile-goto-error () 1341(defun compile-goto-error ()
@@ -1338,6 +1347,7 @@ Use this command in a compilation log buffer. Sets the mark at point there."
1338 (if (get-text-property (point) 'directory) 1347 (if (get-text-property (point) 'directory)
1339 (dired-other-window (car (get-text-property (point) 'directory))) 1348 (dired-other-window (car (get-text-property (point) 'directory)))
1340 (push-mark) 1349 (push-mark)
1350 (setq compilation-current-error (point))
1341 (next-error 0))) 1351 (next-error 0)))
1342 1352
1343;; Return a compilation buffer. 1353;; Return a compilation buffer.
@@ -1393,10 +1403,12 @@ See variable `compilation-error-regexp-alist' for customization ideas."
1393 (set-buffer (setq compilation-last-buffer (compilation-find-buffer))) 1403 (set-buffer (setq compilation-last-buffer (compilation-find-buffer)))
1394 (let* ((columns compilation-error-screen-columns) ; buffer's local value 1404 (let* ((columns compilation-error-screen-columns) ; buffer's local value
1395 (last 1) 1405 (last 1)
1396 (loc (compilation-next-error (or n 1))) 1406 (loc (compilation-next-error (or n 1) nil
1407 (or compilation-current-error (point-min))))
1397 (end-loc (nth 2 loc)) 1408 (end-loc (nth 2 loc))
1398 (marker (point-marker))) 1409 (marker (point-marker)))
1399 (setq loc (car loc)) 1410 (setq compilation-current-error (point-marker)
1411 loc (car loc))
1400 ;; If loc contains no marker, no error in that file has been visited. If 1412 ;; If loc contains no marker, no error in that file has been visited. If
1401 ;; the marker is invalid the buffer has been killed. So, recalculate all 1413 ;; the marker is invalid the buffer has been killed. So, recalculate all
1402 ;; markers for that file. 1414 ;; markers for that file.
@@ -1448,10 +1460,10 @@ With prefix arg N, visit the source code of the Nth error.
1448This operates on the output from the \\[compile] command." 1460This operates on the output from the \\[compile] command."
1449 (interactive "p") 1461 (interactive "p")
1450 (set-buffer (setq compilation-last-buffer (compilation-find-buffer))) 1462 (set-buffer (setq compilation-last-buffer (compilation-find-buffer)))
1451 (goto-char (point-min)) 1463 (setq compilation-current-error (point-min))
1452 (next-error n)) 1464 (next-error n))
1453 1465
1454(defvar compilation-skip-to-next-location nil 1466(defvar compilation-skip-to-next-location t
1455 "*If non-nil, skip multiple error messages for the same source location.") 1467 "*If non-nil, skip multiple error messages for the same source location.")
1456 1468
1457(defcustom compilation-skip-threshold 1 1469(defcustom compilation-skip-threshold 1