diff options
| author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-09-29 15:59:50 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-09-29 15:59:50 +0200 |
| commit | 07f748da431b67353767a7494083c10a2d17d7c4 (patch) | |
| tree | 71ac8387d118e7e619c8feac3602e1443d068a8a | |
| parent | da40e5ecd79f8ad14915dae477c40f4090ce22ac (diff) | |
| download | emacs-07f748da431b67353767a7494083c10a2d17d7c4.tar.gz | |
Make M-x compile skip the header when looking for errors etc
* lisp/progmodes/compile.el (compilation--ensure-parse): Skip the
header when parsing (bug#43651).
(compilation-start): Mark the end.
| -rw-r--r-- | lisp/progmodes/compile.el | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index a408d16e37c..4fe13770b5a 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -33,6 +33,7 @@ (eval-when-compile (require 'cl-lib)) (require 'tool-bar) (require 'comint) +(require 'text-property-search) (defgroup compilation nil "Run compiler as inferior of Emacs, parse error messages." @@ -1573,7 +1574,14 @@ to `compilation-error-regexp-alist' if RULES is nil." ;; grep.el) don't need to flush-parse when they modify the buffer ;; in a way that impacts buffer positions but does not require ;; re-parsing. - (setq compilation--parsed (point-min-marker))) + (setq compilation--parsed + (set-marker (make-marker) + (save-excursion + (goto-char (point-min)) + (text-property-search-forward 'compilation-header-end) + ;; If we have no end marker, this will be + ;; `point-min' still. + (point))))) (when (< compilation--parsed limit) (let ((start (max compilation--parsed (point-min)))) (move-marker compilation--parsed limit) @@ -1818,6 +1826,9 @@ Returns the compilation buffer created." mode-name (substring (current-time-string) 0 19)) command "\n") + ;; Mark the end of the header so that we don't interpret + ;; anything in it as an error. + (put-text-property (1- (point)) (point) 'compilation-header-end t) (setq thisdir default-directory)) (set-buffer-modified-p nil)) ;; Pop up the compilation buffer. |
