614 |
;; This function is the central driver, called when font-locking to gather |
;; This function is the central driver, called when font-locking to gather |
615 |
;; all information needed to later jump to corresponding source code. |
;; all information needed to later jump to corresponding source code. |
616 |
;; Return a property list with all meta information on this error location. |
;; Return a property list with all meta information on this error location. |
617 |
|
|
618 |
(defun compilation-error-properties (file line end-line col end-col type fmt) |
(defun compilation-error-properties (file line end-line col end-col type fmt) |
619 |
(unless (< (next-single-property-change (match-beginning 0) 'directory nil (point)) |
(unless (< (next-single-property-change (match-beginning 0) 'directory nil (point)) |
620 |
(point)) |
(point)) |
629 |
(get-text-property dir 'directory))))) |
(get-text-property dir 'directory))))) |
630 |
(setq file (cons file (car dir))))) |
(setq file (cons file (car dir))))) |
631 |
;; This message didn't mention one, get it from previous |
;; This message didn't mention one, get it from previous |
632 |
(setq file (previous-single-property-change (point) 'message) |
(let ((prev-pos |
633 |
file (or (if file |
;; Find the previous message. |
634 |
(car (nth 2 (car (or (get-text-property (1- file) 'message) |
(previous-single-property-change (point) 'message))) |
635 |
(get-text-property file 'message)))))) |
(if prev-pos |
636 |
'("*unknown*")))) |
;; Get the file structure that belongs to it. |
637 |
|
(let* ((prev |
638 |
|
(or (get-text-property (1- prev-pos) 'message) |
639 |
|
(get-text-property prev-pos 'message))) |
640 |
|
(prev-struct |
641 |
|
(car (nth 2 (car prev))))) |
642 |
|
;; Construct FILE . DIR from that. |
643 |
|
(if prev-struct |
644 |
|
(setq file (cons (car prev-struct) |
645 |
|
(cadr prev-struct)))))) |
646 |
|
(unless file |
647 |
|
(setq file '("*unknown*"))))) |
648 |
;; All of these fields are optional, get them only if we have an index, and |
;; All of these fields are optional, get them only if we have an index, and |
649 |
;; it matched some part of the message. |
;; it matched some part of the message. |
650 |
(and line |
(and line |