Mercurial > emacs
comparison lisp/progmodes/compile.el @ 65695:e78a07e4c513
(compilation-error-properties): When getting the file from the
previous error message, correctly decode the new data format.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 26 Sep 2005 00:00:49 +0000 |
parents | ed770a0a7846 |
children | 77732e123c4e |
comparison
equal
deleted
inserted
replaced
65694:c2508361021b | 65695:e78a07e4c513 |
---|---|
612 | 612 |
613 | 613 |
614 ;; This function is the central driver, called when font-locking to gather | 614 ;; This function is the central driver, called when font-locking to gather |
615 ;; all information needed to later jump to corresponding source code. | 615 ;; all information needed to later jump to corresponding source code. |
616 ;; Return a property list with all meta information on this error location. | 616 ;; Return a property list with all meta information on this error location. |
617 | |
617 (defun compilation-error-properties (file line end-line col end-col type fmt) | 618 (defun compilation-error-properties (file line end-line col end-col type fmt) |
618 (unless (< (next-single-property-change (match-beginning 0) 'directory nil (point)) | 619 (unless (< (next-single-property-change (match-beginning 0) 'directory nil (point)) |
619 (point)) | 620 (point)) |
620 (if file | 621 (if file |
621 (if (functionp file) | 622 (if (functionp file) |
626 (setq dir (previous-single-property-change (point) 'directory) | 627 (setq dir (previous-single-property-change (point) 'directory) |
627 dir (if dir (or (get-text-property (1- dir) 'directory) | 628 dir (if dir (or (get-text-property (1- dir) 'directory) |
628 (get-text-property dir 'directory))))) | 629 (get-text-property dir 'directory))))) |
629 (setq file (cons file (car dir))))) | 630 (setq file (cons file (car dir))))) |
630 ;; This message didn't mention one, get it from previous | 631 ;; This message didn't mention one, get it from previous |
631 (setq file (previous-single-property-change (point) 'message) | 632 (let ((prev-pos |
632 file (or (if file | 633 ;; Find the previous message. |
633 (car (nth 2 (car (or (get-text-property (1- file) 'message) | 634 (previous-single-property-change (point) 'message))) |
634 (get-text-property file 'message)))))) | 635 (if prev-pos |
635 '("*unknown*")))) | 636 ;; 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*"))))) | |
636 ;; All of these fields are optional, get them only if we have an index, and | 648 ;; All of these fields are optional, get them only if we have an index, and |
637 ;; it matched some part of the message. | 649 ;; it matched some part of the message. |
638 (and line | 650 (and line |
639 (setq line (match-string-no-properties line)) | 651 (setq line (match-string-no-properties line)) |
640 (setq line (string-to-number line))) | 652 (setq line (string-to-number line))) |