aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJuri Linkov2004-09-02 16:35:17 +0000
committerJuri Linkov2004-09-02 16:35:17 +0000
commit9dc3a46a444a46e00ed3287a3174d73ed9511dac (patch)
treefaae7909ed6ba03fd65eb93e1701e3c3a4b8c714 /lisp
parentb10daec70920a4d17425bdfe816f2e4ec1a793e1 (diff)
downloademacs-9dc3a46a444a46e00ed3287a3174d73ed9511dac.tar.gz
emacs-9dc3a46a444a46e00ed3287a3174d73ed9511dac.zip
(compilation-error-properties): Allow to funcall col and end-col.
(compilation-mode-font-lock-keywords): Check col and end-col by `integerp'. (compilation-goto-locus): If end-mk is non-nil in transient mark mode don't activate the mark (and don't display message in push-mark), but highlight overlay between mk and end-mk.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/compile.el33
1 files changed, 19 insertions, 14 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 7a0aa42faff..ea174233289 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -579,12 +579,17 @@ Faces `compilation-error-face', `compilation-warning-face',
579 (and end-line 579 (and end-line
580 (setq end-line (match-string-no-properties end-line)) 580 (setq end-line (match-string-no-properties end-line))
581 (setq end-line (string-to-number end-line))) 581 (setq end-line (string-to-number end-line)))
582 (and col 582 (if col
583 (setq col (match-string-no-properties col)) 583 (if (functionp col)
584 (setq col (- (string-to-number col) compilation-first-column))) 584 (setq col (funcall col))
585 (if (and end-col (setq end-col (match-string-no-properties end-col))) 585 (and
586 (setq end-col (- (string-to-number end-col) compilation-first-column -1)) 586 (setq col (match-string-no-properties col))
587 (if end-line (setq end-col -1))) 587 (setq col (- (string-to-number col) compilation-first-column)))))
588 (if (and end-col (functionp end-col))
589 (setq end-col (funcall end-col))
590 (if (and end-col (setq end-col (match-string-no-properties end-col)))
591 (setq end-col (- (string-to-number end-col) compilation-first-column -1))
592 (if end-line (setq end-col -1))))
588 (if (consp type) ; not a static type, check what it is. 593 (if (consp type) ; not a static type, check what it is.
589 (setq type (or (and (car type) (match-end (car type)) 1) 594 (setq type (or (and (car type) (match-end (car type)) 1)
590 (and (cdr type) (match-end (cdr type)) 0) 595 (and (cdr type) (match-end (cdr type)) 0)
@@ -726,9 +731,9 @@ FILE should be (ABSOLUTE-FILENAME) or (RELATIVE-FILENAME . DIRNAME) or nil."
726 ,@(when end-line 731 ,@(when end-line
727 `((,end-line compilation-line-face nil t))) 732 `((,end-line compilation-line-face nil t)))
728 733
729 ,@(when col 734 ,@(when (integerp col)
730 `((,col compilation-column-face nil t))) 735 `((,col compilation-column-face nil t)))
731 ,@(when end-col 736 ,@(when (integerp end-col)
732 `((,end-col compilation-column-face nil t))) 737 `((,end-col compilation-column-face nil t)))
733 738
734 ,@(nthcdr 6 item) 739 ,@(nthcdr 6 item)
@@ -1524,7 +1529,8 @@ If nil, don't scroll the compilation output window."
1524 1529
1525(defun compilation-goto-locus (msg mk end-mk) 1530(defun compilation-goto-locus (msg mk end-mk)
1526 "Jump to an error corresponding to MSG at MK. 1531 "Jump to an error corresponding to MSG at MK.
1527All arguments are markers. If END-MK is non-nil, mark is set there." 1532All arguments are markers. If END-MK is non-nil, mark is set there
1533and overlay is highlighted between MK and END-MK."
1528 (if (eq (window-buffer (selected-window)) 1534 (if (eq (window-buffer (selected-window))
1529 (marker-buffer msg)) 1535 (marker-buffer msg))
1530 ;; If the compilation buffer window is selected, 1536 ;; If the compilation buffer window is selected,
@@ -1540,7 +1546,7 @@ All arguments are markers. If END-MK is non-nil, mark is set there."
1540 (widen) 1546 (widen)
1541 (goto-char mk)) 1547 (goto-char mk))
1542 (if end-mk 1548 (if end-mk
1543 (push-mark end-mk nil t) 1549 (push-mark end-mk t)
1544 (if mark-active (setq mark-active))) 1550 (if mark-active (setq mark-active)))
1545 ;; If hideshow got in the way of 1551 ;; If hideshow got in the way of
1546 ;; seeing the right place, open permanently. 1552 ;; seeing the right place, open permanently.
@@ -1561,17 +1567,16 @@ All arguments are markers. If END-MK is non-nil, mark is set there."
1561 compilation-highlight-regexp))) 1567 compilation-highlight-regexp)))
1562 (compilation-set-window-height w) 1568 (compilation-set-window-height w)
1563 1569
1564 (when (and highlight-regexp 1570 (when highlight-regexp
1565 (not (and end-mk transient-mark-mode)))
1566 (unless compilation-highlight-overlay 1571 (unless compilation-highlight-overlay
1567 (setq compilation-highlight-overlay 1572 (setq compilation-highlight-overlay
1568 (make-overlay (point-min) (point-min))) 1573 (make-overlay (point-min) (point-min)))
1569 (overlay-put compilation-highlight-overlay 'face 'next-error)) 1574 (overlay-put compilation-highlight-overlay 'face 'next-error))
1570 (with-current-buffer (marker-buffer mk) 1575 (with-current-buffer (marker-buffer mk)
1571 (save-excursion 1576 (save-excursion
1572 (end-of-line) 1577 (if end-mk (goto-char end-mk) (end-of-line))
1573 (let ((end (point))) 1578 (let ((end (point)))
1574 (beginning-of-line) 1579 (if mk (goto-char mk) (beginning-of-line))
1575 (if (and (stringp highlight-regexp) 1580 (if (and (stringp highlight-regexp)
1576 (re-search-forward highlight-regexp end t)) 1581 (re-search-forward highlight-regexp end t))
1577 (progn 1582 (progn