comparison lisp/progmodes/compile.el @ 24894:dcb1db1b1105

Deal with compilation-error-screen-columns being buffer-local.
author Karl Heuer <kwzh@gnu.org>
date Sun, 27 Jun 1999 21:43:52 +0000
parents 7b6625bfb652
children a08bfd064439
comparison
equal deleted inserted replaced
24893:c74f4b5eb657 24894:dcb1db1b1105
1519 (setcdr (car next-errors) nil))) 1519 (setcdr (car next-errors) nil)))
1520 (setq next-errors (cdr next-errors))) 1520 (setq next-errors (cdr next-errors)))
1521 ;; Look for the next error. 1521 ;; Look for the next error.
1522 t) 1522 t)
1523 ;; We found the file. Get a marker for this error. 1523 ;; We found the file. Get a marker for this error.
1524 ;; compilation-old-error-list is a buffer-local 1524 ;; compilation-old-error-list and
1525 ;; variable, so we must be careful to extract its value 1525 ;; compilation-error-screen-columns are buffer-local
1526 ;; so we must be careful to extract their value
1526 ;; before switching to the source file buffer. 1527 ;; before switching to the source file buffer.
1527 (let ((errors compilation-old-error-list) 1528 (let ((errors compilation-old-error-list)
1529 (columns compilation-error-screen-columns)
1528 (last-line (nth 1 (cdr next-error))) 1530 (last-line (nth 1 (cdr next-error)))
1529 (column (nth 2 (cdr next-error)))) 1531 (column (nth 2 (cdr next-error))))
1530 (set-buffer buffer) 1532 (set-buffer buffer)
1531 (save-excursion 1533 (save-excursion
1532 (save-restriction 1534 (save-restriction
1533 (widen) 1535 (widen)
1534 (goto-line last-line) 1536 (goto-line last-line)
1535 (if (and column (> column 0)) 1537 (if (and column (> column 0))
1536 ;; Columns in error msgs are 1-origin. 1538 ;; Columns in error msgs are 1-origin.
1537 (if compilation-error-screen-columns 1539 (if columns
1538 (move-to-column (1- column)) 1540 (move-to-column (1- column))
1539 (forward-char (1- column))) 1541 (forward-char (1- column)))
1540 (beginning-of-line)) 1542 (beginning-of-line))
1541 (setcdr next-error (point-marker)) 1543 (setcdr next-error (point-marker))
1542 ;; Make all the other error messages referring 1544 ;; Make all the other error messages referring
1558 (re-search-forward "[\n\C-m]" 1560 (re-search-forward "[\n\C-m]"
1559 nil 'end 1561 nil 'end
1560 lines)) 1562 lines))
1561 (forward-line lines)) 1563 (forward-line lines))
1562 (if (and column (> column 1)) 1564 (if (and column (> column 1))
1563 (if compilation-error-screen-columns 1565 (if columns
1564 (move-to-column (1- column)) 1566 (move-to-column (1- column))
1565 (forward-char (1- column))) 1567 (forward-char (1- column)))
1566 (beginning-of-line)) 1568 (beginning-of-line))
1567 (setq last-line this) 1569 (setq last-line this)
1568 (setcdr (car errors) (point-marker)))) 1570 (setcdr (car errors) (point-marker))))