1 |
;;; compile.el --- run compiler as inferior of Emacs, parse error messages |
;;; compile.el --- run compiler as inferior of Emacs, parse error messages |
2 |
|
|
3 |
;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 1999, 2001, 03, 2004 |
;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
4 |
;; Free Software Foundation, Inc. |
;; 2001, 2003, 2004 Free Software Foundation, Inc. |
5 |
|
|
6 |
;; Authors: Roland McGrath <roland@gnu.org>, |
;; Authors: Roland McGrath <roland@gnu.org>, |
7 |
;; Daniel Pfeiffer <occitan@esperanto.org> |
;; Daniel Pfeiffer <occitan@esperanto.org> |
606 |
2))) |
2))) |
607 |
(compilation-internal-error-properties file line end-line col end-col type fmt))) |
(compilation-internal-error-properties file line end-line col end-col type fmt))) |
608 |
|
|
609 |
|
(defun compilation-move-to-column (col screen) |
610 |
|
"Go to column COL on the current line. |
611 |
|
If SCREEN is non-nil, columns are screen columns, otherwise, they are |
612 |
|
just char-counts." |
613 |
|
(if screen |
614 |
|
(move-to-column col) |
615 |
|
(goto-char (min (+ (line-beginning-position) col) (line-end-position))))) |
616 |
|
|
617 |
(defun compilation-internal-error-properties (file line end-line col end-col type fmt) |
(defun compilation-internal-error-properties (file line end-line col end-col type fmt) |
618 |
"Get the meta-info that will be added as text-properties. |
"Get the meta-info that will be added as text-properties. |
619 |
LINE, END-LINE, COL, END-COL are integers or nil. |
LINE, END-LINE, COL, END-COL are integers or nil. |
646 |
(goto-char (marker-position marker)) |
(goto-char (marker-position marker)) |
647 |
(when (or end-col end-line) |
(when (or end-col end-line) |
648 |
(beginning-of-line (- (or end-line line) marker-line -1)) |
(beginning-of-line (- (or end-line line) marker-line -1)) |
649 |
(if (< end-col 0) |
(if (or (null end-col) (< end-col 0)) |
650 |
(end-of-line) |
(end-of-line) |
651 |
(if compilation-error-screen-columns |
(compilation-move-to-column |
652 |
(move-to-column end-col) |
end-col compilation-error-screen-columns)) |
|
(forward-char end-col))) |
|
653 |
(setq end-marker (list (point-marker)))) |
(setq end-marker (list (point-marker)))) |
654 |
(beginning-of-line (if end-line |
(beginning-of-line (if end-line |
655 |
(- end-line line -1) |
(- line end-line -1) |
656 |
(- loc marker-line -1))) |
(- loc marker-line -1))) |
657 |
(if col |
(if col |
658 |
(if compilation-error-screen-columns |
(compilation-move-to-column |
659 |
(move-to-column col) |
col compilation-error-screen-columns) |
|
(forward-char col)) |
|
660 |
(forward-to-indentation 0)) |
(forward-to-indentation 0)) |
661 |
(setq marker (list (point-marker)))))) |
(setq marker (list (point-marker)))))) |
662 |
|
|
1150 |
(set (make-local-variable 'page-delimiter) |
(set (make-local-variable 'page-delimiter) |
1151 |
compilation-page-delimiter) |
compilation-page-delimiter) |
1152 |
(compilation-setup) |
(compilation-setup) |
1153 |
|
(setq buffer-read-only t) |
1154 |
(run-mode-hooks 'compilation-mode-hook)) |
(run-mode-hooks 'compilation-mode-hook)) |
1155 |
|
|
1156 |
(defmacro define-compilation-mode (mode name doc &rest body) |
(defmacro define-compilation-mode (mode name doc &rest body) |
1213 |
"Prepare the buffer for the compilation parsing commands to work. |
"Prepare the buffer for the compilation parsing commands to work. |
1214 |
Optional argument MINOR indicates this is called from |
Optional argument MINOR indicates this is called from |
1215 |
`compilation-minor-mode'." |
`compilation-minor-mode'." |
|
(unless minor |
|
|
(setq buffer-read-only t)) |
|
1216 |
(make-local-variable 'compilation-current-error) |
(make-local-variable 'compilation-current-error) |
1217 |
(make-local-variable 'compilation-messages-start) |
(make-local-variable 'compilation-messages-start) |
1218 |
(make-local-variable 'compilation-error-screen-columns) |
(make-local-variable 'compilation-error-screen-columns) |
1496 |
(if (car col) |
(if (car col) |
1497 |
(if (eq (car col) -1) ; special case for range end |
(if (eq (car col) -1) ; special case for range end |
1498 |
(end-of-line) |
(end-of-line) |
1499 |
(if columns |
(compilation-move-to-column (car col) columns)) |
|
(move-to-column (car col)) |
|
|
(beginning-of-line) |
|
|
(forward-char (car col)))) |
|
1500 |
(beginning-of-line) |
(beginning-of-line) |
1501 |
(skip-chars-forward " \t")) |
(skip-chars-forward " \t")) |
1502 |
(if (nth 3 col) |
(if (nth 3 col) |