2001-07-15 16:15:35 +00:00
|
|
|
|
;;; compile.el --- run compiler as inferior of Emacs, parse error messages
|
1992-06-11 02:31:08 +00:00
|
|
|
|
|
2014-01-01 07:43:34 +00:00
|
|
|
|
;; Copyright (C) 1985-1987, 1993-1999, 2001-2014 Free Software
|
2013-01-01 09:11:05 +00:00
|
|
|
|
;; Foundation, Inc.
|
1992-07-22 04:22:42 +00:00
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
;; Authors: Roland McGrath <roland@gnu.org>,
|
|
|
|
|
;; Daniel Pfeiffer <occitan@esperanto.org>
|
2014-02-09 17:34:22 -08:00
|
|
|
|
;; Maintainer: emacs-devel@gnu.org
|
1993-03-18 21:29:42 +00:00
|
|
|
|
;; Keywords: tools, processes
|
1992-07-16 18:28:42 +00:00
|
|
|
|
|
1990-07-13 03:12:54 +00:00
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
2008-05-06 07:25:26 +00:00
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
1992-07-16 21:46:14 +00:00
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 07:25:26 +00:00
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
1992-07-16 21:46:14 +00:00
|
|
|
|
|
1990-07-13 03:12:54 +00:00
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
1992-07-16 21:46:14 +00:00
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2008-05-06 07:25:26 +00:00
|
|
|
|
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
1990-07-13 03:12:54 +00:00
|
|
|
|
|
1993-03-23 18:27:03 +00:00
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
;; This package provides the compile facilities documented in the Emacs user's
|
|
|
|
|
;; manual.
|
1993-03-23 18:27:03 +00:00
|
|
|
|
|
2004-03-28 08:32:16 +00:00
|
|
|
|
;;; Code:
|
|
|
|
|
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 19:13:41 -04:00
|
|
|
|
(eval-when-compile (require 'cl-lib))
|
2008-02-25 10:52:09 +00:00
|
|
|
|
(require 'tool-bar)
|
2009-02-18 15:37:40 +00:00
|
|
|
|
(require 'comint)
|
2004-04-07 19:34:11 +00:00
|
|
|
|
|
1997-05-04 02:29:41 +00:00
|
|
|
|
(defgroup compilation nil
|
|
|
|
|
"Run compiler as inferior of Emacs, parse error messages."
|
|
|
|
|
:group 'tools
|
|
|
|
|
:group 'processes)
|
|
|
|
|
|
|
|
|
|
|
1992-03-06 00:28:08 +00:00
|
|
|
|
;;;###autoload
|
1997-05-04 02:29:41 +00:00
|
|
|
|
(defcustom compilation-mode-hook nil
|
2013-02-02 09:41:02 +01:00
|
|
|
|
"List of hook functions run by `compilation-mode'."
|
1997-05-04 02:29:41 +00:00
|
|
|
|
:type 'hook
|
|
|
|
|
:group 'compilation)
|
1992-03-06 00:28:08 +00:00
|
|
|
|
|
2008-11-18 14:14:37 +00:00
|
|
|
|
;;;###autoload
|
|
|
|
|
(defcustom compilation-start-hook nil
|
2013-02-02 09:41:02 +01:00
|
|
|
|
"Hook run after starting a new compilation process.
|
|
|
|
|
The hook is run with one argument, the new process."
|
2008-11-18 14:14:37 +00:00
|
|
|
|
:type 'hook
|
|
|
|
|
:group 'compilation)
|
|
|
|
|
|
1992-03-06 00:28:08 +00:00
|
|
|
|
;;;###autoload
|
1997-05-04 02:29:41 +00:00
|
|
|
|
(defcustom compilation-window-height nil
|
2013-02-02 09:41:02 +01:00
|
|
|
|
"Number of lines in a compilation window.
|
|
|
|
|
If nil, use Emacs default."
|
1997-05-04 02:29:41 +00:00
|
|
|
|
:type '(choice (const :tag "Default" nil)
|
|
|
|
|
integer)
|
|
|
|
|
:group 'compilation)
|
1991-10-07 22:49:33 +00:00
|
|
|
|
|
2011-05-08 01:17:17 -04:00
|
|
|
|
(defvar compilation-filter-hook nil
|
|
|
|
|
"Hook run after `compilation-filter' has inserted a string into the buffer.
|
|
|
|
|
It is called with the variable `compilation-filter-start' bound
|
|
|
|
|
to the position of the start of the inserted text, and point at
|
2011-05-09 15:42:45 -04:00
|
|
|
|
its end.
|
|
|
|
|
|
|
|
|
|
If Emacs lacks asynchronous process support, this hook is run
|
|
|
|
|
after `call-process' inserts the grep output into the buffer.")
|
2011-05-08 01:17:17 -04:00
|
|
|
|
|
|
|
|
|
(defvar compilation-filter-start nil
|
2012-02-08 23:28:32 -08:00
|
|
|
|
"Position of the start of the text inserted by `compilation-filter'.
|
|
|
|
|
This is bound before running `compilation-filter-hook'.")
|
2011-05-08 01:17:17 -04:00
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(defvar compilation-first-column 1
|
2012-04-09 21:05:48 +08:00
|
|
|
|
"This is how compilers number the first column, usually 1 or 0.
|
2012-02-08 23:24:30 -08:00
|
|
|
|
If this is buffer-local in the destination buffer, Emacs obeys
|
|
|
|
|
that value, otherwise it uses the value in the *compilation*
|
|
|
|
|
buffer. This enables a major-mode to specify its own value.")
|
1990-07-13 03:12:54 +00:00
|
|
|
|
|
2001-10-25 07:47:48 +00:00
|
|
|
|
(defvar compilation-parse-errors-filename-function nil
|
|
|
|
|
"Function to call to post-process filenames while parsing error messages.
|
|
|
|
|
It takes one arg FILENAME which is the name of a file as found
|
|
|
|
|
in the compilation output, and should return a transformed file name.")
|
|
|
|
|
|
1997-02-09 16:03:50 +00:00
|
|
|
|
;;;###autoload
|
|
|
|
|
(defvar compilation-process-setup-function nil
|
2012-04-09 21:05:48 +08:00
|
|
|
|
"Function to call to customize the compilation process.
|
2004-04-16 23:22:07 +00:00
|
|
|
|
This function is called immediately before the compilation process is
|
1997-02-09 16:03:50 +00:00
|
|
|
|
started. It can be used to set any variables or functions that are used
|
2011-01-28 16:42:34 -05:00
|
|
|
|
while processing the output of the compilation process.")
|
1997-02-09 16:03:50 +00:00
|
|
|
|
|
1991-12-21 09:14:03 +00:00
|
|
|
|
;;;###autoload
|
1991-10-07 22:49:33 +00:00
|
|
|
|
(defvar compilation-buffer-name-function nil
|
1992-09-14 01:33:12 +00:00
|
|
|
|
"Function to compute the name of a compilation buffer.
|
|
|
|
|
The function receives one argument, the name of the major mode of the
|
|
|
|
|
compilation buffer. It should return a string.
|
2007-06-04 01:36:30 +00:00
|
|
|
|
If nil, compute the name with `(concat \"*\" (downcase major-mode) \"*\")'.")
|
1990-07-13 03:12:54 +00:00
|
|
|
|
|
1991-12-21 09:14:03 +00:00
|
|
|
|
;;;###autoload
|
1991-10-07 22:49:33 +00:00
|
|
|
|
(defvar compilation-finish-function nil
|
1997-05-04 02:29:41 +00:00
|
|
|
|
"Function to call when a compilation process finishes.
|
1991-10-07 22:49:33 +00:00
|
|
|
|
It is called with two arguments: the compilation buffer, and a string
|
2005-05-19 16:53:26 +00:00
|
|
|
|
describing how the process finished.")
|
2005-05-19 15:38:27 +00:00
|
|
|
|
|
|
|
|
|
(make-obsolete-variable 'compilation-finish-function
|
2007-06-04 01:36:30 +00:00
|
|
|
|
"use `compilation-finish-functions', but it works a little differently."
|
2005-05-19 15:38:27 +00:00
|
|
|
|
"22.1")
|
1990-07-13 03:12:54 +00:00
|
|
|
|
|
1996-09-01 20:23:30 +00:00
|
|
|
|
;;;###autoload
|
|
|
|
|
(defvar compilation-finish-functions nil
|
1997-05-04 02:29:41 +00:00
|
|
|
|
"Functions to call when a compilation process finishes.
|
1996-09-01 20:23:30 +00:00
|
|
|
|
Each function is called with two arguments: the compilation buffer,
|
|
|
|
|
and a string describing how the process finished.")
|
|
|
|
|
|
1992-07-05 05:11:16 +00:00
|
|
|
|
(defvar compilation-in-progress nil
|
|
|
|
|
"List of compilation processes now running.")
|
|
|
|
|
(or (assq 'compilation-in-progress minor-mode-alist)
|
|
|
|
|
(setq minor-mode-alist (cons '(compilation-in-progress " Compiling")
|
|
|
|
|
minor-mode-alist)))
|
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(defvar compilation-error "error"
|
|
|
|
|
"Stem of message to print when no matches are found.")
|
1992-09-14 01:33:12 +00:00
|
|
|
|
|
1997-05-19 01:04:04 +00:00
|
|
|
|
(defvar compilation-arguments nil
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
"Arguments that were given to `compilation-start'.")
|
1997-05-19 01:04:04 +00:00
|
|
|
|
|
1992-09-14 01:33:12 +00:00
|
|
|
|
(defvar compilation-num-errors-found)
|
1991-10-07 22:49:33 +00:00
|
|
|
|
|
2011-05-08 21:24:00 -04:00
|
|
|
|
;; If you make any changes to `compilation-error-regexp-alist-alist',
|
|
|
|
|
;; be sure to run the ERT test in test/automated/compile-tests.el.
|
2013-01-13 17:08:13 -08:00
|
|
|
|
;; emacs -batch -l compile-tests.el -f ert-run-tests-batch-and-exit
|
2011-05-08 21:24:00 -04:00
|
|
|
|
|
2010-09-08 17:53:08 +02:00
|
|
|
|
(defvar compilation-error-regexp-alist-alist
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
'((absoft
|
|
|
|
|
"^\\(?:[Ee]rror on \\|[Ww]arning on\\( \\)\\)?[Ll]ine[ \t]+\\([0-9]+\\)[ \t]+\
|
|
|
|
|
of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
|
1997-07-25 17:29:29 +00:00
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(ada
|
|
|
|
|
"\\(warning: .*\\)? at \\([^ \n]+\\):\\([0-9]+\\)$" 2 3 nil (1))
|
1997-10-27 03:53:24 +00:00
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(aix
|
|
|
|
|
" in line \\([0-9]+\\) of file \\([^ \n]+[^. \n]\\)\\.? " 2 1)
|
2003-08-17 09:49:42 +00:00
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(ant
|
2011-05-08 21:24:00 -04:00
|
|
|
|
"^[ \t]*\\[[^] \n]+\\][ \t]*\\([^: \n]+\\):\\([0-9]+\\):\\(?:\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\):\\)?\
|
2011-08-20 22:24:07 -04:00
|
|
|
|
\\( warning\\)?" 1 (2 . 4) (3 . 5) (6))
|
2003-08-17 09:49:42 +00:00
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(bash
|
|
|
|
|
"^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2)
|
2003-08-17 09:49:42 +00:00
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(borland
|
|
|
|
|
"^\\(?:Error\\|Warnin\\(g\\)\\) \\(?:[FEW][0-9]+ \\)?\
|
|
|
|
|
\\([a-zA-Z]?:?[^:( \t\n]+\\)\
|
|
|
|
|
\\([0-9]+\\)\\(?:[) \t]\\|:[^0-9\n]\\)" 2 3 nil (1))
|
|
|
|
|
|
2011-06-20 22:10:10 -04:00
|
|
|
|
(python-tracebacks-and-caml
|
|
|
|
|
"^[ \t]*File \\(\"?\\)\\([^,\" \n\t<>]+\\)\\1, lines? \\([0-9]+\\)-?\\([0-9]+\\)?\\(?:$\\|,\
|
2011-11-09 10:39:32 -05:00
|
|
|
|
\\(?: characters? \\([0-9]+\\)-?\\([0-9]+\\)?:\\)?\\([ \n]Warning\\(?: [0-9]+\\)?:\\)?\\)"
|
2004-04-07 12:57:04 +00:00
|
|
|
|
2 (3 . 4) (5 . 6) (7))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
|
|
|
|
(comma
|
|
|
|
|
"^\"\\([^,\" \n\t]+\\)\", line \\([0-9]+\\)\
|
|
|
|
|
\\(?:[(. pos]+\\([0-9]+\\))?\\)?[:.,; (-]\\( warning:\\|[-0-9 ]*(W)\\)?" 1 2 3 (4))
|
|
|
|
|
|
2010-07-10 15:47:59 -04:00
|
|
|
|
(cucumber
|
|
|
|
|
"\\(?:^cucumber\\(?: -p [^[:space:]]+\\)?\\|#\\)\
|
|
|
|
|
\\(?: \\)\\([^\(].*\\):\\([1-9][0-9]*\\)" 1 2)
|
|
|
|
|
|
2012-10-14 09:40:05 +02:00
|
|
|
|
(msft
|
|
|
|
|
;; Must be before edg-1, so that MSVC's longer messages are
|
|
|
|
|
;; considered before EDG.
|
|
|
|
|
;; The message may be a "warning", "error", or "fatal error" with
|
|
|
|
|
;; an error code, or "see declaration of" without an error code.
|
|
|
|
|
"^ *\\([0-9]+>\\)?\\(\\(?:[a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) ?\
|
|
|
|
|
: \\(?:see declaration\\|\\(?:warnin\\(g\\)\\|[a-z ]+\\) C[0-9]+:\\)"
|
|
|
|
|
2 3 nil (4))
|
|
|
|
|
|
2004-05-10 21:00:00 +00:00
|
|
|
|
(edg-1
|
|
|
|
|
"^\\([^ \n]+\\)(\\([0-9]+\\)): \\(?:error\\|warnin\\(g\\)\\|remar\\(k\\)\\)"
|
|
|
|
|
1 2 nil (3 . 4))
|
|
|
|
|
(edg-2
|
|
|
|
|
"at line \\([0-9]+\\) of \"\\([^ \n]+\\)\"$"
|
|
|
|
|
2 1 nil 0)
|
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(epc
|
2004-05-10 21:00:00 +00:00
|
|
|
|
"^Error [0-9]+ at (\\([0-9]+\\):\\([^)\n]+\\))" 2 1)
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2004-11-22 23:31:28 +00:00
|
|
|
|
(ftnchek
|
|
|
|
|
"\\(^Warning .*\\)? line[ \n]\\([0-9]+\\)[ \n]\\(?:col \\([0-9]+\\)[ \n]\\)?file \\([^ :;\n]+\\)"
|
|
|
|
|
4 2 3 (1))
|
2004-10-27 09:10:27 +00:00
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(iar
|
|
|
|
|
"^\"\\(.*\\)\",\\([0-9]+\\)\\s-+\\(?:Error\\|Warnin\\(g\\)\\)\\[[0-9]+\\]:"
|
|
|
|
|
1 2 nil (3))
|
|
|
|
|
|
|
|
|
|
(ibm
|
|
|
|
|
"^\\([^( \n\t]+\\)(\\([0-9]+\\):\\([0-9]+\\)) :\
|
|
|
|
|
\\(?:warnin\\(g\\)\\|informationa\\(l\\)\\)?" 1 2 3 (4 . 5))
|
|
|
|
|
|
2004-04-16 23:22:07 +00:00
|
|
|
|
;; fixme: should be `mips'
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(irix
|
2004-10-27 09:10:27 +00:00
|
|
|
|
"^[-[:alnum:]_/ ]+: \\(?:\\(?:[sS]evere\\|[eE]rror\\|[wW]arnin\\(g\\)\\|[iI]nf\\(o\\)\\)[0-9 ]*: \\)?\
|
|
|
|
|
\\([^,\" \n\t]+\\)\\(?:, line\\|:\\) \\([0-9]+\\):" 3 4 nil (1 . 2))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
|
|
|
|
(java
|
|
|
|
|
"^\\(?:[ \t]+at \\|==[0-9]+== +\\(?:at\\|b\\(y\\)\\)\\).+(\\([^()\n]+\\):\\([0-9]+\\))$" 2 3 nil (1))
|
|
|
|
|
|
|
|
|
|
(jikes-file
|
|
|
|
|
"^\\(?:Found\\|Issued\\) .* compiling \"\\(.+\\)\":$" 1 nil nil 0)
|
2011-05-08 21:24:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; This used to be pathologically slow on long lines (Bug#3441),
|
|
|
|
|
;; due to matching filenames via \\(.*?\\). This might be faster.
|
|
|
|
|
(maven
|
|
|
|
|
;; Maven is a popular free software build tool for Java.
|
2012-05-21 00:28:41 -04:00
|
|
|
|
"\\([^ \n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\] " 1 2 3)
|
2011-05-08 21:24:00 -04:00
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(jikes-line
|
|
|
|
|
"^ *\\([0-9]+\\)\\.[ \t]+.*\n +\\(<-*>\n\\*\\*\\* \\(?:Error\\|Warnin\\(g\\)\\)\\)"
|
|
|
|
|
nil 1 nil 2 0
|
|
|
|
|
(2 (compilation-face '(3))))
|
|
|
|
|
|
2010-09-04 16:42:03 -04:00
|
|
|
|
(gcc-include
|
|
|
|
|
"^\\(?:In file included \\| \\|\t\\)from \
|
2011-01-08 14:31:26 +01:00
|
|
|
|
\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\):\
|
|
|
|
|
\\([0-9]+\\)\\(?::\\([0-9]+\\)\\)?\\(?:\\(:\\)\\|\\(,\\|$\\)\\)?"
|
|
|
|
|
1 2 3 (4 . 5))
|
2010-09-04 16:42:03 -04:00
|
|
|
|
|
2011-05-08 21:24:00 -04:00
|
|
|
|
(ruby-Test::Unit
|
|
|
|
|
"^[\t ]*\\[\\([^\(].*\\):\\([1-9][0-9]*\\)\\(\\]\\)?:in " 1 2)
|
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(gnu
|
2009-08-10 02:44:58 +00:00
|
|
|
|
;; The first line matches the program name for
|
|
|
|
|
|
|
|
|
|
;; PROGRAM:SOURCE-FILE-NAME:LINENO: MESSAGE
|
|
|
|
|
|
|
|
|
|
;; format, which is used for non-interactive programs other than
|
|
|
|
|
;; compilers (e.g. the "jade:" entry in compilation.txt).
|
|
|
|
|
|
|
|
|
|
;; This first line makes things ambiguous with output such as
|
|
|
|
|
;; "foo:344:50:blabla" since the "foo" part can match this first
|
|
|
|
|
;; line (in which case the file name as "344"). To avoid this,
|
|
|
|
|
;; the second line disallows filenames exclusively composed of
|
|
|
|
|
;; digits.
|
|
|
|
|
|
2006-07-19 19:20:11 +00:00
|
|
|
|
;; Similarly, we get lots of false positives with messages including
|
|
|
|
|
;; times of the form "HH:MM:SS" where MM is taken as a line number, so
|
|
|
|
|
;; the last line tries to rule out message where the info after the
|
|
|
|
|
;; line number starts with "SS". --Stef
|
2008-04-30 08:12:20 +00:00
|
|
|
|
|
|
|
|
|
;; The core of the regexp is the one with *?. It says that a file name
|
|
|
|
|
;; can be composed of any non-newline char, but it also rules out some
|
|
|
|
|
;; valid but unlikely cases, such as a trailing space or a space
|
2010-09-08 17:53:08 +02:00
|
|
|
|
;; followed by a -, or a colon followed by a space.
|
|
|
|
|
|
|
|
|
|
;; The "in \\|from " exception was added to handle messages from Ruby.
|
2010-09-04 16:42:03 -04:00
|
|
|
|
"^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\|[ \t]+\\(?:in \\|from \\)\\)?\
|
2010-09-08 17:53:08 +02:00
|
|
|
|
\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\): ?\
|
2013-01-13 17:08:13 -08:00
|
|
|
|
\\([0-9]+\\)\\(?:-\\(?4:[0-9]+\\)\\(?:\\.\\(?5:[0-9]+\\)\\)?\
|
|
|
|
|
\\|[.:]\\(?3:[0-9]+\\)\\(?:-\\(?:\\(?4:[0-9]+\\)\\.\\)?\\(?5:[0-9]+\\)\\)?\\)?:\
|
2011-07-12 16:40:56 +02:00
|
|
|
|
\\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\
|
2013-02-02 07:15:05 +01:00
|
|
|
|
*\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|\\[ skipping .+ \\]\\|\
|
|
|
|
|
\\(?:instantiated\\|required\\) from\\|[Nn]ote\\)\\|\
|
2013-01-13 17:09:38 -08:00
|
|
|
|
*[Ee]rror\\|[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)"
|
2011-01-08 14:32:31 +01:00
|
|
|
|
1 (2 . 4) (3 . 5) (6 . 7))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
|
|
|
|
(lcc
|
|
|
|
|
"^\\(?:E\\|\\(W\\)\\), \\([^(\n]+\\)(\\([0-9]+\\),[ \t]*\\([0-9]+\\)"
|
|
|
|
|
2 3 4 (1))
|
|
|
|
|
|
|
|
|
|
(makepp
|
2007-01-19 23:06:10 +00:00
|
|
|
|
"^makepp\\(?:\\(?:: warning\\(:\\).*?\\|\\(: Scanning\\|: [LR]e?l?oading makefile\\|: Imported\\|log:.*?\\) \\|: .*?\\)\
|
2005-06-03 08:41:20 +00:00
|
|
|
|
`\\(\\(\\S +?\\)\\(?::\\([0-9]+\\)\\)?\\)['(]\\)"
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
4 5 nil (1 . 2) 3
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(0 (progn (save-match-data
|
|
|
|
|
(compilation-parse-errors
|
|
|
|
|
(match-end 0) (line-end-position)
|
|
|
|
|
`("`\\(\\(\\S +?\\)\\(?::\\([0-9]+\\)\\)?\\)['(]"
|
|
|
|
|
2 3 nil
|
|
|
|
|
,(cond ((match-end 1) 1) ((match-end 2) 0) (t 2))
|
|
|
|
|
1)))
|
|
|
|
|
(end-of-line)
|
|
|
|
|
nil)))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2004-04-16 23:22:07 +00:00
|
|
|
|
;; Should be lint-1, lint-2 (SysV lint)
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(mips-1
|
|
|
|
|
" (\\([0-9]+\\)) in \\([^ \n]+\\)" 2 1)
|
|
|
|
|
(mips-2
|
|
|
|
|
" in \\([^()\n ]+\\)(\\([0-9]+\\))$" 1 2)
|
|
|
|
|
|
|
|
|
|
(msft
|
2009-11-08 16:30:52 +00:00
|
|
|
|
;; The message may be a "warning", "error", or "fatal error" with
|
|
|
|
|
;; an error code, or "see declaration of" without an error code.
|
|
|
|
|
"^ *\\([0-9]+>\\)?\\(\\(?:[a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \
|
|
|
|
|
: \\(?:see declaration\\|\\(?:warnin\\(g\\)\\|[a-z ]+\\) C[0-9]+:\\)"
|
|
|
|
|
2 3 nil (4))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2009-03-04 14:33:42 +00:00
|
|
|
|
(omake
|
|
|
|
|
;; "omake -P" reports "file foo changed"
|
|
|
|
|
;; (useful if you do "cvs up" and want to see what has changed)
|
2011-01-28 16:42:34 -05:00
|
|
|
|
"omake: file \\(.*\\) changed" 1 nil nil nil nil
|
|
|
|
|
;; FIXME-omake: This tries to prevent reusing pre-existing markers
|
|
|
|
|
;; for subsequent messages, since those messages's line numbers
|
|
|
|
|
;; are about another version of the file.
|
|
|
|
|
(0 (progn (compilation--flush-file-structure (match-string 1))
|
|
|
|
|
nil)))
|
2009-03-04 14:33:42 +00:00
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(oracle
|
2004-06-08 21:36:37 +00:00
|
|
|
|
"^\\(?:Semantic error\\|Error\\|PCC-[0-9]+:\\).* line \\([0-9]+\\)\
|
|
|
|
|
\\(?:\\(?:,\\| at\\)? column \\([0-9]+\\)\\)?\
|
|
|
|
|
\\(?:,\\| in\\| of\\)? file \\(.*?\\):?$"
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
3 1 2)
|
1999-10-28 11:20:17 +00:00
|
|
|
|
|
2008-01-08 07:53:53 +00:00
|
|
|
|
;; "during global destruction": This comes out under "use
|
|
|
|
|
;; warnings" in recent perl when breaking circular references
|
|
|
|
|
;; during program or thread exit.
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(perl
|
2008-01-08 07:53:53 +00:00
|
|
|
|
" at \\([^ \n]+\\) line \\([0-9]+\\)\\(?:[,.]\\|$\\| \
|
|
|
|
|
during global destruction\\.$\\)" 1 2)
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2008-02-13 22:26:33 +00:00
|
|
|
|
(php
|
|
|
|
|
"\\(?:Parse\\|Fatal\\) error: \\(.*\\) in \\(.*\\) on line \\([0-9]+\\)"
|
|
|
|
|
2 3 nil nil)
|
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(rxp
|
|
|
|
|
"^\\(?:Error\\|Warnin\\(g\\)\\):.*\n.* line \\([0-9]+\\) char\
|
|
|
|
|
\\([0-9]+\\) of file://\\(.+\\)"
|
|
|
|
|
4 2 3 (1))
|
|
|
|
|
|
|
|
|
|
(sparc-pascal-file
|
|
|
|
|
"^\\w\\w\\w \\w\\w\\w +[0-3]?[0-9] +[0-2][0-9]:[0-5][0-9]:[0-5][0-9]\
|
|
|
|
|
[12][09][0-9][0-9] +\\(.*\\):$"
|
|
|
|
|
1 nil nil 0)
|
|
|
|
|
(sparc-pascal-line
|
|
|
|
|
"^\\(\\(?:E\\|\\(w\\)\\) +[0-9]+\\) line \\([0-9]+\\) - "
|
|
|
|
|
nil 3 nil (2) nil (1 (compilation-face '(2))))
|
|
|
|
|
(sparc-pascal-example
|
|
|
|
|
"^ +\\([0-9]+\\) +.*\n\\(\\(?:e\\|\\(w\\)\\) [0-9]+\\)-+"
|
|
|
|
|
nil 1 nil (3) nil (2 (compilation-face '(3))))
|
|
|
|
|
|
|
|
|
|
(sun
|
2004-04-16 23:22:07 +00:00
|
|
|
|
": \\(?:ERROR\\|WARNIN\\(G\\)\\|REMAR\\(K\\)\\) \\(?:[[:alnum:] ]+, \\)?\
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
File = \\(.+\\), Line = \\([0-9]+\\)\\(?:, Column = \\([0-9]+\\)\\)?"
|
|
|
|
|
3 4 5 (1 . 2))
|
|
|
|
|
|
|
|
|
|
(sun-ada
|
|
|
|
|
"^\\([^, \n\t]+\\), line \\([0-9]+\\), char \\([0-9]+\\)[:., \(-]" 1 2 3)
|
|
|
|
|
|
2008-05-05 11:59:04 +00:00
|
|
|
|
(watcom
|
2010-02-20 08:53:06 -05:00
|
|
|
|
"^[ \t]*\\(\\(?:[a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)): ?\
|
2008-05-06 03:31:55 +00:00
|
|
|
|
\\(?:\\(Error! E[0-9]+\\)\\|\\(Warning! W[0-9]+\\)\\):"
|
|
|
|
|
1 2 nil (4))
|
2008-05-05 11:59:04 +00:00
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(4bsd
|
|
|
|
|
"\\(?:^\\|:: \\|\\S ( \\)\\(/[^ \n\t()]+\\)(\\([0-9]+\\))\
|
2005-04-10 06:19:31 +00:00
|
|
|
|
\\(?:: \\(warning:\\)?\\|$\\| ),\\)" 1 2 nil (3))
|
|
|
|
|
|
|
|
|
|
(gcov-file
|
2006-07-11 15:08:33 +00:00
|
|
|
|
"^ *-: *\\(0\\):Source:\\(.+\\)$"
|
2011-01-28 17:06:20 -05:00
|
|
|
|
2 1 nil 0 nil)
|
2006-06-02 02:38:53 +00:00
|
|
|
|
(gcov-header
|
|
|
|
|
"^ *-: *\\(0\\):\\(?:Object\\|Graph\\|Data\\|Runs\\|Programs\\):.+$"
|
2011-01-28 17:06:20 -05:00
|
|
|
|
nil 1 nil 0 nil)
|
2006-06-02 02:38:53 +00:00
|
|
|
|
;; Underlines over all lines of gcov output are too uncomfortable to read.
|
|
|
|
|
;; However, hyperlinks embedded in the lines are useful.
|
|
|
|
|
;; So I put default face on the lines; and then put
|
|
|
|
|
;; compilation-*-face by manually to eliminate the underlines.
|
|
|
|
|
;; The hyperlinks are still effective.
|
|
|
|
|
(gcov-nomark
|
|
|
|
|
"^ *-: *\\([1-9]\\|[0-9]\\{2,\\}\\):.*$"
|
|
|
|
|
nil 1 nil 0 nil
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(0 'default)
|
|
|
|
|
(1 compilation-line-face))
|
2005-04-10 06:19:31 +00:00
|
|
|
|
(gcov-called-line
|
2006-06-02 02:38:53 +00:00
|
|
|
|
"^ *\\([0-9]+\\): *\\([0-9]+\\):.*$"
|
2006-07-11 15:08:33 +00:00
|
|
|
|
nil 2 nil 0 nil
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(0 'default)
|
|
|
|
|
(1 compilation-info-face) (2 compilation-line-face))
|
2006-06-02 02:38:53 +00:00
|
|
|
|
(gcov-never-called
|
2006-07-11 15:08:33 +00:00
|
|
|
|
"^ *\\(#####\\): *\\([0-9]+\\):.*$"
|
2006-06-02 02:38:53 +00:00
|
|
|
|
nil 2 nil 2 nil
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(0 'default)
|
|
|
|
|
(1 compilation-error-face) (2 compilation-line-face))
|
2007-11-12 18:29:05 +00:00
|
|
|
|
|
2008-02-11 04:11:00 +00:00
|
|
|
|
(perl--Pod::Checker
|
2007-11-12 18:29:05 +00:00
|
|
|
|
;; podchecker error messages, per Pod::Checker.
|
|
|
|
|
;; The style is from the Pod::Checker::poderror() function, eg.
|
|
|
|
|
;; *** ERROR: Spurious text after =cut at line 193 in file foo.pm
|
|
|
|
|
;;
|
|
|
|
|
;; Plus end_pod() can give "at line EOF" instead of a
|
|
|
|
|
;; number, so for that match "on line N" which is the
|
|
|
|
|
;; originating spot, eg.
|
|
|
|
|
;; *** ERROR: =over on line 37 without closing =back at line EOF in file bar.pm
|
|
|
|
|
;;
|
|
|
|
|
;; Plus command() can give both "on line N" and "at line N";
|
|
|
|
|
;; the latter is desired and is matched because the .* is
|
|
|
|
|
;; greedy.
|
|
|
|
|
;; *** ERROR: =over on line 1 without closing =back (at head1) at line 3 in file x.pod
|
|
|
|
|
;;
|
|
|
|
|
"^\\*\\*\\* \\(?:ERROR\\|\\(WARNING\\)\\).* \\(?:at\\|on\\) line \
|
|
|
|
|
\\([0-9]+\\) \\(?:.* \\)?in file \\([^ \t\n]+\\)"
|
|
|
|
|
3 2 nil (1))
|
2008-02-11 04:11:00 +00:00
|
|
|
|
(perl--Test
|
2007-11-12 18:29:05 +00:00
|
|
|
|
;; perl Test module error messages.
|
|
|
|
|
;; Style per the ok() function "$context", eg.
|
|
|
|
|
;; # Failed test 1 in foo.t at line 6
|
|
|
|
|
;;
|
|
|
|
|
"^# Failed test [0-9]+ in \\([^ \t\r\n]+\\) at line \\([0-9]+\\)"
|
|
|
|
|
1 2)
|
2008-02-11 04:11:00 +00:00
|
|
|
|
(perl--Test2
|
2011-07-03 23:39:49 +02:00
|
|
|
|
;; Or when comparing got/want values, with a "fail #n" if repeated
|
2008-01-08 08:03:25 +00:00
|
|
|
|
;; # Test 2 got: "xx" (t-compilation-perl-2.t at line 10)
|
2011-07-03 23:39:49 +02:00
|
|
|
|
;; # Test 3 got: "xx" (t-compilation-perl-2.t at line 10 fail #2)
|
2008-01-08 08:03:25 +00:00
|
|
|
|
;;
|
|
|
|
|
;; And under Test::Harness they're preceded by progress stuff with
|
|
|
|
|
;; \r and "NOK",
|
|
|
|
|
;; ... NOK 1# Test 1 got: "1234" (t/foo.t at line 46)
|
|
|
|
|
;;
|
|
|
|
|
"^\\(.*NOK.*\\)?# Test [0-9]+ got:.* (\\([^ \t\r\n]+\\) at line \
|
2011-07-03 23:39:49 +02:00
|
|
|
|
\\([0-9]+\\)\\( fail #[0-9]+\\)?)"
|
2008-01-08 08:03:25 +00:00
|
|
|
|
2 3)
|
2008-02-11 04:11:00 +00:00
|
|
|
|
(perl--Test::Harness
|
2007-11-12 18:29:05 +00:00
|
|
|
|
;; perl Test::Harness output, eg.
|
|
|
|
|
;; NOK 1# Test 1 got: "1234" (t/foo.t at line 46)
|
|
|
|
|
;;
|
|
|
|
|
;; Test::Harness is slightly designed for tty output, since
|
|
|
|
|
;; it prints CRs to overwrite progress messages, but if you
|
|
|
|
|
;; run it in with M-x compile this pattern can at least step
|
|
|
|
|
;; through the failures.
|
|
|
|
|
;;
|
|
|
|
|
"^.*NOK.* \\([^ \t\r\n]+\\) at line \\([0-9]+\\)"
|
|
|
|
|
1 2)
|
2008-02-11 04:11:00 +00:00
|
|
|
|
(weblint
|
2007-11-12 18:29:05 +00:00
|
|
|
|
;; The style comes from HTML::Lint::Error::as_string(), eg.
|
|
|
|
|
;; index.html (13:1) Unknown element <fdjsk>
|
|
|
|
|
;;
|
|
|
|
|
;; The pattern only matches filenames without spaces, since that
|
|
|
|
|
;; should be usual and should help reduce the chance of a false
|
|
|
|
|
;; match of a message from some unrelated program.
|
|
|
|
|
;;
|
|
|
|
|
;; This message style is quite close to the "ibm" entry which is
|
|
|
|
|
;; for IBM C, though that ibm bit doesn't put a space after the
|
|
|
|
|
;; filename.
|
|
|
|
|
;;
|
|
|
|
|
"^\\([^ \t\r\n(]+\\) (\\([0-9]+\\):\\([0-9]+\\)) "
|
|
|
|
|
1 2 3)
|
2006-06-02 02:38:53 +00:00
|
|
|
|
)
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
"Alist of values for `compilation-error-regexp-alist'.")
|
|
|
|
|
|
|
|
|
|
(defcustom compilation-error-regexp-alist
|
|
|
|
|
(mapcar 'car compilation-error-regexp-alist-alist)
|
1992-09-14 01:33:12 +00:00
|
|
|
|
"Alist that specifies how to match errors in compiler output.
|
2005-09-12 05:01:06 +00:00
|
|
|
|
On GNU and Unix, any string is a valid filename, so these
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
matchers must make some common sense assumptions, which catch
|
|
|
|
|
normal cases. A shorter list will be lighter on resource usage.
|
|
|
|
|
|
|
|
|
|
Instead of an alist element, you can use a symbol, which is
|
|
|
|
|
looked up in `compilation-error-regexp-alist-alist'. You can see
|
|
|
|
|
the predefined symbols and their effects in the file
|
2004-04-16 23:22:07 +00:00
|
|
|
|
`etc/compilation.txt' (linked below if you are customizing this).
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
|
|
|
|
Each elt has the form (REGEXP FILE [LINE COLUMN TYPE HYPERLINK
|
|
|
|
|
HIGHLIGHT...]). If REGEXP matches, the FILE'th subexpression
|
|
|
|
|
gives the file name, and the LINE'th subexpression gives the line
|
|
|
|
|
number. The COLUMN'th subexpression gives the column number on
|
|
|
|
|
that line.
|
|
|
|
|
|
|
|
|
|
If FILE, LINE or COLUMN are nil or that index didn't match, that
|
|
|
|
|
information is not present on the matched line. In that case the
|
|
|
|
|
file name is assumed to be the same as the previous one in the
|
|
|
|
|
buffer, line number defaults to 1 and column defaults to
|
|
|
|
|
beginning of line's indentation.
|
|
|
|
|
|
|
|
|
|
FILE can also have the form (FILE FORMAT...), where the FORMATs
|
|
|
|
|
\(e.g. \"%s.c\") will be applied in turn to the recognized file
|
|
|
|
|
name, until a file of that name is found. Or FILE can also be a
|
2005-12-12 05:11:08 +00:00
|
|
|
|
function that returns (FILENAME) or (RELATIVE-FILENAME . DIRNAME).
|
|
|
|
|
In the former case, FILENAME may be relative or absolute.
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
|
|
|
|
LINE can also be of the form (LINE . END-LINE) meaning a range
|
|
|
|
|
of lines. COLUMN can also be of the form (COLUMN . END-COLUMN)
|
|
|
|
|
meaning a range of columns starting on LINE and ending on
|
|
|
|
|
END-LINE, if that matched.
|
|
|
|
|
|
|
|
|
|
TYPE is 2 or nil for a real error or 1 for warning or 0 for info.
|
|
|
|
|
TYPE can also be of the form (WARNING . INFO). In that case this
|
|
|
|
|
will be equivalent to 1 if the WARNING'th subexpression matched
|
|
|
|
|
or else equivalent to 0 if the INFO'th subexpression matched.
|
|
|
|
|
See `compilation-error-face', `compilation-warning-face',
|
|
|
|
|
`compilation-info-face' and `compilation-skip-threshold'.
|
|
|
|
|
|
|
|
|
|
What matched the HYPERLINK'th subexpression has `mouse-face' and
|
|
|
|
|
`compilation-message-face' applied. If this is nil, the text
|
|
|
|
|
matched by the whole REGEXP becomes the hyperlink.
|
|
|
|
|
|
2012-09-16 12:16:51 +08:00
|
|
|
|
Additional HIGHLIGHTs take the shape (SUBMATCH FACE), where
|
|
|
|
|
SUBMATCH is the number of a submatch and FACE is an expression
|
2012-09-16 12:31:02 +08:00
|
|
|
|
which evaluates to a face name (a symbol or string).
|
|
|
|
|
Alternatively, FACE can evaluate to a property list of the
|
|
|
|
|
form (face FACE PROP1 VAL1 PROP2 VAL2 ...), in which case all the
|
|
|
|
|
listed text properties PROP# are given values VAL# as well."
|
2011-01-20 21:04:45 -08:00
|
|
|
|
:type '(repeat (choice (symbol :tag "Predefined symbol")
|
|
|
|
|
(sexp :tag "Error specification")))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
:link `(file-link :tag "example file"
|
2004-05-28 21:11:41 +00:00
|
|
|
|
,(expand-file-name "compilation.txt" data-directory))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
:group 'compilation)
|
1990-07-13 03:12:54 +00:00
|
|
|
|
|
2007-03-25 17:52:31 +00:00
|
|
|
|
;;;###autoload(put 'compilation-directory 'safe-local-variable 'stringp)
|
2004-02-16 12:53:25 +00:00
|
|
|
|
(defvar compilation-directory nil
|
|
|
|
|
"Directory to restore to when doing `recompile'.")
|
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(defvar compilation-directory-matcher
|
2013-10-23 09:25:56 -07:00
|
|
|
|
'("\\(?:Entering\\|Leavin\\(g\\)\\) directory [`']\\(.+\\)'$" (2 . 1))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
"A list for tracking when directories are entered or left.
|
2006-11-11 04:01:58 +00:00
|
|
|
|
If nil, do not track directories, e.g. if all file names are absolute. The
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
first element is the REGEXP matching these messages. It can match any number
|
|
|
|
|
of variants, e.g. different languages. The remaining elements are all of the
|
|
|
|
|
form (DIR . LEAVE). If for any one of these the DIR'th subexpression
|
|
|
|
|
matches, that is a directory name. If LEAVE is nil or the corresponding
|
|
|
|
|
LEAVE'th subexpression doesn't match, this message is about going into another
|
|
|
|
|
directory. If it does match anything, this message is about going back to the
|
|
|
|
|
directory we were in before the last entering message. If you change this,
|
|
|
|
|
you may also want to change `compilation-page-delimiter'.")
|
|
|
|
|
|
|
|
|
|
(defvar compilation-page-delimiter
|
2013-10-23 09:25:56 -07:00
|
|
|
|
"^\\(?:\f\\|.*\\(?:Entering\\|Leaving\\) directory [`'].+'\n\\)+"
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
"Value of `page-delimiter' in Compilation mode.")
|
|
|
|
|
|
|
|
|
|
(defvar compilation-mode-font-lock-keywords
|
2006-07-19 19:20:11 +00:00
|
|
|
|
'(;; configure output lines.
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
("^[Cc]hecking \\(?:[Ff]or \\|[Ii]f \\|[Ww]hether \\(?:to \\)?\\)?\\(.+\\)\\.\\.\\. *\\(?:(cached) *\\)?\\(\\(yes\\(?: .+\\)?\\)\\|no\\|\\(.*\\)\\)$"
|
|
|
|
|
(1 font-lock-variable-name-face)
|
2005-08-09 21:34:40 +00:00
|
|
|
|
(2 (compilation-face '(4 . 3))))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
;; Command output lines. Recognize `make[n]:' lines too.
|
2004-04-16 23:22:07 +00:00
|
|
|
|
("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:"
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(1 font-lock-function-name-face) (3 compilation-line-face nil t))
|
2011-08-22 15:46:45 +03:00
|
|
|
|
(" --?o\\(?:utfile\\|utput\\)?[= ]\\(\\S +\\)" . 1)
|
2006-07-09 15:17:05 +00:00
|
|
|
|
("^Compilation \\(finished\\).*"
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(0 '(face nil compilation-message nil help-echo nil mouse-face nil) t)
|
2005-08-14 06:51:49 +00:00
|
|
|
|
(1 compilation-info-face))
|
2006-07-19 19:20:11 +00:00
|
|
|
|
("^Compilation \\(exited abnormally\\|interrupt\\|killed\\|terminated\\|segmentation fault\\)\\(?:.*with code \\([0-9]+\\)\\)?.*"
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(0 '(face nil compilation-message nil help-echo nil mouse-face nil) t)
|
2005-08-14 06:51:49 +00:00
|
|
|
|
(1 compilation-error-face)
|
|
|
|
|
(2 compilation-error-face nil t)))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
"Additional things to highlight in Compilation mode.
|
|
|
|
|
This gets tacked on the end of the generated expressions.")
|
1997-05-03 04:37:52 +00:00
|
|
|
|
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
(defvar compilation-highlight-regexp t
|
|
|
|
|
"Regexp matching part of visited source lines to highlight temporarily.
|
|
|
|
|
Highlight entire line if t; don't highlight source lines if nil.")
|
|
|
|
|
|
|
|
|
|
(defvar compilation-highlight-overlay nil
|
|
|
|
|
"Overlay used to temporarily highlight compilation matches.")
|
|
|
|
|
|
1998-09-18 09:06:20 +00:00
|
|
|
|
(defcustom compilation-error-screen-columns t
|
2007-07-10 16:01:25 +00:00
|
|
|
|
"If non-nil, column numbers in error messages are screen columns.
|
1998-09-18 09:06:20 +00:00
|
|
|
|
Otherwise they are interpreted as character positions, with
|
|
|
|
|
each character occupying one column.
|
|
|
|
|
The default is to use screen columns, which requires that the compilation
|
|
|
|
|
program and Emacs agree about the display width of the characters,
|
2012-02-08 23:24:30 -08:00
|
|
|
|
especially the TAB character.
|
|
|
|
|
If this is buffer-local in the destination buffer, Emacs obeys
|
|
|
|
|
that value, otherwise it uses the value in the *compilation*
|
|
|
|
|
buffer. This enables a major-mode to specify its own value."
|
1998-09-18 09:06:20 +00:00
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'compilation
|
|
|
|
|
:version "20.4")
|
|
|
|
|
|
1997-05-04 02:29:41 +00:00
|
|
|
|
(defcustom compilation-read-command t
|
2007-07-10 16:01:25 +00:00
|
|
|
|
"Non-nil means \\[compile] reads the compilation command to use.
|
2010-01-09 16:14:50 -05:00
|
|
|
|
Otherwise, \\[compile] just uses the value of `compile-command'.
|
|
|
|
|
|
|
|
|
|
Note that changing this to nil may be a security risk, because a
|
|
|
|
|
file might define a malicious `compile-command' as a file local
|
|
|
|
|
variable, and you might not notice. Therefore, `compile-command'
|
|
|
|
|
is considered unsafe if this variable is nil."
|
1997-05-04 02:29:41 +00:00
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'compilation)
|
1994-01-01 16:32:44 +00:00
|
|
|
|
|
1997-09-05 19:41:25 +00:00
|
|
|
|
;;;###autoload
|
1997-05-04 02:29:41 +00:00
|
|
|
|
(defcustom compilation-ask-about-save t
|
2007-07-10 16:01:25 +00:00
|
|
|
|
"Non-nil means \\[compile] asks which buffers to save before compiling.
|
1997-05-04 02:29:41 +00:00
|
|
|
|
Otherwise, it saves all modified buffers without asking."
|
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'compilation)
|
1994-01-01 16:32:44 +00:00
|
|
|
|
|
2010-04-07 12:20:35 -04:00
|
|
|
|
(defcustom compilation-save-buffers-predicate nil
|
|
|
|
|
"The second argument (PRED) passed to `save-some-buffers' before compiling.
|
|
|
|
|
E.g., one can set this to
|
|
|
|
|
(lambda ()
|
|
|
|
|
(string-prefix-p my-compilation-root (file-truename (buffer-file-name))))
|
|
|
|
|
to limit saving to files located under `my-compilation-root'.
|
|
|
|
|
Note, that, in general, `compilation-directory' cannot be used instead
|
|
|
|
|
of `my-compilation-root' here."
|
|
|
|
|
:type '(choice
|
|
|
|
|
(const :tag "Default (save all file-visiting buffers)" nil)
|
|
|
|
|
(const :tag "Save all buffers" t)
|
|
|
|
|
function)
|
2010-04-09 19:18:09 -07:00
|
|
|
|
:group 'compilation
|
|
|
|
|
:version "24.1")
|
2010-04-07 12:20:35 -04:00
|
|
|
|
|
1992-03-06 00:28:08 +00:00
|
|
|
|
;;;###autoload
|
1997-05-04 02:29:41 +00:00
|
|
|
|
(defcustom compilation-search-path '(nil)
|
2007-07-10 16:01:25 +00:00
|
|
|
|
"List of directories to search for source files named in error messages.
|
1991-10-07 22:49:33 +00:00
|
|
|
|
Elements should be directory names, not file names of directories.
|
2007-06-04 01:36:30 +00:00
|
|
|
|
The value nil as an element means to try the default directory."
|
1997-05-04 02:29:41 +00:00
|
|
|
|
:type '(repeat (choice (const :tag "Default" nil)
|
|
|
|
|
(string :tag "Directory")))
|
|
|
|
|
:group 'compilation)
|
1990-07-13 03:12:54 +00:00
|
|
|
|
|
2005-09-12 05:01:06 +00:00
|
|
|
|
;;;###autoload
|
2009-11-11 19:24:20 +00:00
|
|
|
|
(defcustom compile-command (purecopy "make -k ")
|
2007-07-10 16:01:25 +00:00
|
|
|
|
"Last shell command used to do a compilation; default for next compilation.
|
1990-07-13 03:12:54 +00:00
|
|
|
|
|
|
|
|
|
Sometimes it is useful for files to supply local values for this variable.
|
|
|
|
|
You might also use mode hooks to specify it in certain modes, like this:
|
|
|
|
|
|
1997-07-27 19:25:02 +00:00
|
|
|
|
(add-hook 'c-mode-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(unless (or (file-exists-p \"makefile\")
|
|
|
|
|
(file-exists-p \"Makefile\"))
|
2001-07-19 21:46:37 +00:00
|
|
|
|
(set (make-local-variable 'compile-command)
|
|
|
|
|
(concat \"make -k \"
|
2013-08-13 00:56:43 -07:00
|
|
|
|
(if buffer-file-name
|
|
|
|
|
(shell-quote-argument
|
|
|
|
|
(file-name-sans-extension buffer-file-name))))))))"
|
1997-05-04 02:29:41 +00:00
|
|
|
|
:type 'string
|
|
|
|
|
:group 'compilation)
|
2010-01-09 15:53:55 -05:00
|
|
|
|
;;;###autoload(put 'compile-command 'safe-local-variable (lambda (a) (and (stringp a) (or (not (boundp 'compilation-read-command)) compilation-read-command))))
|
1990-07-13 03:12:54 +00:00
|
|
|
|
|
2005-09-12 05:01:06 +00:00
|
|
|
|
;;;###autoload
|
2005-08-20 21:47:06 +00:00
|
|
|
|
(defcustom compilation-disable-input nil
|
2007-07-10 16:01:25 +00:00
|
|
|
|
"If non-nil, send end-of-file as compilation process input.
|
2005-08-20 12:14:24 +00:00
|
|
|
|
This only affects platforms that support asynchronous processes (see
|
2005-08-22 19:55:57 +00:00
|
|
|
|
`start-process'); synchronous compilation processes never accept input."
|
2005-08-20 12:14:24 +00:00
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'compilation
|
|
|
|
|
:version "22.1")
|
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
;; A weak per-compilation-buffer hash indexed by (FILENAME . DIRECTORY). Each
|
|
|
|
|
;; value is a FILE-STRUCTURE as described above, with the car eq to the hash
|
2006-11-24 11:22:05 +00:00
|
|
|
|
;; key. This holds the tree seen from root, for storing new nodes.
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(defvar compilation-locs ())
|
|
|
|
|
|
|
|
|
|
(defvar compilation-debug nil
|
2012-04-09 21:05:48 +08:00
|
|
|
|
"Set this to t before creating a *compilation* buffer.
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
Then every error line will have a debug text property with the matcher that
|
|
|
|
|
fit this line and the match data. Use `describe-text-properties'.")
|
1991-10-07 22:49:33 +00:00
|
|
|
|
|
1995-08-21 22:15:58 +00:00
|
|
|
|
(defvar compilation-exit-message-function nil "\
|
|
|
|
|
If non-nil, called when a compilation process dies to return a status message.
|
1996-01-06 20:54:19 +00:00
|
|
|
|
This should be a function of three arguments: process status, exit status,
|
|
|
|
|
and exit message; it returns a cons (MESSAGE . MODELINE) of the strings to
|
|
|
|
|
write into the compilation buffer, and to put in its mode line.")
|
1995-08-21 22:15:58 +00:00
|
|
|
|
|
2011-09-08 15:12:18 +03:00
|
|
|
|
(defcustom compilation-environment nil
|
|
|
|
|
"List of environment variables for compilation to inherit.
|
2003-07-28 16:06:55 +00:00
|
|
|
|
Each element should be a string of the form ENVVARNAME=VALUE.
|
|
|
|
|
This list is temporarily prepended to `process-environment' prior to
|
2011-09-08 15:12:18 +03:00
|
|
|
|
starting the compilation process."
|
|
|
|
|
:type '(repeat (string :tag "ENVVARNAME=VALUE"))
|
|
|
|
|
:options '(("LANG=C"))
|
|
|
|
|
:group 'compilation
|
|
|
|
|
:version "24.1")
|
2003-07-28 16:06:55 +00:00
|
|
|
|
|
1992-07-24 08:17:31 +00:00
|
|
|
|
;; History of compile commands.
|
|
|
|
|
(defvar compile-history nil)
|
|
|
|
|
|
2005-08-06 01:10:09 +00:00
|
|
|
|
(defface compilation-error
|
2011-08-18 14:36:19 +03:00
|
|
|
|
'((t :inherit error))
|
2005-08-06 01:10:09 +00:00
|
|
|
|
"Face used to highlight compiler errors."
|
2005-09-29 22:57:28 +00:00
|
|
|
|
:group 'compilation
|
2005-08-06 01:10:09 +00:00
|
|
|
|
:version "22.1")
|
|
|
|
|
|
2005-06-10 07:34:16 +00:00
|
|
|
|
(defface compilation-warning
|
2011-08-18 14:36:19 +03:00
|
|
|
|
'((t :inherit warning))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
"Face used to highlight compiler warnings."
|
2005-09-29 22:57:28 +00:00
|
|
|
|
:group 'compilation
|
2005-02-09 15:50:47 +00:00
|
|
|
|
:version "22.1")
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2005-06-10 07:34:16 +00:00
|
|
|
|
(defface compilation-info
|
2011-08-18 14:36:19 +03:00
|
|
|
|
'((t :inherit success))
|
2005-08-06 01:10:09 +00:00
|
|
|
|
"Face used to highlight compiler information."
|
2005-09-29 22:57:28 +00:00
|
|
|
|
:group 'compilation
|
2005-02-09 15:50:47 +00:00
|
|
|
|
:version "22.1")
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2012-06-03 22:37:13 +08:00
|
|
|
|
;; The next three faces must be able to stand out against the
|
|
|
|
|
;; `mode-line' and `mode-line-inactive' faces.
|
|
|
|
|
|
|
|
|
|
(defface compilation-mode-line-fail
|
|
|
|
|
'((default :inherit compilation-error)
|
|
|
|
|
(((class color) (min-colors 16)) (:foreground "Red1" :weight bold))
|
|
|
|
|
(((class color) (min-colors 8)) (:foreground "red"))
|
|
|
|
|
(t (:inverse-video t :weight bold)))
|
|
|
|
|
"Face for Compilation mode's \"error\" mode line indicator."
|
|
|
|
|
:group 'compilation
|
2012-08-15 09:29:11 -07:00
|
|
|
|
:version "24.3")
|
2012-06-03 22:37:13 +08:00
|
|
|
|
|
|
|
|
|
(defface compilation-mode-line-run
|
|
|
|
|
'((t :inherit compilation-warning))
|
|
|
|
|
"Face for Compilation mode's \"running\" mode line indicator."
|
|
|
|
|
:group 'compilation
|
2012-08-15 09:29:11 -07:00
|
|
|
|
:version "24.3")
|
2012-06-03 22:37:13 +08:00
|
|
|
|
|
|
|
|
|
(defface compilation-mode-line-exit
|
|
|
|
|
'((default :inherit compilation-info)
|
|
|
|
|
(((class color) (min-colors 16))
|
|
|
|
|
(:foreground "ForestGreen" :weight bold))
|
|
|
|
|
(((class color)) (:foreground "green" :weight bold))
|
|
|
|
|
(t (:weight bold)))
|
|
|
|
|
"Face for Compilation mode's \"exit\" mode line indicator."
|
|
|
|
|
:group 'compilation
|
2012-08-15 09:29:11 -07:00
|
|
|
|
:version "24.3")
|
2012-06-03 22:37:13 +08:00
|
|
|
|
|
2005-06-28 18:57:00 +00:00
|
|
|
|
(defface compilation-line-number
|
2011-02-02 12:14:49 -05:00
|
|
|
|
'((t :inherit font-lock-keyword-face))
|
2005-08-06 01:10:09 +00:00
|
|
|
|
"Face for displaying line numbers in compiler messages."
|
2005-09-29 22:57:28 +00:00
|
|
|
|
:group 'compilation
|
2005-06-28 18:57:00 +00:00
|
|
|
|
:version "22.1")
|
|
|
|
|
|
|
|
|
|
(defface compilation-column-number
|
2011-02-02 12:14:49 -05:00
|
|
|
|
'((t :inherit font-lock-doc-face))
|
2005-08-06 01:10:09 +00:00
|
|
|
|
"Face for displaying column numbers in compiler messages."
|
2005-09-29 22:57:28 +00:00
|
|
|
|
:group 'compilation
|
2005-06-28 18:57:00 +00:00
|
|
|
|
:version "22.1")
|
|
|
|
|
|
2006-04-02 20:21:11 +00:00
|
|
|
|
(defcustom compilation-message-face 'underline
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
"Face name to use for whole messages.
|
|
|
|
|
Faces `compilation-error-face', `compilation-warning-face',
|
|
|
|
|
`compilation-info-face', `compilation-line-face' and
|
2006-04-02 20:21:11 +00:00
|
|
|
|
`compilation-column-face' get prepended to this, when applicable."
|
|
|
|
|
:type 'face
|
|
|
|
|
:group 'compilation
|
|
|
|
|
:version "22.1")
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2005-08-09 21:34:40 +00:00
|
|
|
|
(defvar compilation-error-face 'compilation-error
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
"Face name to use for file name in error messages.")
|
|
|
|
|
|
2005-08-09 21:34:40 +00:00
|
|
|
|
(defvar compilation-warning-face 'compilation-warning
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
"Face name to use for file name in warning messages.")
|
|
|
|
|
|
2005-08-09 21:34:40 +00:00
|
|
|
|
(defvar compilation-info-face 'compilation-info
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
"Face name to use for file name in informational messages.")
|
|
|
|
|
|
2005-06-28 18:57:00 +00:00
|
|
|
|
(defvar compilation-line-face 'compilation-line-number
|
2005-08-09 21:34:40 +00:00
|
|
|
|
"Face name to use for line numbers in compiler messages.")
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2005-06-28 18:57:00 +00:00
|
|
|
|
(defvar compilation-column-face 'compilation-column-number
|
2005-08-06 01:10:09 +00:00
|
|
|
|
"Face name to use for column numbers in compiler messages.")
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
|
|
|
|
;; same faces as dired uses
|
|
|
|
|
(defvar compilation-enter-directory-face 'font-lock-function-name-face
|
2005-08-06 01:10:09 +00:00
|
|
|
|
"Face name to use for entering directory messages.")
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2011-02-02 12:14:49 -05:00
|
|
|
|
(defvar compilation-leave-directory-face 'font-lock-builtin-face
|
2005-08-06 01:10:09 +00:00
|
|
|
|
"Face name to use for leaving directory messages.")
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2004-04-04 12:56:01 +00:00
|
|
|
|
;; Used for compatibility with the old compile.el.
|
|
|
|
|
(defvar compilation-parse-errors-function nil)
|
2012-09-24 20:23:25 +08:00
|
|
|
|
(make-obsolete-variable 'compilation-parse-errors-function
|
|
|
|
|
'compilation-error-regexp-alist "24.1")
|
2004-04-04 12:56:01 +00:00
|
|
|
|
|
2007-07-10 16:01:25 +00:00
|
|
|
|
(defcustom compilation-auto-jump-to-first-error nil
|
2008-11-22 20:42:18 +00:00
|
|
|
|
"If non-nil, automatically jump to the first error during compilation."
|
2007-07-20 20:25:32 +00:00
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'compilation
|
|
|
|
|
:version "23.1")
|
2007-07-10 16:01:25 +00:00
|
|
|
|
|
|
|
|
|
(defvar compilation-auto-jump-to-next nil
|
|
|
|
|
"If non-nil, automatically jump to the next error encountered.")
|
|
|
|
|
(make-variable-buffer-local 'compilation-auto-jump-to-next)
|
|
|
|
|
|
2011-01-28 16:42:34 -05:00
|
|
|
|
;; (defvar compilation-buffer-modtime nil
|
|
|
|
|
;; "The buffer modification time, for buffers not associated with files.")
|
|
|
|
|
;; (make-variable-buffer-local 'compilation-buffer-modtime)
|
2007-10-20 06:30:18 +00:00
|
|
|
|
|
|
|
|
|
(defvar compilation-skip-to-next-location t
|
2012-04-09 21:05:48 +08:00
|
|
|
|
"If non-nil, skip multiple error messages for the same source location.")
|
2007-10-20 06:30:18 +00:00
|
|
|
|
|
|
|
|
|
(defcustom compilation-skip-threshold 1
|
|
|
|
|
"Compilation motion commands skip less important messages.
|
|
|
|
|
The value can be either 2 -- skip anything less than error, 1 --
|
|
|
|
|
skip anything less than warning or 0 -- don't skip any messages.
|
|
|
|
|
Note that all messages not positively identified as warning or
|
|
|
|
|
info, are considered errors."
|
2010-09-08 17:53:08 +02:00
|
|
|
|
:type '(choice (const :tag "Skip warnings and info" 2)
|
|
|
|
|
(const :tag "Skip info" 1)
|
|
|
|
|
(const :tag "No skip" 0))
|
2007-10-20 06:30:18 +00:00
|
|
|
|
:group 'compilation
|
|
|
|
|
:version "22.1")
|
|
|
|
|
|
2010-09-08 17:53:08 +02:00
|
|
|
|
(defun compilation-set-skip-threshold (level)
|
|
|
|
|
"Switch the `compilation-skip-threshold' level."
|
|
|
|
|
(interactive
|
|
|
|
|
(list
|
|
|
|
|
(mod (if current-prefix-arg
|
|
|
|
|
(prefix-numeric-value current-prefix-arg)
|
|
|
|
|
(1+ compilation-skip-threshold))
|
|
|
|
|
3)))
|
|
|
|
|
(setq compilation-skip-threshold level)
|
|
|
|
|
(message "Skipping %s"
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 19:13:41 -04:00
|
|
|
|
(pcase compilation-skip-threshold
|
2010-09-08 17:53:08 +02:00
|
|
|
|
(0 "Nothing")
|
|
|
|
|
(1 "Info messages")
|
|
|
|
|
(2 "Warnings and info"))))
|
|
|
|
|
|
2007-10-20 06:30:18 +00:00
|
|
|
|
(defcustom compilation-skip-visited nil
|
|
|
|
|
"Compilation motion commands skip visited messages if this is t.
|
|
|
|
|
Visited messages are ones for which the file, line and column have been jumped
|
|
|
|
|
to from the current content in the current compilation buffer, even if it was
|
|
|
|
|
from a different message."
|
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'compilation
|
|
|
|
|
:version "22.1")
|
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(defun compilation-face (type)
|
|
|
|
|
(or (and (car type) (match-end (car type)) compilation-warning-face)
|
|
|
|
|
(and (cdr type) (match-end (cdr type)) compilation-info-face)
|
|
|
|
|
compilation-error-face))
|
|
|
|
|
|
2011-01-28 16:42:34 -05:00
|
|
|
|
;; LOC (or location) is a list of (COLUMN LINE FILE-STRUCTURE nil nil)
|
|
|
|
|
|
|
|
|
|
;; COLUMN and LINE are numbers parsed from an error message. COLUMN and maybe
|
|
|
|
|
;; LINE will be nil for a message that doesn't contain them. Then the
|
|
|
|
|
;; location refers to a indented beginning of line or beginning of file.
|
|
|
|
|
;; Once any location in some file has been jumped to, the list is extended to
|
|
|
|
|
;; (COLUMN LINE FILE-STRUCTURE MARKER TIMESTAMP . VISITED)
|
|
|
|
|
;; for all LOCs pertaining to that file.
|
|
|
|
|
;; MARKER initially points to LINE and COLUMN in a buffer visiting that file.
|
|
|
|
|
;; Being a marker it sticks to some text, when the buffer grows or shrinks
|
|
|
|
|
;; before that point. VISITED is t if we have jumped there, else nil.
|
|
|
|
|
;; FIXME-omake: TIMESTAMP was used to try and handle "incremental compilation":
|
|
|
|
|
;; `omake -P' polls filesystem for changes and recompiles when a file is
|
|
|
|
|
;; modified using the same *compilation* buffer. this necessitates
|
|
|
|
|
;; re-parsing markers.
|
|
|
|
|
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 19:13:41 -04:00
|
|
|
|
;; (cl-defstruct (compilation--loc
|
2011-01-28 16:42:34 -05:00
|
|
|
|
;; (:constructor nil)
|
|
|
|
|
;; (:copier nil)
|
|
|
|
|
;; (:constructor compilation--make-loc
|
|
|
|
|
;; (file-struct line col marker))
|
|
|
|
|
;; (:conc-name compilation--loc->))
|
|
|
|
|
;; col line file-struct marker timestamp visited)
|
|
|
|
|
|
|
|
|
|
;; FIXME: We don't use a defstruct because of compilation-assq which looks up
|
|
|
|
|
;; and creates part of the LOC (only the first cons cell containing the COL).
|
|
|
|
|
|
|
|
|
|
(defmacro compilation--make-cdrloc (line file-struct marker)
|
|
|
|
|
`(list ,line ,file-struct ,marker nil))
|
|
|
|
|
(defmacro compilation--loc->col (loc) `(car ,loc))
|
|
|
|
|
(defmacro compilation--loc->line (loc) `(cadr ,loc))
|
|
|
|
|
(defmacro compilation--loc->file-struct (loc) `(nth 2 ,loc))
|
|
|
|
|
(defmacro compilation--loc->marker (loc) `(nth 3 ,loc))
|
|
|
|
|
;; (defmacro compilation--loc->timestamp (loc) `(nth 4 ,loc))
|
|
|
|
|
(defmacro compilation--loc->visited (loc) `(nthcdr 5 ,loc))
|
|
|
|
|
|
|
|
|
|
;; FILE-STRUCTURE is a list of
|
|
|
|
|
;; ((FILENAME DIRECTORY) FORMATS (LINE LOC ...) ...)
|
|
|
|
|
|
|
|
|
|
;; FILENAME is a string parsed from an error message. DIRECTORY is a string
|
|
|
|
|
;; obtained by following directory change messages. DIRECTORY will be nil for
|
|
|
|
|
;; an absolute filename. FORMATS is a list of formats to apply to FILENAME if
|
|
|
|
|
;; a file of that name can't be found.
|
|
|
|
|
;; The rest of the list is an alist of elements with LINE as key. The keys
|
|
|
|
|
;; are either nil or line numbers. If present, nil comes first, followed by
|
|
|
|
|
;; the numbers in decreasing order. The LOCs for each line are again an alist
|
|
|
|
|
;; ordered the same way. Note that the whole file structure is referenced in
|
|
|
|
|
;; every LOC.
|
|
|
|
|
|
|
|
|
|
(defmacro compilation--make-file-struct (file-spec formats &optional loc-tree)
|
|
|
|
|
`(cons ,file-spec (cons ,formats ,loc-tree)))
|
|
|
|
|
(defmacro compilation--file-struct->file-spec (fs) `(car ,fs))
|
|
|
|
|
(defmacro compilation--file-struct->formats (fs) `(cadr ,fs))
|
|
|
|
|
;; The FORMATS field plays the role of ANCHOR in the loc-tree.
|
|
|
|
|
(defmacro compilation--file-struct->loc-tree (fs) `(cdr ,fs))
|
|
|
|
|
|
|
|
|
|
;; MESSAGE is a list of (LOC TYPE END-LOC)
|
|
|
|
|
|
|
|
|
|
;; TYPE is 0 for info or 1 for warning if the message matcher identified it as
|
|
|
|
|
;; such, 2 otherwise (for a real error). END-LOC is a LOC pointing to the
|
|
|
|
|
;; other end, if the parsed message contained a range. If the end of the
|
|
|
|
|
;; range didn't specify a COLUMN, it defaults to -1, meaning end of line.
|
|
|
|
|
;; These are the value of the `compilation-message' text-properties in the
|
|
|
|
|
;; compilation buffer.
|
|
|
|
|
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 19:13:41 -04:00
|
|
|
|
(cl-defstruct (compilation--message
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(:constructor nil)
|
|
|
|
|
(:copier nil)
|
|
|
|
|
;; (:type list) ;Old representation.
|
|
|
|
|
(:constructor compilation--make-message (loc type end-loc))
|
|
|
|
|
(:conc-name compilation--message->))
|
|
|
|
|
loc type end-loc)
|
|
|
|
|
|
2011-01-31 12:09:42 -05:00
|
|
|
|
(defvar compilation--previous-directory-cache nil
|
|
|
|
|
"A pair (POS . RES) caching the result of previous directory search.
|
|
|
|
|
Basically, this pair says that calling
|
|
|
|
|
(previous-single-property-change POS 'compilation-directory)
|
|
|
|
|
returned RES, i.e. there is no change of `compilation-directory' between
|
|
|
|
|
POS and RES.")
|
2011-01-29 01:08:24 -05:00
|
|
|
|
(make-variable-buffer-local 'compilation--previous-directory-cache)
|
2011-01-31 12:09:42 -05:00
|
|
|
|
|
2011-04-22 20:44:26 +02:00
|
|
|
|
(defun compilation--flush-directory-cache (start _end)
|
2011-01-31 12:09:42 -05:00
|
|
|
|
(cond
|
|
|
|
|
((or (not compilation--previous-directory-cache)
|
|
|
|
|
(<= (car compilation--previous-directory-cache) start)))
|
|
|
|
|
((or (not (cdr compilation--previous-directory-cache))
|
2011-02-19 16:23:51 -05:00
|
|
|
|
(null (marker-buffer (cdr compilation--previous-directory-cache)))
|
2011-01-31 12:09:42 -05:00
|
|
|
|
(<= (cdr compilation--previous-directory-cache) start))
|
|
|
|
|
(set-marker (car compilation--previous-directory-cache) start))
|
|
|
|
|
(t (setq compilation--previous-directory-cache nil))))
|
|
|
|
|
|
2011-01-29 01:08:24 -05:00
|
|
|
|
(defun compilation--previous-directory (pos)
|
|
|
|
|
"Like (previous-single-property-change POS 'compilation-directory), but faster."
|
|
|
|
|
;; This avoids an N² behavior when there's no/few compilation-directory
|
|
|
|
|
;; entries, in which case each call to previous-single-property-change
|
|
|
|
|
;; ends up having to walk very far back to find the last change.
|
2011-01-31 12:09:42 -05:00
|
|
|
|
(if (and compilation--previous-directory-cache
|
|
|
|
|
(< pos (car compilation--previous-directory-cache))
|
2011-01-31 12:11:11 -05:00
|
|
|
|
(or (null (cdr compilation--previous-directory-cache))
|
|
|
|
|
(< (cdr compilation--previous-directory-cache) pos)))
|
2011-01-31 12:09:42 -05:00
|
|
|
|
;; No need to call previous-single-property-change.
|
|
|
|
|
(cdr compilation--previous-directory-cache)
|
2011-02-01 16:22:21 -05:00
|
|
|
|
|
2011-01-31 12:09:42 -05:00
|
|
|
|
(let* ((cache (and compilation--previous-directory-cache
|
|
|
|
|
(<= (car compilation--previous-directory-cache) pos)
|
|
|
|
|
(car compilation--previous-directory-cache)))
|
|
|
|
|
(prev
|
|
|
|
|
(previous-single-property-change
|
2011-03-11 23:29:22 -05:00
|
|
|
|
pos 'compilation-directory nil cache))
|
|
|
|
|
(res
|
|
|
|
|
(cond
|
|
|
|
|
((null cache)
|
|
|
|
|
(setq compilation--previous-directory-cache
|
|
|
|
|
(cons (copy-marker pos) (if prev (copy-marker prev))))
|
|
|
|
|
prev)
|
|
|
|
|
((and prev (= prev cache))
|
|
|
|
|
(if cache
|
|
|
|
|
(set-marker (car compilation--previous-directory-cache) pos)
|
|
|
|
|
(setq compilation--previous-directory-cache
|
|
|
|
|
(cons (copy-marker pos) nil)))
|
|
|
|
|
(cdr compilation--previous-directory-cache))
|
|
|
|
|
(t
|
|
|
|
|
(if cache
|
|
|
|
|
(progn
|
|
|
|
|
(set-marker cache pos)
|
|
|
|
|
(setcdr compilation--previous-directory-cache
|
|
|
|
|
(copy-marker prev)))
|
|
|
|
|
(setq compilation--previous-directory-cache
|
|
|
|
|
(cons (copy-marker pos) (if prev (copy-marker prev)))))
|
|
|
|
|
prev))))
|
|
|
|
|
(if (markerp res) (marker-position res) res))))
|
2011-01-29 01:08:24 -05:00
|
|
|
|
|
2005-03-03 20:08:21 +00:00
|
|
|
|
;; Internal function for calculating the text properties of a directory
|
2011-01-28 16:42:34 -05:00
|
|
|
|
;; change message. The compilation-directory property is important, because it
|
|
|
|
|
;; is the stack of nested enter-messages. Relative filenames on the following
|
2005-03-03 20:08:21 +00:00
|
|
|
|
;; lines are relative to the top of the stack.
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(defun compilation-directory-properties (idx leave)
|
|
|
|
|
(if leave (setq leave (match-end leave)))
|
|
|
|
|
;; find previous stack, and push onto it, or if `leave' pop it
|
2011-03-11 23:29:22 -05:00
|
|
|
|
(let ((dir (compilation--previous-directory (match-beginning 0))))
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(setq dir (if dir (or (get-text-property (1- dir) 'compilation-directory)
|
|
|
|
|
(get-text-property dir 'compilation-directory))))
|
2011-01-28 17:06:20 -05:00
|
|
|
|
`(font-lock-face ,(if leave
|
|
|
|
|
compilation-leave-directory-face
|
|
|
|
|
compilation-enter-directory-face)
|
2011-01-28 16:11:19 -05:00
|
|
|
|
compilation-directory ,(if leave
|
|
|
|
|
(or (cdr dir)
|
|
|
|
|
'(nil)) ; nil only isn't a property-change
|
|
|
|
|
(cons (match-string-no-properties idx) dir))
|
2011-01-28 17:06:20 -05:00
|
|
|
|
;; Place a `compilation-message' everywhere we change text-properties
|
|
|
|
|
;; so compilation--remove-properties can know what to remove.
|
|
|
|
|
compilation-message ,(compilation--make-message nil 0 nil)
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
mouse-face highlight
|
2004-04-16 23:22:07 +00:00
|
|
|
|
keymap compilation-button-map
|
2007-03-26 10:20:27 +00:00
|
|
|
|
help-echo "mouse-2: visit destination directory")))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2006-11-24 11:22:05 +00:00
|
|
|
|
;; Data type `reverse-ordered-alist' retriever. This function retrieves the
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
;; KEY element from the ALIST, creating it in the right position if not already
|
|
|
|
|
;; present. ALIST structure is
|
|
|
|
|
;; '(ANCHOR (KEY1 ...) (KEY2 ...)... (KEYn ALIST ...))
|
|
|
|
|
;; ANCHOR is ignored, but necessary so that elements can be inserted. KEY1
|
2006-11-24 11:22:05 +00:00
|
|
|
|
;; may be nil. The other KEYs are ordered backwards so that growing line
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
;; numbers can be inserted in front and searching can abort after half the
|
|
|
|
|
;; list on average.
|
2004-04-16 23:22:07 +00:00
|
|
|
|
(eval-when-compile ;Don't keep it at runtime if not needed.
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(defmacro compilation-assq (key alist)
|
|
|
|
|
`(let* ((l1 ,alist)
|
|
|
|
|
(l2 (cdr l1)))
|
|
|
|
|
(car (if (if (null ,key)
|
|
|
|
|
(if l2 (null (caar l2)))
|
|
|
|
|
(while (if l2 (if (caar l2) (< ,key (caar l2)) t))
|
|
|
|
|
(setq l1 l2
|
|
|
|
|
l2 (cdr l1)))
|
|
|
|
|
(if l2 (eq ,key (caar l2))))
|
|
|
|
|
l2
|
2004-04-16 23:22:07 +00:00
|
|
|
|
(setcdr l1 (cons (list ,key) l2)))))))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2007-07-10 16:01:25 +00:00
|
|
|
|
(defun compilation-auto-jump (buffer pos)
|
|
|
|
|
(with-current-buffer buffer
|
|
|
|
|
(goto-char pos)
|
2008-05-01 23:56:52 +00:00
|
|
|
|
(let ((win (get-buffer-window buffer 0)))
|
|
|
|
|
(if win (set-window-point win pos)))
|
2008-02-12 23:41:59 +00:00
|
|
|
|
(if compilation-auto-jump-to-first-error
|
2013-12-16 16:07:10 +08:00
|
|
|
|
(compile-goto-error))))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
|
|
|
|
;; This function is the central driver, called when font-locking to gather
|
|
|
|
|
;; all information needed to later jump to corresponding source code.
|
|
|
|
|
;; Return a property list with all meta information on this error location.
|
2005-09-26 00:01:27 +00:00
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(defun compilation-error-properties (file line end-line col end-col type fmt)
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(unless (text-property-not-all (match-beginning 0) (point)
|
|
|
|
|
'compilation-message nil)
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(if file
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(when (stringp
|
|
|
|
|
(setq file (if (functionp file) (funcall file)
|
|
|
|
|
(match-string-no-properties file))))
|
|
|
|
|
(let ((dir
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(unless (file-name-absolute-p file)
|
2011-03-11 23:29:22 -05:00
|
|
|
|
(let ((pos (compilation--previous-directory
|
|
|
|
|
(match-beginning 0))))
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(when pos
|
|
|
|
|
(or (get-text-property (1- pos) 'compilation-directory)
|
|
|
|
|
(get-text-property pos 'compilation-directory)))))))
|
2004-04-20 20:36:43 +00:00
|
|
|
|
(setq file (cons file (car dir)))))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
;; This message didn't mention one, get it from previous
|
2005-09-26 00:01:27 +00:00
|
|
|
|
(let ((prev-pos
|
|
|
|
|
;; Find the previous message.
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(previous-single-property-change (point) 'compilation-message)))
|
2005-09-26 00:01:27 +00:00
|
|
|
|
(if prev-pos
|
|
|
|
|
;; Get the file structure that belongs to it.
|
|
|
|
|
(let* ((prev
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(or (get-text-property (1- prev-pos) 'compilation-message)
|
|
|
|
|
(get-text-property prev-pos 'compilation-message)))
|
2011-08-20 22:07:00 -04:00
|
|
|
|
(prev-file-struct
|
|
|
|
|
(and prev
|
|
|
|
|
(compilation--loc->file-struct
|
|
|
|
|
(compilation--message->loc prev)))))
|
|
|
|
|
|
2005-09-26 00:01:27 +00:00
|
|
|
|
;; Construct FILE . DIR from that.
|
2011-08-20 22:07:00 -04:00
|
|
|
|
(if prev-file-struct
|
|
|
|
|
(setq file (cons (caar prev-file-struct)
|
|
|
|
|
(cadr (car prev-file-struct)))))))
|
2005-09-26 00:01:27 +00:00
|
|
|
|
(unless file
|
|
|
|
|
(setq file '("*unknown*")))))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
;; All of these fields are optional, get them only if we have an index, and
|
|
|
|
|
;; it matched some part of the message.
|
|
|
|
|
(and line
|
|
|
|
|
(setq line (match-string-no-properties line))
|
|
|
|
|
(setq line (string-to-number line)))
|
|
|
|
|
(and end-line
|
|
|
|
|
(setq end-line (match-string-no-properties end-line))
|
|
|
|
|
(setq end-line (string-to-number end-line)))
|
2004-09-02 16:35:17 +00:00
|
|
|
|
(if col
|
|
|
|
|
(if (functionp col)
|
|
|
|
|
(setq col (funcall col))
|
|
|
|
|
(and
|
|
|
|
|
(setq col (match-string-no-properties col))
|
2011-11-18 10:09:42 -05:00
|
|
|
|
(setq col (string-to-number col)))))
|
2004-09-02 16:35:17 +00:00
|
|
|
|
(if (and end-col (functionp end-col))
|
|
|
|
|
(setq end-col (funcall end-col))
|
|
|
|
|
(if (and end-col (setq end-col (match-string-no-properties end-col)))
|
2011-11-18 10:09:42 -05:00
|
|
|
|
(setq end-col (- (string-to-number end-col) -1))
|
2004-09-02 16:35:17 +00:00
|
|
|
|
(if end-line (setq end-col -1))))
|
2004-04-16 23:06:34 +00:00
|
|
|
|
(if (consp type) ; not a static type, check what it is.
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(setq type (or (and (car type) (match-end (car type)) 1)
|
|
|
|
|
(and (cdr type) (match-end (cdr type)) 0)
|
|
|
|
|
2)))
|
2007-07-10 16:01:25 +00:00
|
|
|
|
|
|
|
|
|
(when (and compilation-auto-jump-to-next
|
|
|
|
|
(>= type compilation-skip-threshold))
|
|
|
|
|
(kill-local-variable 'compilation-auto-jump-to-next)
|
|
|
|
|
(run-with-timer 0 nil 'compilation-auto-jump
|
|
|
|
|
(current-buffer) (match-beginning 0)))
|
|
|
|
|
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(compilation-internal-error-properties
|
|
|
|
|
file line end-line col end-col type fmt)))
|
2004-04-20 20:36:43 +00:00
|
|
|
|
|
2004-11-15 23:10:38 +00:00
|
|
|
|
(defun compilation-move-to-column (col screen)
|
|
|
|
|
"Go to column COL on the current line.
|
|
|
|
|
If SCREEN is non-nil, columns are screen columns, otherwise, they are
|
|
|
|
|
just char-counts."
|
2011-11-18 10:09:42 -05:00
|
|
|
|
(setq col (- col compilation-first-column))
|
2004-11-15 23:10:38 +00:00
|
|
|
|
(if screen
|
2009-03-03 22:26:24 +00:00
|
|
|
|
(move-to-column (max col 0))
|
2004-11-15 23:10:38 +00:00
|
|
|
|
(goto-char (min (+ (line-beginning-position) col) (line-end-position)))))
|
|
|
|
|
|
2005-09-12 05:01:06 +00:00
|
|
|
|
(defun compilation-internal-error-properties (file line end-line col end-col type fmts)
|
2004-04-20 20:36:43 +00:00
|
|
|
|
"Get the meta-info that will be added as text-properties.
|
|
|
|
|
LINE, END-LINE, COL, END-COL are integers or nil.
|
2005-09-12 05:01:06 +00:00
|
|
|
|
TYPE can be 0, 1, or 2, meaning error, warning, or just info.
|
|
|
|
|
FILE should be (FILENAME) or (RELATIVE-FILENAME . DIRNAME) or nil.
|
|
|
|
|
FMTS is a list of format specs for transforming the file name.
|
|
|
|
|
(See `compilation-error-regexp-alist'.)"
|
2004-04-20 20:36:43 +00:00
|
|
|
|
(unless file (setq file '("*unknown*")))
|
2005-09-12 05:01:06 +00:00
|
|
|
|
(let* ((file-struct (compilation-get-file-structure file fmts))
|
|
|
|
|
;; Get first already existing marker (if any has one, all have one).
|
|
|
|
|
;; Do this first, as the compilation-assq`s may create new nodes.
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(marker-line ; a line structure
|
|
|
|
|
(cadr (compilation--file-struct->loc-tree file-struct)))
|
|
|
|
|
(marker
|
|
|
|
|
(if marker-line (compilation--loc->marker (cadr marker-line))))
|
2011-11-09 09:04:13 -05:00
|
|
|
|
(screen-columns compilation-error-screen-columns)
|
2012-01-31 23:32:21 -08:00
|
|
|
|
(first-column compilation-first-column)
|
2004-04-20 20:36:43 +00:00
|
|
|
|
end-marker loc end-loc)
|
|
|
|
|
(if (not (and marker (marker-buffer marker)))
|
2005-09-12 05:01:06 +00:00
|
|
|
|
(setq marker nil) ; no valid marker for this file
|
2012-05-06 12:52:58 +08:00
|
|
|
|
(unless line (setq line 1)) ; normalize no linenumber to line 1
|
2004-04-25 12:55:43 +00:00
|
|
|
|
(catch 'marker ; find nearest loc, at least one exists
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(dolist (x (cddr (compilation--file-struct->loc-tree
|
|
|
|
|
file-struct))) ; Loop over remaining lines.
|
2012-05-06 12:52:58 +08:00
|
|
|
|
(if (> (car x) line) ; Still bigger.
|
2004-04-20 20:36:43 +00:00
|
|
|
|
(setq marker-line x)
|
2012-05-06 12:52:58 +08:00
|
|
|
|
(if (> (- (or (car marker-line) 1) line)
|
|
|
|
|
(- line (car x))) ; Current line is nearer.
|
2004-04-20 20:36:43 +00:00
|
|
|
|
(setq marker-line x))
|
|
|
|
|
(throw 'marker t))))
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(setq marker (compilation--loc->marker (cadr marker-line))
|
2004-04-25 12:55:43 +00:00
|
|
|
|
marker-line (or (car marker-line) 1))
|
2004-04-20 20:36:43 +00:00
|
|
|
|
(with-current-buffer (marker-buffer marker)
|
2011-11-09 09:04:13 -05:00
|
|
|
|
(let ((screen-columns
|
|
|
|
|
;; Obey the compilation-error-screen-columns of the target
|
|
|
|
|
;; buffer if its major mode set it buffer-locally.
|
|
|
|
|
(if (local-variable-p 'compilation-error-screen-columns)
|
2012-01-31 23:32:21 -08:00
|
|
|
|
compilation-error-screen-columns screen-columns))
|
|
|
|
|
(compilation-first-column
|
|
|
|
|
(if (local-variable-p 'compilation-first-column)
|
|
|
|
|
compilation-first-column first-column)))
|
2011-11-09 09:04:13 -05:00
|
|
|
|
(save-excursion
|
2005-11-07 00:49:17 +00:00
|
|
|
|
(save-restriction
|
|
|
|
|
(widen)
|
|
|
|
|
(goto-char (marker-position marker))
|
2012-05-06 12:52:58 +08:00
|
|
|
|
;; Set end-marker if appropriate and go to line.
|
|
|
|
|
(if (not (or end-col end-line))
|
|
|
|
|
(beginning-of-line (- line marker-line -1))
|
2005-11-07 00:49:17 +00:00
|
|
|
|
(beginning-of-line (- (or end-line line) marker-line -1))
|
|
|
|
|
(if (or (null end-col) (< end-col 0))
|
|
|
|
|
(end-of-line)
|
2011-11-09 09:04:13 -05:00
|
|
|
|
(compilation-move-to-column end-col screen-columns))
|
2012-05-06 12:52:58 +08:00
|
|
|
|
(setq end-marker (point-marker))
|
|
|
|
|
(when end-line (beginning-of-line (- line end-line -1))))
|
2005-11-07 00:49:17 +00:00
|
|
|
|
(if col
|
2011-11-09 09:04:13 -05:00
|
|
|
|
(compilation-move-to-column col screen-columns)
|
2005-11-07 00:49:17 +00:00
|
|
|
|
(forward-to-indentation 0))
|
2011-11-09 09:04:13 -05:00
|
|
|
|
(setq marker (point-marker)))))))
|
2004-04-20 20:36:43 +00:00
|
|
|
|
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(setq loc (compilation-assq line (compilation--file-struct->loc-tree
|
|
|
|
|
file-struct)))
|
|
|
|
|
(setq end-loc
|
2004-04-20 20:36:43 +00:00
|
|
|
|
(if end-line
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(compilation-assq
|
|
|
|
|
end-col (compilation-assq
|
|
|
|
|
end-line (compilation--file-struct->loc-tree
|
|
|
|
|
file-struct)))
|
2004-04-20 20:36:43 +00:00
|
|
|
|
(if end-col ; use same line element
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(compilation-assq end-col loc))))
|
2004-04-20 20:36:43 +00:00
|
|
|
|
(setq loc (compilation-assq col loc))
|
|
|
|
|
;; If they are new, make the loc(s) reference the file they point to.
|
2011-01-28 16:42:34 -05:00
|
|
|
|
;; FIXME-omake: there's a problem with timestamps here: the markers
|
|
|
|
|
;; relative to which we computed the current `marker' have a timestamp
|
|
|
|
|
;; almost guaranteed to be different from compilation-buffer-modtime, so if
|
|
|
|
|
;; we use their timestamp, we'll never use `loc' since the timestamp won't
|
|
|
|
|
;; match compilation-buffer-modtime, and if we use
|
|
|
|
|
;; compilation-buffer-modtime then we have different timestamps for
|
|
|
|
|
;; locations that were computed together, which doesn't make sense either.
|
|
|
|
|
;; I think this points to a fundamental problem in our approach to the
|
|
|
|
|
;; "omake -P" problem. --Stef
|
|
|
|
|
(or (cdr loc)
|
|
|
|
|
(setcdr loc (compilation--make-cdrloc line file-struct marker)))
|
2004-04-20 20:36:43 +00:00
|
|
|
|
(if end-loc
|
2005-09-12 05:01:06 +00:00
|
|
|
|
(or (cdr end-loc)
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(setcdr end-loc
|
|
|
|
|
(compilation--make-cdrloc (or end-line line) file-struct
|
|
|
|
|
end-marker))))
|
2004-04-20 20:36:43 +00:00
|
|
|
|
|
|
|
|
|
;; Must start with face
|
2011-01-28 17:06:20 -05:00
|
|
|
|
`(font-lock-face ,compilation-message-face
|
2011-01-28 16:42:34 -05:00
|
|
|
|
compilation-message ,(compilation--make-message loc type end-loc)
|
2011-01-28 16:11:19 -05:00
|
|
|
|
help-echo ,(if col
|
|
|
|
|
"mouse-2: visit this file, line and column"
|
|
|
|
|
(if line
|
|
|
|
|
"mouse-2: visit this file and line"
|
|
|
|
|
"mouse-2: visit this file"))
|
|
|
|
|
keymap compilation-button-map
|
|
|
|
|
mouse-face highlight)))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(defun compilation--put-prop (matchnum prop val)
|
|
|
|
|
(when (and (integerp matchnum) (match-beginning matchnum))
|
|
|
|
|
(put-text-property
|
|
|
|
|
(match-beginning matchnum) (match-end matchnum)
|
|
|
|
|
prop val)))
|
|
|
|
|
|
|
|
|
|
(defun compilation--remove-properties (&optional start end)
|
|
|
|
|
(with-silent-modifications
|
|
|
|
|
;; When compile.el used font-lock directly, we could just remove all
|
|
|
|
|
;; our text-properties in one go, but now that we manually place
|
|
|
|
|
;; font-lock-face, we have to be careful to only remove the font-lock-face
|
|
|
|
|
;; we placed.
|
|
|
|
|
;; (remove-list-of-text-properties
|
|
|
|
|
;; (or start (point-min)) (or end (point-max))
|
|
|
|
|
;; '(compilation-debug compilation-directory compilation-message
|
|
|
|
|
;; font-lock-face help-echo mouse-face))
|
|
|
|
|
(let (next)
|
|
|
|
|
(unless start (setq start (point-min)))
|
|
|
|
|
(unless end (setq end (point-max)))
|
2011-01-31 12:09:42 -05:00
|
|
|
|
(compilation--flush-directory-cache start end)
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(while
|
|
|
|
|
(progn
|
|
|
|
|
(setq next (or (next-single-property-change
|
|
|
|
|
start 'compilation-message nil end)
|
|
|
|
|
end))
|
|
|
|
|
(when (get-text-property start 'compilation-message)
|
|
|
|
|
(remove-list-of-text-properties
|
|
|
|
|
start next
|
|
|
|
|
'(compilation-debug compilation-directory compilation-message
|
|
|
|
|
font-lock-face help-echo mouse-face)))
|
|
|
|
|
(< next end))
|
|
|
|
|
(setq start next)))))
|
|
|
|
|
|
|
|
|
|
(defun compilation--parse-region (start end)
|
|
|
|
|
(goto-char end)
|
|
|
|
|
(unless (bolp)
|
|
|
|
|
;; We generally don't like to parse partial lines.
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 19:13:41 -04:00
|
|
|
|
(cl-assert (eobp))
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(when (let ((proc (get-buffer-process (current-buffer))))
|
|
|
|
|
(and proc (memq (process-status proc) '(run open))))
|
|
|
|
|
(setq end (line-beginning-position))))
|
|
|
|
|
(compilation--remove-properties start end)
|
2004-04-08 22:16:14 +00:00
|
|
|
|
(if compilation-parse-errors-function
|
|
|
|
|
;; An old package! Try the compatibility code.
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(progn
|
|
|
|
|
(goto-char start)
|
|
|
|
|
(compilation--compat-parse-errors end))
|
|
|
|
|
|
|
|
|
|
;; compilation-directory-matcher is the only part that really needs to be
|
|
|
|
|
;; parsed sequentially. So we could split it out, handle directories
|
|
|
|
|
;; like syntax-propertize, and the rest as font-lock-keywords. But since
|
|
|
|
|
;; we want to have it work even when font-lock is off, we'd then need to
|
|
|
|
|
;; use our own compilation-parsed text-property to keep track of the parts
|
|
|
|
|
;; that have already been parsed.
|
|
|
|
|
(goto-char start)
|
|
|
|
|
(while (re-search-forward (car compilation-directory-matcher)
|
|
|
|
|
end t)
|
2011-01-31 12:09:42 -05:00
|
|
|
|
(compilation--flush-directory-cache (match-beginning 0) (match-end 0))
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(when compilation-debug
|
|
|
|
|
(font-lock-append-text-property
|
|
|
|
|
(match-beginning 0) (match-end 0)
|
|
|
|
|
'compilation-debug
|
|
|
|
|
(vector 'directory compilation-directory-matcher)))
|
|
|
|
|
(dolist (elt (cdr compilation-directory-matcher))
|
|
|
|
|
(add-text-properties (match-beginning (car elt))
|
|
|
|
|
(match-end (car elt))
|
|
|
|
|
(compilation-directory-properties
|
|
|
|
|
(car elt) (cdr elt)))))
|
|
|
|
|
|
|
|
|
|
(compilation-parse-errors start end)))
|
|
|
|
|
|
|
|
|
|
(defun compilation-parse-errors (start end &rest rules)
|
|
|
|
|
"Parse errors between START and END.
|
|
|
|
|
The errors recognized are the ones specified in RULES which default
|
|
|
|
|
to `compilation-error-regexp-alist' if RULES is nil."
|
|
|
|
|
(dolist (item (or rules compilation-error-regexp-alist))
|
|
|
|
|
(if (symbolp item)
|
|
|
|
|
(setq item (cdr (assq item
|
|
|
|
|
compilation-error-regexp-alist-alist))))
|
|
|
|
|
(let ((file (nth 1 item))
|
|
|
|
|
(line (nth 2 item))
|
|
|
|
|
(col (nth 3 item))
|
|
|
|
|
(type (nth 4 item))
|
|
|
|
|
(pat (car item))
|
|
|
|
|
end-line end-col fmt
|
|
|
|
|
props)
|
|
|
|
|
|
|
|
|
|
;; omake reports some error indented, so skip the indentation.
|
|
|
|
|
;; another solution is to modify (some?) regexps in
|
|
|
|
|
;; `compilation-error-regexp-alist'.
|
|
|
|
|
;; note that omake usage is not limited to ocaml and C (for stubs).
|
|
|
|
|
;; FIXME-omake: Doing it here seems wrong, at least it should depend on
|
|
|
|
|
;; whether or not omake's own error messages are recognized.
|
|
|
|
|
(cond
|
|
|
|
|
((not (memq 'omake compilation-error-regexp-alist)) nil)
|
2013-01-06 17:23:26 -08:00
|
|
|
|
((string-match "\\`\\([^^]\\|\\^\\( \\*\\|\\[\\)\\)" pat)
|
2011-01-28 17:06:20 -05:00
|
|
|
|
nil) ;; Not anchored or anchored but already allows empty spaces.
|
|
|
|
|
(t (setq pat (concat "^ *" (substring pat 1)))))
|
|
|
|
|
|
|
|
|
|
(if (consp file) (setq fmt (cdr file) file (car file)))
|
|
|
|
|
(if (consp line) (setq end-line (cdr line) line (car line)))
|
|
|
|
|
(if (consp col) (setq end-col (cdr col) col (car col)))
|
|
|
|
|
|
|
|
|
|
(if (functionp line)
|
|
|
|
|
;; The old compile.el had here an undocumented hook that
|
|
|
|
|
;; allowed `line' to be a function that computed the actual
|
|
|
|
|
;; error location. Let's do our best.
|
|
|
|
|
(progn
|
|
|
|
|
(goto-char start)
|
|
|
|
|
(while (re-search-forward pat end t)
|
|
|
|
|
(save-match-data
|
|
|
|
|
(when compilation-debug
|
|
|
|
|
(font-lock-append-text-property
|
|
|
|
|
(match-beginning 0) (match-end 0)
|
|
|
|
|
'compilation-debug (vector 'functionp item)))
|
|
|
|
|
(add-text-properties
|
|
|
|
|
(match-beginning 0) (match-end 0)
|
|
|
|
|
(compilation--compat-error-properties
|
|
|
|
|
(funcall line (cons (match-string file)
|
|
|
|
|
(cons default-directory
|
|
|
|
|
(nthcdr 4 item)))
|
|
|
|
|
(if col (match-string col))))))
|
|
|
|
|
(compilation--put-prop
|
|
|
|
|
file 'font-lock-face compilation-error-face)))
|
|
|
|
|
|
|
|
|
|
(unless (or (null (nth 5 item)) (integerp (nth 5 item)))
|
|
|
|
|
(error "HYPERLINK should be an integer: %s" (nth 5 item)))
|
|
|
|
|
|
|
|
|
|
(goto-char start)
|
|
|
|
|
(while (re-search-forward pat end t)
|
|
|
|
|
(when (setq props (compilation-error-properties
|
|
|
|
|
file line end-line col end-col (or type 2) fmt))
|
|
|
|
|
|
|
|
|
|
(when (integerp file)
|
|
|
|
|
(compilation--put-prop
|
|
|
|
|
file 'font-lock-face
|
|
|
|
|
(if (consp type)
|
|
|
|
|
(compilation-face type)
|
|
|
|
|
(symbol-value (aref [compilation-info-face
|
|
|
|
|
compilation-warning-face
|
|
|
|
|
compilation-error-face]
|
|
|
|
|
(or type 2))))))
|
|
|
|
|
|
|
|
|
|
(compilation--put-prop
|
|
|
|
|
line 'font-lock-face compilation-line-face)
|
|
|
|
|
(compilation--put-prop
|
|
|
|
|
end-line 'font-lock-face compilation-line-face)
|
|
|
|
|
|
|
|
|
|
(compilation--put-prop
|
|
|
|
|
col 'font-lock-face compilation-column-face)
|
|
|
|
|
(compilation--put-prop
|
|
|
|
|
end-col 'font-lock-face compilation-column-face)
|
|
|
|
|
|
2012-09-16 12:31:02 +08:00
|
|
|
|
;; Obey HIGHLIGHT.
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(dolist (extra-item (nthcdr 6 item))
|
|
|
|
|
(let ((mn (pop extra-item)))
|
|
|
|
|
(when (match-beginning mn)
|
|
|
|
|
(let ((face (eval (car extra-item))))
|
|
|
|
|
(cond
|
|
|
|
|
((null face))
|
2012-09-16 12:31:02 +08:00
|
|
|
|
((or (symbolp face) (stringp face))
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(put-text-property
|
|
|
|
|
(match-beginning mn) (match-end mn)
|
|
|
|
|
'font-lock-face face))
|
2012-09-16 12:31:02 +08:00
|
|
|
|
((and (listp face)
|
|
|
|
|
(eq (car face) 'face)
|
|
|
|
|
(or (symbolp (cadr face))
|
|
|
|
|
(stringp (cadr face))))
|
2013-10-07 01:15:48 -04:00
|
|
|
|
(compilation--put-prop mn 'font-lock-face (cadr face))
|
2012-09-16 12:31:02 +08:00
|
|
|
|
(add-text-properties
|
|
|
|
|
(match-beginning mn) (match-end mn)
|
|
|
|
|
(nthcdr 2 face)))
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(t
|
|
|
|
|
(error "Don't know how to handle face %S"
|
|
|
|
|
face)))))))
|
|
|
|
|
(let ((mn (or (nth 5 item) 0)))
|
|
|
|
|
(when compilation-debug
|
|
|
|
|
(font-lock-append-text-property
|
|
|
|
|
(match-beginning 0) (match-end 0)
|
|
|
|
|
'compilation-debug (vector 'std item props)))
|
|
|
|
|
(add-text-properties
|
|
|
|
|
(match-beginning mn) (match-end mn)
|
|
|
|
|
(cddr props))
|
|
|
|
|
(font-lock-append-text-property
|
|
|
|
|
(match-beginning mn) (match-end mn)
|
|
|
|
|
'font-lock-face (cadr props)))))))))
|
|
|
|
|
|
|
|
|
|
(defvar compilation--parsed -1)
|
|
|
|
|
(make-variable-buffer-local 'compilation--parsed)
|
|
|
|
|
|
|
|
|
|
(defun compilation--ensure-parse (limit)
|
|
|
|
|
"Make sure the text has been parsed up to LIMIT."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char limit)
|
|
|
|
|
(setq limit (line-beginning-position 2))
|
|
|
|
|
(unless (markerp compilation--parsed)
|
|
|
|
|
;; We use a marker for compilation--parsed so that users (such as
|
|
|
|
|
;; 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)))
|
|
|
|
|
(when (< compilation--parsed limit)
|
|
|
|
|
(let ((start (max compilation--parsed (point-min))))
|
|
|
|
|
(move-marker compilation--parsed limit)
|
|
|
|
|
(goto-char start)
|
|
|
|
|
(forward-line 0) ;Not line-beginning-position: ignore (comint) fields.
|
2013-10-07 01:15:48 -04:00
|
|
|
|
(while (and (not (bobp))
|
|
|
|
|
(get-text-property (1- (point)) 'compilation-multiline))
|
|
|
|
|
(forward-line -1))
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(with-silent-modifications
|
|
|
|
|
(compilation--parse-region (point) compilation--parsed)))))
|
|
|
|
|
nil)
|
|
|
|
|
|
2011-04-22 20:44:26 +02:00
|
|
|
|
(defun compilation--flush-parse (start _end)
|
2011-01-28 17:06:20 -05:00
|
|
|
|
"Mark the region between START and END for re-parsing."
|
|
|
|
|
(if (markerp compilation--parsed)
|
|
|
|
|
(move-marker compilation--parsed (min start compilation--parsed))))
|
|
|
|
|
|
|
|
|
|
(defun compilation-mode-font-lock-keywords ()
|
|
|
|
|
"Return expressions to highlight in Compilation mode."
|
|
|
|
|
(append
|
|
|
|
|
'((compilation--ensure-parse))
|
|
|
|
|
compilation-mode-font-lock-keywords))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2008-12-04 23:04:39 +00:00
|
|
|
|
(defun compilation-read-command (command)
|
|
|
|
|
(read-shell-command "Compile command: " command
|
|
|
|
|
(if (equal (car compile-history) command)
|
|
|
|
|
'(compile-history . 1)
|
|
|
|
|
'compile-history)))
|
|
|
|
|
|
1995-08-21 22:15:58 +00:00
|
|
|
|
|
1991-10-07 22:49:33 +00:00
|
|
|
|
;;;###autoload
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(defun compile (command &optional comint)
|
1990-07-13 03:12:54 +00:00
|
|
|
|
"Compile the program including the current buffer. Default: run `make'.
|
|
|
|
|
Runs COMMAND, a shell command, in a separate process asynchronously
|
|
|
|
|
with output going to the buffer `*compilation*'.
|
1991-10-07 22:49:33 +00:00
|
|
|
|
|
1990-07-13 03:12:54 +00:00
|
|
|
|
You can then use the command \\[next-error] to find the next error message
|
|
|
|
|
and move to the source code that caused it.
|
|
|
|
|
|
2007-01-09 03:12:53 +00:00
|
|
|
|
If optional second arg COMINT is t the buffer will be in Comint mode with
|
|
|
|
|
`compilation-shell-minor-mode'.
|
|
|
|
|
|
Disambiguate function and variable references in docstrings.
* lisp/comint.el (comint-history-isearch-message): Fix ambiguous doc
string cross-reference(s).
* lisp/ffap.el (ffap-string-at-point-region, ffap-next)
(ffap-string-at-point, ffap-string-around)
(ffap-copy-string-as-kill, ffap-highlight-overlay)
(ffap-literally): Fix ambiguous doc string cross-reference(s).
* lisp/font-lock.el (font-lock-keywords-alist)
(font-lock-removed-keywords-alist): Fix ambiguous doc string
cross-reference(s).
* lisp/help-mode.el (help-xref-symbol-regexp): Add "call" as a hint for
a cross-reference to a function.
* lisp/info.el (Info-find-emacs-command-nodes): Fix ambiguous doc
string cross-reference(s).
* lisp/isearch.el (isearch-message-function, isearch-fail-pos): Fix
ambiguous doc string cross-reference(s).
* lisp/misearch.el (multi-isearch-next-buffer-function): Fix ambiguous
doc string cross-reference(s).
* lisp/newcomment.el (comment-box): Fix ambiguous doc string
cross-reference(s).
* lisp/printing.el (pr-txt-printer-alist, pr-ps-printer-alist)
(pr-setting-database): Fix ambiguous doc string
cross-reference(s).
* lisp/ps-print.el (ps-even-or-odd-pages, ps-spool-buffer-with-faces)
(ps-n-up-filling-database): Fix ambiguous doc string
cross-reference(s).
* lisp/server.el (server-buffer, server-log): Fix ambiguous doc string
cross-reference(s).
* lisp/simple.el (newline, delete-backward-char, delete-forward-char)
(minibuffer-history-isearch-message, kill-line, track-eol)
(temporary-goal-column): Fix ambiguous doc string
cross-reference(s).
* lisp/whitespace.el (whitespace-point)
(whitespace-font-lock-refontify, whitespace-bob-marker)
(whitespace-eob-marker): Fix ambiguous doc string
cross-reference(s).
* lisp/calc/calc.el (calc-highlight-selections-with-faces)
(calc-dispatch): Fix ambiguous doc string cross-reference(s).
* lisp/emacs-lisp/edebug.el (edebug-read, edebug-eval-defun): Fix
ambiguous doc string cross-reference(s).
* lisp/gnus/gnus-start.el (gnus-check-new-newsgroups): Fix ambiguous doc string
cross-reference(s).
* lisp/gnus/gnus-sum.el (gnus-summary-newsgroup-prefix): Fix ambiguous doc string
cross-reference(s).
* lisp/international/mule.el (add-to-coding-system-list): Fix ambiguous
doc string cross-reference(s).
* lisp/progmodes/cc-fonts.el (c-font-lock-keywords-3)
(c++-font-lock-keywords-3, objc-font-lock-keywords-3)
(java-font-lock-keywords-3, idl-font-lock-keywords-3)
(pike-font-lock-keywords-3): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/compile.el (compile): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/etags.el (tags-table-files)
(tags-table-files-function, tags-included-tables-function): Fix
ambiguous doc string cross-reference(s).
* lisp/progmodes/gdb-mi.el (gdb, gdb-setup-windows)
(gdb-restore-windows): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/flyspell.el (flyspell-mark-duplications-flag)
(flyspell-default-deplacement-commands): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/ispell.el (ispell-accept-output): Fix ambiguous doc
string cross-reference(s).
* lisp/textmodes/sgml-mode.el (html-tag-help): Fix ambiguous doc string
cross-reference(s).
* lisp/vc/compare-w.el (compare-ignore-whitespace)
(compare-ignore-case, compare-windows-dehighlight): Fix ambiguous
doc string cross-reference(s).
* lisp/vc/diff.el (diff): Fix ambiguous doc string cross-reference(s).
* src/insdel.c (Fcombine_after_change_execute, syms_of_insdel): Fix
ambiguous doc string cross-reference(s).
* src/keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
doc string cross-reference(s).
* src/window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
string cross-reference(s).
Fixes: debbugs:12686
2013-01-11 18:08:55 -05:00
|
|
|
|
Interactively, prompts for the command if the variable
|
2014-05-08 23:42:39 -07:00
|
|
|
|
`compilation-read-command' is non-nil; otherwise uses `compile-command'.
|
Disambiguate function and variable references in docstrings.
* lisp/comint.el (comint-history-isearch-message): Fix ambiguous doc
string cross-reference(s).
* lisp/ffap.el (ffap-string-at-point-region, ffap-next)
(ffap-string-at-point, ffap-string-around)
(ffap-copy-string-as-kill, ffap-highlight-overlay)
(ffap-literally): Fix ambiguous doc string cross-reference(s).
* lisp/font-lock.el (font-lock-keywords-alist)
(font-lock-removed-keywords-alist): Fix ambiguous doc string
cross-reference(s).
* lisp/help-mode.el (help-xref-symbol-regexp): Add "call" as a hint for
a cross-reference to a function.
* lisp/info.el (Info-find-emacs-command-nodes): Fix ambiguous doc
string cross-reference(s).
* lisp/isearch.el (isearch-message-function, isearch-fail-pos): Fix
ambiguous doc string cross-reference(s).
* lisp/misearch.el (multi-isearch-next-buffer-function): Fix ambiguous
doc string cross-reference(s).
* lisp/newcomment.el (comment-box): Fix ambiguous doc string
cross-reference(s).
* lisp/printing.el (pr-txt-printer-alist, pr-ps-printer-alist)
(pr-setting-database): Fix ambiguous doc string
cross-reference(s).
* lisp/ps-print.el (ps-even-or-odd-pages, ps-spool-buffer-with-faces)
(ps-n-up-filling-database): Fix ambiguous doc string
cross-reference(s).
* lisp/server.el (server-buffer, server-log): Fix ambiguous doc string
cross-reference(s).
* lisp/simple.el (newline, delete-backward-char, delete-forward-char)
(minibuffer-history-isearch-message, kill-line, track-eol)
(temporary-goal-column): Fix ambiguous doc string
cross-reference(s).
* lisp/whitespace.el (whitespace-point)
(whitespace-font-lock-refontify, whitespace-bob-marker)
(whitespace-eob-marker): Fix ambiguous doc string
cross-reference(s).
* lisp/calc/calc.el (calc-highlight-selections-with-faces)
(calc-dispatch): Fix ambiguous doc string cross-reference(s).
* lisp/emacs-lisp/edebug.el (edebug-read, edebug-eval-defun): Fix
ambiguous doc string cross-reference(s).
* lisp/gnus/gnus-start.el (gnus-check-new-newsgroups): Fix ambiguous doc string
cross-reference(s).
* lisp/gnus/gnus-sum.el (gnus-summary-newsgroup-prefix): Fix ambiguous doc string
cross-reference(s).
* lisp/international/mule.el (add-to-coding-system-list): Fix ambiguous
doc string cross-reference(s).
* lisp/progmodes/cc-fonts.el (c-font-lock-keywords-3)
(c++-font-lock-keywords-3, objc-font-lock-keywords-3)
(java-font-lock-keywords-3, idl-font-lock-keywords-3)
(pike-font-lock-keywords-3): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/compile.el (compile): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/etags.el (tags-table-files)
(tags-table-files-function, tags-included-tables-function): Fix
ambiguous doc string cross-reference(s).
* lisp/progmodes/gdb-mi.el (gdb, gdb-setup-windows)
(gdb-restore-windows): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/flyspell.el (flyspell-mark-duplications-flag)
(flyspell-default-deplacement-commands): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/ispell.el (ispell-accept-output): Fix ambiguous doc
string cross-reference(s).
* lisp/textmodes/sgml-mode.el (html-tag-help): Fix ambiguous doc string
cross-reference(s).
* lisp/vc/compare-w.el (compare-ignore-whitespace)
(compare-ignore-case, compare-windows-dehighlight): Fix ambiguous
doc string cross-reference(s).
* lisp/vc/diff.el (diff): Fix ambiguous doc string cross-reference(s).
* src/insdel.c (Fcombine_after_change_execute, syms_of_insdel): Fix
ambiguous doc string cross-reference(s).
* src/keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
doc string cross-reference(s).
* src/window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
string cross-reference(s).
Fixes: debbugs:12686
2013-01-11 18:08:55 -05:00
|
|
|
|
With prefix arg, always prompts.
|
2004-05-10 21:00:00 +00:00
|
|
|
|
Additionally, with universal prefix arg, compilation buffer will be in
|
|
|
|
|
comint mode, i.e. interactive.
|
1994-11-10 23:01:15 +00:00
|
|
|
|
|
2007-08-02 17:40:54 +00:00
|
|
|
|
To run more than one compilation at once, start one then rename
|
2003-07-07 20:53:19 +00:00
|
|
|
|
the \`*compilation*' buffer to some other name with
|
2007-08-02 17:40:54 +00:00
|
|
|
|
\\[rename-buffer]. Then _switch buffers_ and start the new compilation.
|
|
|
|
|
It will create a new \`*compilation*' buffer.
|
|
|
|
|
|
|
|
|
|
On most systems, termination of the main compilation process
|
|
|
|
|
kills its subprocesses.
|
1991-10-07 22:49:33 +00:00
|
|
|
|
|
|
|
|
|
The name used for the buffer is actually whatever is returned by
|
|
|
|
|
the function in `compilation-buffer-name-function', so you can set that
|
|
|
|
|
to a function that generates a unique name."
|
1994-01-01 16:32:44 +00:00
|
|
|
|
(interactive
|
2004-05-10 21:00:00 +00:00
|
|
|
|
(list
|
2004-11-08 12:19:14 +00:00
|
|
|
|
(let ((command (eval compile-command)))
|
|
|
|
|
(if (or compilation-read-command current-prefix-arg)
|
2008-12-04 23:04:39 +00:00
|
|
|
|
(compilation-read-command command)
|
2004-11-08 12:19:14 +00:00
|
|
|
|
command))
|
2004-05-10 21:00:00 +00:00
|
|
|
|
(consp current-prefix-arg)))
|
2001-07-19 21:46:37 +00:00
|
|
|
|
(unless (equal command (eval compile-command))
|
|
|
|
|
(setq compile-command command))
|
2010-04-07 12:20:35 -04:00
|
|
|
|
(save-some-buffers (not compilation-ask-about-save)
|
|
|
|
|
compilation-save-buffers-predicate)
|
2007-07-20 18:54:57 +00:00
|
|
|
|
(setq-default compilation-directory default-directory)
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(compilation-start command comint))
|
1990-07-13 03:12:54 +00:00
|
|
|
|
|
2001-07-19 21:46:37 +00:00
|
|
|
|
;; run compile with the default command line
|
2008-12-04 23:04:39 +00:00
|
|
|
|
(defun recompile (&optional edit-command)
|
2001-11-14 04:23:45 +00:00
|
|
|
|
"Re-compile the program including the current buffer.
|
2004-04-16 23:22:07 +00:00
|
|
|
|
If this is run in a Compilation mode buffer, re-use the arguments from the
|
2008-12-04 23:04:39 +00:00
|
|
|
|
original use. Otherwise, recompile using `compile-command'.
|
|
|
|
|
If the optional argument `edit-command' is non-nil, the command can be edited."
|
|
|
|
|
(interactive "P")
|
2010-04-07 12:20:35 -04:00
|
|
|
|
(save-some-buffers (not compilation-ask-about-save)
|
|
|
|
|
compilation-save-buffers-predicate)
|
2014-05-08 23:42:39 -07:00
|
|
|
|
(let ((default-directory (or compilation-directory default-directory))
|
|
|
|
|
(command (eval compile-command)))
|
2008-12-04 23:04:39 +00:00
|
|
|
|
(when edit-command
|
2014-05-08 23:42:39 -07:00
|
|
|
|
(setq command (compilation-read-command (or (car compilation-arguments)
|
|
|
|
|
command)))
|
|
|
|
|
(if compilation-arguments (setcar compilation-arguments command)))
|
|
|
|
|
(apply 'compilation-start (or compilation-arguments (list command)))))
|
1995-06-16 04:36:55 +00:00
|
|
|
|
|
1998-02-09 19:40:38 +00:00
|
|
|
|
(defcustom compilation-scroll-output nil
|
2007-07-10 16:01:25 +00:00
|
|
|
|
"Non-nil to scroll the *compilation* buffer window as output appears.
|
1998-02-09 19:40:38 +00:00
|
|
|
|
|
2004-04-16 23:22:07 +00:00
|
|
|
|
Setting it causes the Compilation mode commands to put point at the
|
1998-02-09 19:40:38 +00:00
|
|
|
|
end of their output window so that the end of the output is always
|
2008-02-12 23:41:59 +00:00
|
|
|
|
visible rather than the beginning.
|
|
|
|
|
|
|
|
|
|
The value `first-error' stops scrolling at the first error, and leaves
|
|
|
|
|
point on its location in the *compilation* buffer."
|
|
|
|
|
:type '(choice (const :tag "No scrolling" nil)
|
|
|
|
|
(const :tag "Scroll compilation output" t)
|
|
|
|
|
(const :tag "Stop scrolling at the first error" first-error))
|
1998-05-30 15:00:07 +00:00
|
|
|
|
:version "20.3"
|
1998-02-09 19:40:38 +00:00
|
|
|
|
:group 'compilation)
|
|
|
|
|
|
2001-10-05 12:43:13 +00:00
|
|
|
|
|
2011-04-22 20:44:26 +02:00
|
|
|
|
(defun compilation-buffer-name (name-of-mode mode-command name-function)
|
2001-10-05 12:43:13 +00:00
|
|
|
|
"Return the name of a compilation buffer to use.
|
2011-04-22 20:44:26 +02:00
|
|
|
|
If NAME-FUNCTION is non-nil, call it with one argument NAME-OF-MODE
|
2001-10-05 12:43:13 +00:00
|
|
|
|
to determine the buffer name.
|
|
|
|
|
Likewise if `compilation-buffer-name-function' is non-nil.
|
2007-08-02 17:40:54 +00:00
|
|
|
|
If current buffer has the major mode MODE-COMMAND,
|
2001-10-05 12:43:13 +00:00
|
|
|
|
return the name of the current buffer, so that it gets reused.
|
2011-04-22 20:44:26 +02:00
|
|
|
|
Otherwise, construct a buffer name from NAME-OF-MODE."
|
2002-10-28 07:30:33 +00:00
|
|
|
|
(cond (name-function
|
2011-04-22 20:44:26 +02:00
|
|
|
|
(funcall name-function name-of-mode))
|
2002-10-28 07:30:33 +00:00
|
|
|
|
(compilation-buffer-name-function
|
2011-04-22 20:44:26 +02:00
|
|
|
|
(funcall compilation-buffer-name-function name-of-mode))
|
2007-08-11 03:02:05 +00:00
|
|
|
|
((eq mode-command major-mode)
|
2001-10-05 12:43:13 +00:00
|
|
|
|
(buffer-name))
|
|
|
|
|
(t
|
2011-04-22 20:44:26 +02:00
|
|
|
|
(concat "*" (downcase name-of-mode) "*"))))
|
2001-10-05 12:43:13 +00:00
|
|
|
|
|
2012-08-29 14:15:12 -04:00
|
|
|
|
(defcustom compilation-always-kill nil
|
2012-08-30 10:22:24 +02:00
|
|
|
|
"If t, always kill a running compilation process before starting a new one.
|
|
|
|
|
If nil, ask to kill it."
|
2012-08-29 14:15:12 -04:00
|
|
|
|
:type 'boolean
|
|
|
|
|
:version "24.3"
|
|
|
|
|
:group 'compilation)
|
|
|
|
|
|
2005-08-27 14:38:22 +00:00
|
|
|
|
;;;###autoload
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(defun compilation-start (command &optional mode name-function highlight-regexp)
|
1990-07-13 03:12:54 +00:00
|
|
|
|
"Run compilation command COMMAND (low level interface).
|
2004-09-12 18:08:12 +00:00
|
|
|
|
If COMMAND starts with a cd command, that becomes the `default-directory'.
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
The rest of the arguments are optional; for them, nil means use the default.
|
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
MODE is the major mode to set in the compilation buffer. Mode
|
2004-04-16 23:22:07 +00:00
|
|
|
|
may also be t meaning use `compilation-shell-minor-mode' under `comint-mode'.
|
2007-08-02 17:40:54 +00:00
|
|
|
|
|
2005-08-26 18:07:25 +00:00
|
|
|
|
If NAME-FUNCTION is non-nil, call it with one argument (the mode name)
|
2007-08-02 17:40:54 +00:00
|
|
|
|
to determine the buffer name. Otherwise, the default is to
|
|
|
|
|
reuses the current buffer if it has the proper major mode,
|
|
|
|
|
else use or create a buffer with name based on the major mode.
|
2002-09-07 21:29:44 +00:00
|
|
|
|
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
If HIGHLIGHT-REGEXP is non-nil, `next-error' will temporarily highlight
|
2004-04-16 23:22:07 +00:00
|
|
|
|
the matching section of the visited source line; the default is to use the
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
global value of `compilation-highlight-regexp'.
|
|
|
|
|
|
1992-07-29 05:06:36 +00:00
|
|
|
|
Returns the compilation buffer created."
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(or mode (setq mode 'compilation-mode))
|
2004-09-12 18:08:12 +00:00
|
|
|
|
(let* ((name-of-mode
|
|
|
|
|
(if (eq mode t)
|
2009-02-18 15:37:40 +00:00
|
|
|
|
"compilation"
|
2010-09-08 17:53:08 +02:00
|
|
|
|
(replace-regexp-in-string "-mode\\'" "" (symbol-name mode))))
|
2004-10-20 22:31:56 +00:00
|
|
|
|
(thisdir default-directory)
|
2011-09-07 15:17:54 +03:00
|
|
|
|
(thisenv compilation-environment)
|
2004-09-12 18:08:12 +00:00
|
|
|
|
outwin outbuf)
|
2004-04-04 12:56:01 +00:00
|
|
|
|
(with-current-buffer
|
|
|
|
|
(setq outbuf
|
|
|
|
|
(get-buffer-create
|
2007-08-11 03:02:05 +00:00
|
|
|
|
(compilation-buffer-name name-of-mode mode name-function)))
|
1991-10-07 22:49:33 +00:00
|
|
|
|
(let ((comp-proc (get-buffer-process (current-buffer))))
|
2012-09-18 00:18:36 -04:00
|
|
|
|
(if comp-proc
|
|
|
|
|
(if (or (not (eq (process-status comp-proc) 'run))
|
|
|
|
|
(eq (process-query-on-exit-flag comp-proc) nil)
|
|
|
|
|
(yes-or-no-p
|
|
|
|
|
(format "A %s process is running; kill it? "
|
|
|
|
|
name-of-mode)))
|
|
|
|
|
(condition-case ()
|
|
|
|
|
(progn
|
|
|
|
|
(interrupt-process comp-proc)
|
|
|
|
|
(sit-for 1)
|
|
|
|
|
(delete-process comp-proc))
|
|
|
|
|
(error nil))
|
|
|
|
|
(error "Cannot have two processes in `%s' at once"
|
|
|
|
|
(buffer-name)))))
|
2004-10-20 22:31:56 +00:00
|
|
|
|
;; first transfer directory from where M-x compile was called
|
|
|
|
|
(setq default-directory thisdir)
|
2004-10-16 15:12:25 +00:00
|
|
|
|
;; Make compilation buffer read-only. The filter can still write it.
|
|
|
|
|
;; Clear out the compilation buffer.
|
2004-10-20 22:31:56 +00:00
|
|
|
|
(let ((inhibit-read-only t)
|
|
|
|
|
(default-directory thisdir))
|
2007-07-10 16:01:25 +00:00
|
|
|
|
;; Then evaluate a cd command if any, but don't perform it yet, else
|
|
|
|
|
;; start-command would do it again through the shell: (cd "..") AND
|
|
|
|
|
;; sh -c "cd ..; make"
|
2012-10-23 15:07:44 -04:00
|
|
|
|
(cd (cond
|
|
|
|
|
((not (string-match "\\`\\s *cd\\(?:\\s +\\(\\S +?\\|'[^']*'\\|\"\\(?:[^\"`$\\]\\|\\\\.\\)*\"\\)\\)?\\s *[;&\n]"
|
|
|
|
|
command))
|
|
|
|
|
default-directory)
|
|
|
|
|
((not (match-end 1)) "~")
|
|
|
|
|
((eq (aref command (match-beginning 1)) ?\')
|
|
|
|
|
(substring command (1+ (match-beginning 1))
|
|
|
|
|
(1- (match-end 1))))
|
|
|
|
|
((eq (aref command (match-beginning 1)) ?\")
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
"\\\\\\(.\\)" "\\1"
|
|
|
|
|
(substring command (1+ (match-beginning 1))
|
|
|
|
|
(1- (match-end 1)))))
|
2013-10-02 19:33:48 -04:00
|
|
|
|
;; Try globbing as well (bug#15417).
|
|
|
|
|
(t (let* ((substituted-dir
|
|
|
|
|
(substitute-env-vars (match-string 1 command)))
|
|
|
|
|
;; FIXME: This also tries to expand `*' that were
|
|
|
|
|
;; introduced by the envvar expansion!
|
|
|
|
|
(expanded-dir
|
|
|
|
|
(file-expand-wildcards substituted-dir)))
|
|
|
|
|
(if (= (length expanded-dir) 1)
|
|
|
|
|
(car expanded-dir)
|
|
|
|
|
substituted-dir)))))
|
2005-06-06 12:27:44 +00:00
|
|
|
|
(erase-buffer)
|
2005-05-29 08:32:57 +00:00
|
|
|
|
;; Select the desired mode.
|
|
|
|
|
(if (not (eq mode t))
|
2008-06-13 16:22:16 +00:00
|
|
|
|
(progn
|
|
|
|
|
(buffer-disable-undo)
|
|
|
|
|
(funcall mode))
|
2005-05-29 08:32:57 +00:00
|
|
|
|
(setq buffer-read-only nil)
|
|
|
|
|
(with-no-warnings (comint-mode))
|
|
|
|
|
(compilation-shell-minor-mode))
|
2008-05-02 18:37:07 +00:00
|
|
|
|
;; Remember the original dir, so we can use it when we recompile.
|
|
|
|
|
;; default-directory' can't be used reliably for that because it may be
|
|
|
|
|
;; affected by the special handling of "cd ...;".
|
2011-09-07 15:17:54 +03:00
|
|
|
|
;; NB: must be done after (funcall mode) as that resets local variables
|
2008-05-02 18:37:07 +00:00
|
|
|
|
(set (make-local-variable 'compilation-directory) thisdir)
|
2011-09-07 15:17:54 +03:00
|
|
|
|
(set (make-local-variable 'compilation-environment) thisenv)
|
2005-05-29 08:32:57 +00:00
|
|
|
|
(if highlight-regexp
|
|
|
|
|
(set (make-local-variable 'compilation-highlight-regexp)
|
|
|
|
|
highlight-regexp))
|
2008-02-12 23:41:59 +00:00
|
|
|
|
(if (or compilation-auto-jump-to-first-error
|
|
|
|
|
(eq compilation-scroll-output 'first-error))
|
2007-07-10 16:01:25 +00:00
|
|
|
|
(set (make-local-variable 'compilation-auto-jump-to-next) t))
|
2005-05-29 08:32:57 +00:00
|
|
|
|
;; Output a mode setter, for saving and later reloading this buffer.
|
2004-10-16 15:12:25 +00:00
|
|
|
|
(insert "-*- mode: " name-of-mode
|
2010-04-23 11:59:32 -04:00
|
|
|
|
"; default-directory: "
|
|
|
|
|
(prin1-to-string (abbreviate-file-name default-directory))
|
2005-08-12 10:18:02 +00:00
|
|
|
|
" -*-\n"
|
2005-08-14 06:51:49 +00:00
|
|
|
|
(format "%s started at %s\n\n"
|
|
|
|
|
mode-name
|
|
|
|
|
(substring (current-time-string) 0 19))
|
2013-12-06 16:34:06 +01:00
|
|
|
|
command "\n")
|
2005-06-06 12:27:44 +00:00
|
|
|
|
(setq thisdir default-directory))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(set-buffer-modified-p nil))
|
|
|
|
|
;; Pop up the compilation buffer.
|
2007-12-19 02:54:53 +00:00
|
|
|
|
;; http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01638.html
|
2013-12-03 03:19:24 +02:00
|
|
|
|
(setq outwin (display-buffer outbuf '(nil (allow-no-window . t))))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(with-current-buffer outbuf
|
2004-10-16 18:38:36 +00:00
|
|
|
|
(let ((process-environment
|
|
|
|
|
(append
|
|
|
|
|
compilation-environment
|
2012-09-18 00:18:36 -04:00
|
|
|
|
(if (if (boundp 'system-uses-terminfo);`If' for compiler warning.
|
2004-10-16 18:38:36 +00:00
|
|
|
|
system-uses-terminfo)
|
|
|
|
|
(list "TERM=dumb" "TERMCAP="
|
|
|
|
|
(format "COLUMNS=%d" (window-width)))
|
|
|
|
|
(list "TERM=emacs"
|
|
|
|
|
(format "TERMCAP=emacs:co#%d:tc=unknown:"
|
|
|
|
|
(window-width))))
|
|
|
|
|
;; Set the EMACS variable, but
|
|
|
|
|
;; don't override users' setting of $EMACS.
|
2006-09-12 16:43:25 +00:00
|
|
|
|
(unless (getenv "EMACS")
|
2006-11-18 21:01:11 +00:00
|
|
|
|
(list "EMACS=t"))
|
|
|
|
|
(list "INSIDE_EMACS=t")
|
2007-07-24 20:49:18 +00:00
|
|
|
|
(copy-sequence process-environment))))
|
2004-10-16 18:38:36 +00:00
|
|
|
|
(set (make-local-variable 'compilation-arguments)
|
|
|
|
|
(list command mode name-function highlight-regexp))
|
|
|
|
|
(set (make-local-variable 'revert-buffer-function)
|
|
|
|
|
'compilation-revert-buffer)
|
2014-10-29 17:17:18 +02:00
|
|
|
|
(and outwin
|
|
|
|
|
;; Forcing the window-start overrides the usual redisplay
|
|
|
|
|
;; feature of bringing point into view, so setting the
|
|
|
|
|
;; window-start to top of the buffer risks losing the
|
|
|
|
|
;; effect of moving point to EOB below, per
|
|
|
|
|
;; compilation-scroll-output, if the command is long
|
|
|
|
|
;; enough to push point outside of the window. This
|
|
|
|
|
;; could happen, e.g., in `rgrep'.
|
|
|
|
|
(not compilation-scroll-output)
|
|
|
|
|
(set-window-start outwin (point-min)))
|
2007-12-27 03:31:20 +00:00
|
|
|
|
|
|
|
|
|
;; Position point as the user will see it.
|
|
|
|
|
(let ((desired-visible-point
|
|
|
|
|
;; Put it at the end if `compilation-scroll-output' is set.
|
|
|
|
|
(if compilation-scroll-output
|
|
|
|
|
(point-max)
|
|
|
|
|
;; Normally put it at the top.
|
|
|
|
|
(point-min))))
|
2013-11-19 10:34:04 +08:00
|
|
|
|
(goto-char desired-visible-point)
|
|
|
|
|
(when (and outwin (not (eq outwin (selected-window))))
|
2007-12-27 03:31:20 +00:00
|
|
|
|
(set-window-point outwin desired-visible-point)))
|
|
|
|
|
|
2004-10-16 18:38:36 +00:00
|
|
|
|
;; The setup function is called before compilation-set-window-height
|
|
|
|
|
;; so it can set the compilation-window-height buffer locally.
|
|
|
|
|
(if compilation-process-setup-function
|
|
|
|
|
(funcall compilation-process-setup-function))
|
2013-11-19 10:34:04 +08:00
|
|
|
|
(and outwin (compilation-set-window-height outwin))
|
2004-10-16 18:38:36 +00:00
|
|
|
|
;; Start the compilation.
|
2008-10-09 13:46:25 +00:00
|
|
|
|
(if (fboundp 'start-process)
|
|
|
|
|
(let ((proc
|
|
|
|
|
(if (eq mode t)
|
|
|
|
|
;; comint uses `start-file-process'.
|
|
|
|
|
(get-buffer-process
|
|
|
|
|
(with-no-warnings
|
|
|
|
|
(comint-exec
|
|
|
|
|
outbuf (downcase mode-name)
|
|
|
|
|
(if (file-remote-p default-directory)
|
|
|
|
|
"/bin/sh"
|
|
|
|
|
shell-file-name)
|
|
|
|
|
nil `("-c" ,command))))
|
|
|
|
|
(start-file-process-shell-command (downcase mode-name)
|
|
|
|
|
outbuf command))))
|
2012-09-18 00:18:36 -04:00
|
|
|
|
;; Make the buffer's mode line show process state.
|
|
|
|
|
(setq mode-line-process
|
|
|
|
|
'(:propertize ":%s" face compilation-mode-line-run))
|
|
|
|
|
|
|
|
|
|
;; Set the process as killable without query by default.
|
|
|
|
|
;; This allows us to start a new compilation without
|
|
|
|
|
;; getting prompted.
|
|
|
|
|
(when compilation-always-kill
|
|
|
|
|
(set-process-query-on-exit-flag proc nil))
|
|
|
|
|
|
|
|
|
|
(set-process-sentinel proc 'compilation-sentinel)
|
|
|
|
|
(unless (eq mode t)
|
|
|
|
|
;; Keep the comint filter, since it's needed for proper
|
|
|
|
|
;; handling of the prompts.
|
2008-10-09 13:46:25 +00:00
|
|
|
|
(set-process-filter proc 'compilation-filter))
|
|
|
|
|
;; Use (point-max) here so that output comes in
|
|
|
|
|
;; after the initial text,
|
|
|
|
|
;; regardless of where the user sees point.
|
|
|
|
|
(set-marker (process-mark proc) (point-max) outbuf)
|
|
|
|
|
(when compilation-disable-input
|
|
|
|
|
(condition-case nil
|
|
|
|
|
(process-send-eof proc)
|
|
|
|
|
;; The process may have exited already.
|
|
|
|
|
(error nil)))
|
2008-11-18 14:14:37 +00:00
|
|
|
|
(run-hook-with-args 'compilation-start-hook proc)
|
|
|
|
|
(setq compilation-in-progress
|
2008-10-09 13:46:25 +00:00
|
|
|
|
(cons proc compilation-in-progress)))
|
|
|
|
|
;; No asynchronous processes available.
|
|
|
|
|
(message "Executing `%s'..." command)
|
2012-06-02 18:56:09 +08:00
|
|
|
|
;; Fake mode line display as if `start-process' were run.
|
2008-04-18 10:33:17 +00:00
|
|
|
|
(setq mode-line-process
|
2012-06-03 22:37:13 +08:00
|
|
|
|
'(:propertize ":run" face compilation-mode-line-run))
|
2008-10-09 13:46:25 +00:00
|
|
|
|
(force-mode-line-update)
|
|
|
|
|
(sit-for 0) ; Force redisplay
|
|
|
|
|
(save-excursion
|
|
|
|
|
;; Insert the output at the end, after the initial text,
|
|
|
|
|
;; regardless of where the user sees point.
|
|
|
|
|
(goto-char (point-max))
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(let* ((inhibit-read-only t) ; call-process needs to modify outbuf
|
2011-05-09 15:42:45 -04:00
|
|
|
|
(compilation-filter-start (point))
|
2008-10-09 13:46:25 +00:00
|
|
|
|
(status (call-process shell-file-name nil outbuf nil "-c"
|
|
|
|
|
command)))
|
2011-05-09 15:42:45 -04:00
|
|
|
|
(run-hooks 'compilation-filter-hook)
|
2008-10-09 13:46:25 +00:00
|
|
|
|
(cond ((numberp status)
|
|
|
|
|
(compilation-handle-exit
|
|
|
|
|
'exit status
|
|
|
|
|
(if (zerop status)
|
|
|
|
|
"finished\n"
|
|
|
|
|
(format "exited abnormally with code %d\n" status))))
|
|
|
|
|
((stringp status)
|
|
|
|
|
(compilation-handle-exit 'signal status
|
|
|
|
|
(concat status "\n")))
|
|
|
|
|
(t
|
|
|
|
|
(compilation-handle-exit 'bizarre status status)))))
|
|
|
|
|
(set-buffer-modified-p nil)
|
|
|
|
|
(message "Executing `%s'...done" command)))
|
2004-10-20 22:31:56 +00:00
|
|
|
|
;; Now finally cd to where the shell started make/grep/...
|
2008-10-04 10:09:46 +00:00
|
|
|
|
(setq default-directory thisdir)
|
|
|
|
|
;; The following form selected outwin ever since revision 1.183,
|
|
|
|
|
;; so possibly messing up point in some other window (bug#1073).
|
|
|
|
|
;; Moved into the scope of with-current-buffer, though still with
|
|
|
|
|
;; complete disregard for the case when compilation-scroll-output
|
|
|
|
|
;; equals 'first-error (martin 2008-10-04).
|
|
|
|
|
(when compilation-scroll-output
|
|
|
|
|
(goto-char (point-max))))
|
|
|
|
|
|
2004-03-19 00:21:43 +00:00
|
|
|
|
;; Make it so the next C-x ` will use this buffer.
|
2004-04-21 21:37:18 +00:00
|
|
|
|
(setq next-error-last-buffer outbuf)))
|
1990-07-13 03:12:54 +00:00
|
|
|
|
|
1994-08-08 09:02:40 +00:00
|
|
|
|
(defun compilation-set-window-height (window)
|
1999-10-27 22:38:17 +00:00
|
|
|
|
"Set the height of WINDOW according to `compilation-window-height'."
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
(let ((height (buffer-local-value 'compilation-window-height (window-buffer window))))
|
|
|
|
|
(and height
|
2007-08-08 05:57:54 +00:00
|
|
|
|
(window-full-width-p window)
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
;; If window is alone in its frame, aside from a minibuffer,
|
|
|
|
|
;; don't change its height.
|
|
|
|
|
(not (eq window (frame-root-window (window-frame window))))
|
2004-06-08 21:36:37 +00:00
|
|
|
|
;; Stef said that doing the saves in this order is safer:
|
|
|
|
|
(save-excursion
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
(save-selected-window
|
2004-06-08 21:36:37 +00:00
|
|
|
|
(select-window window)
|
|
|
|
|
(enlarge-window (- height (window-height))))))))
|
1994-08-08 09:02:40 +00:00
|
|
|
|
|
2002-11-07 19:16:15 +00:00
|
|
|
|
(defvar compilation-menu-map
|
2008-03-02 01:10:30 +00:00
|
|
|
|
(let ((map (make-sparse-keymap "Errors"))
|
|
|
|
|
(opt-map (make-sparse-keymap "Skip")))
|
2002-11-07 19:16:15 +00:00
|
|
|
|
(define-key map [stop-subjob]
|
2008-03-05 04:09:24 +00:00
|
|
|
|
'(menu-item "Stop Compilation" kill-compilation
|
|
|
|
|
:help "Kill the process made by the M-x compile or M-x grep commands"))
|
2008-03-02 01:10:30 +00:00
|
|
|
|
(define-key map [compilation-mode-separator3]
|
|
|
|
|
'("----" . nil))
|
|
|
|
|
(define-key map [compilation-next-error-follow-minor-mode]
|
|
|
|
|
'(menu-item
|
|
|
|
|
"Auto Error Display" next-error-follow-minor-mode
|
|
|
|
|
:help "Display the error under cursor when moving the cursor"
|
|
|
|
|
:button (:toggle . next-error-follow-minor-mode)))
|
|
|
|
|
(define-key map [compilation-skip]
|
|
|
|
|
(cons "Skip Less Important Messages" opt-map))
|
|
|
|
|
(define-key opt-map [compilation-skip-none]
|
|
|
|
|
'(menu-item "Don't Skip Any Messages"
|
|
|
|
|
(lambda ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(customize-set-variable 'compilation-skip-threshold 0))
|
|
|
|
|
:help "Do not skip any type of messages"
|
|
|
|
|
:button (:radio . (eq compilation-skip-threshold 0))))
|
|
|
|
|
(define-key opt-map [compilation-skip-info]
|
|
|
|
|
'(menu-item "Skip Info"
|
|
|
|
|
(lambda ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(customize-set-variable 'compilation-skip-threshold 1))
|
|
|
|
|
:help "Skip anything less than warning"
|
|
|
|
|
:button (:radio . (eq compilation-skip-threshold 1))))
|
|
|
|
|
(define-key opt-map [compilation-skip-warning-and-info]
|
|
|
|
|
'(menu-item "Skip Warnings and Info"
|
|
|
|
|
(lambda ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(customize-set-variable 'compilation-skip-threshold 2))
|
|
|
|
|
:help "Skip over Warnings and Info, stop for errors"
|
|
|
|
|
:button (:radio . (eq compilation-skip-threshold 2))))
|
2002-11-07 19:16:15 +00:00
|
|
|
|
(define-key map [compilation-mode-separator2]
|
|
|
|
|
'("----" . nil))
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
(define-key map [compilation-first-error]
|
2008-03-05 04:09:24 +00:00
|
|
|
|
'(menu-item "First Error" first-error
|
|
|
|
|
:help "Restart at the first error, visit corresponding source code"))
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
(define-key map [compilation-previous-error]
|
2008-03-05 04:09:24 +00:00
|
|
|
|
'(menu-item "Previous Error" previous-error
|
|
|
|
|
:help "Visit previous `next-error' message and corresponding source code"))
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
(define-key map [compilation-next-error]
|
2008-03-05 04:09:24 +00:00
|
|
|
|
'(menu-item "Next Error" next-error
|
|
|
|
|
:help "Visit next `next-error' message and corresponding source code"))
|
2002-11-07 19:16:15 +00:00
|
|
|
|
map))
|
|
|
|
|
|
1993-04-28 22:44:29 +00:00
|
|
|
|
(defvar compilation-minor-mode-map
|
1990-07-13 03:12:54 +00:00
|
|
|
|
(let ((map (make-sparse-keymap)))
|
2011-02-01 16:22:21 -05:00
|
|
|
|
(set-keymap-parent map special-mode-map)
|
2004-04-13 23:16:29 +00:00
|
|
|
|
(define-key map [mouse-2] 'compile-goto-error)
|
2004-12-17 15:18:39 +00:00
|
|
|
|
(define-key map [follow-link] 'mouse-face)
|
1990-07-13 03:12:54 +00:00
|
|
|
|
(define-key map "\C-c\C-c" 'compile-goto-error)
|
1994-12-27 03:47:06 +00:00
|
|
|
|
(define-key map "\C-m" 'compile-goto-error)
|
2013-03-19 08:16:14 +08:00
|
|
|
|
(define-key map "\C-o" 'compilation-display-error)
|
1991-10-07 22:49:33 +00:00
|
|
|
|
(define-key map "\C-c\C-k" 'kill-compilation)
|
1992-07-29 05:06:36 +00:00
|
|
|
|
(define-key map "\M-n" 'compilation-next-error)
|
|
|
|
|
(define-key map "\M-p" 'compilation-previous-error)
|
1992-08-06 23:56:50 +00:00
|
|
|
|
(define-key map "\M-{" 'compilation-previous-file)
|
|
|
|
|
(define-key map "\M-}" 'compilation-next-file)
|
2008-05-08 17:28:05 +00:00
|
|
|
|
(define-key map "g" 'recompile) ; revert
|
2002-11-07 19:16:15 +00:00
|
|
|
|
;; Set up the menu-bar
|
|
|
|
|
(define-key map [menu-bar compilation]
|
|
|
|
|
(cons "Errors" compilation-menu-map))
|
1990-07-13 03:12:54 +00:00
|
|
|
|
map)
|
1993-05-13 03:14:07 +00:00
|
|
|
|
"Keymap for `compilation-minor-mode'.")
|
1993-04-28 22:44:29 +00:00
|
|
|
|
|
1997-05-03 04:37:52 +00:00
|
|
|
|
(defvar compilation-shell-minor-mode-map
|
|
|
|
|
(let ((map (make-sparse-keymap)))
|
|
|
|
|
(define-key map "\M-\C-m" 'compile-goto-error)
|
|
|
|
|
(define-key map "\M-\C-n" 'compilation-next-error)
|
|
|
|
|
(define-key map "\M-\C-p" 'compilation-previous-error)
|
|
|
|
|
(define-key map "\M-{" 'compilation-previous-file)
|
|
|
|
|
(define-key map "\M-}" 'compilation-next-file)
|
|
|
|
|
;; Set up the menu-bar
|
2002-11-07 19:16:15 +00:00
|
|
|
|
(define-key map [menu-bar compilation]
|
|
|
|
|
(cons "Errors" compilation-menu-map))
|
1997-05-03 04:37:52 +00:00
|
|
|
|
map)
|
|
|
|
|
"Keymap for `compilation-shell-minor-mode'.")
|
|
|
|
|
|
2004-04-14 18:12:05 +00:00
|
|
|
|
(defvar compilation-button-map
|
|
|
|
|
(let ((map (make-sparse-keymap)))
|
|
|
|
|
(define-key map [mouse-2] 'compile-goto-error)
|
2004-12-17 15:18:39 +00:00
|
|
|
|
(define-key map [follow-link] 'mouse-face)
|
2004-04-14 18:12:05 +00:00
|
|
|
|
(define-key map "\C-m" 'compile-goto-error)
|
|
|
|
|
map)
|
|
|
|
|
"Keymap for compilation-message buttons.")
|
|
|
|
|
(fset 'compilation-button-map compilation-button-map)
|
|
|
|
|
|
1993-04-28 22:44:29 +00:00
|
|
|
|
(defvar compilation-mode-map
|
2002-11-07 19:16:15 +00:00
|
|
|
|
(let ((map (make-sparse-keymap)))
|
2004-11-25 03:22:56 +00:00
|
|
|
|
;; Don't inherit from compilation-minor-mode-map,
|
|
|
|
|
;; because that introduces a menu bar item we don't want.
|
|
|
|
|
;; That confuses C-down-mouse-3.
|
2011-02-01 16:22:21 -05:00
|
|
|
|
(set-keymap-parent map special-mode-map)
|
2004-11-25 03:01:10 +00:00
|
|
|
|
(define-key map [mouse-2] 'compile-goto-error)
|
2004-12-17 15:18:39 +00:00
|
|
|
|
(define-key map [follow-link] 'mouse-face)
|
2004-11-25 03:01:10 +00:00
|
|
|
|
(define-key map "\C-c\C-c" 'compile-goto-error)
|
|
|
|
|
(define-key map "\C-m" 'compile-goto-error)
|
2013-03-19 08:16:14 +08:00
|
|
|
|
(define-key map "\C-o" 'compilation-display-error)
|
2004-11-25 03:01:10 +00:00
|
|
|
|
(define-key map "\C-c\C-k" 'kill-compilation)
|
|
|
|
|
(define-key map "\M-n" 'compilation-next-error)
|
|
|
|
|
(define-key map "\M-p" 'compilation-previous-error)
|
|
|
|
|
(define-key map "\M-{" 'compilation-previous-file)
|
|
|
|
|
(define-key map "\M-}" 'compilation-next-file)
|
2005-08-04 01:36:10 +00:00
|
|
|
|
(define-key map "\t" 'compilation-next-error)
|
|
|
|
|
(define-key map [backtab] 'compilation-previous-error)
|
2008-05-08 17:28:05 +00:00
|
|
|
|
(define-key map "g" 'recompile) ; revert
|
2004-11-25 03:01:10 +00:00
|
|
|
|
|
2004-09-08 20:21:15 +00:00
|
|
|
|
(define-key map "\C-c\C-f" 'next-error-follow-minor-mode)
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
|
1994-08-02 21:01:04 +00:00
|
|
|
|
;; Set up the menu-bar
|
2004-11-25 03:01:10 +00:00
|
|
|
|
(let ((submap (make-sparse-keymap "Compile")))
|
|
|
|
|
(define-key map [menu-bar compilation]
|
|
|
|
|
(cons "Compile" submap))
|
|
|
|
|
(set-keymap-parent submap compilation-menu-map))
|
2002-11-07 19:16:15 +00:00
|
|
|
|
(define-key map [menu-bar compilation compilation-separator2]
|
1994-08-02 21:01:04 +00:00
|
|
|
|
'("----" . nil))
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
(define-key map [menu-bar compilation compilation-grep]
|
2008-03-05 04:09:24 +00:00
|
|
|
|
'(menu-item "Search Files (grep)..." grep
|
|
|
|
|
:help "Run grep, with user-specified args, and collect output in a buffer"))
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
(define-key map [menu-bar compilation compilation-recompile]
|
2008-03-05 04:09:24 +00:00
|
|
|
|
'(menu-item "Recompile" recompile
|
|
|
|
|
:help "Re-compile the program including the current buffer"))
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
(define-key map [menu-bar compilation compilation-compile]
|
2008-03-05 04:09:24 +00:00
|
|
|
|
'(menu-item "Compile..." compile
|
|
|
|
|
:help "Compile the program including the current buffer. Default: run `make'"))
|
1993-04-28 22:44:29 +00:00
|
|
|
|
map)
|
|
|
|
|
"Keymap for compilation log buffers.
|
2002-11-07 19:16:15 +00:00
|
|
|
|
`compilation-minor-mode-map' is a parent of this.")
|
1990-07-13 03:12:54 +00:00
|
|
|
|
|
2008-02-25 10:52:09 +00:00
|
|
|
|
(defvar compilation-mode-tool-bar-map
|
2008-10-12 13:46:28 +00:00
|
|
|
|
;; When bootstrapping, tool-bar-map is not properly initialized yet,
|
|
|
|
|
;; so don't do anything.
|
2011-01-08 23:13:47 -05:00
|
|
|
|
(when (keymapp tool-bar-map)
|
|
|
|
|
(let ((map (copy-keymap tool-bar-map)))
|
|
|
|
|
(define-key map [undo] nil)
|
|
|
|
|
(define-key map [separator-2] nil)
|
|
|
|
|
(define-key-after map [separator-compile] menu-bar-separator)
|
2008-10-12 13:46:28 +00:00
|
|
|
|
(tool-bar-local-item
|
|
|
|
|
"left-arrow" 'previous-error-no-select 'previous-error-no-select map
|
|
|
|
|
:rtl "right-arrow"
|
|
|
|
|
:help "Goto previous error")
|
|
|
|
|
(tool-bar-local-item
|
|
|
|
|
"right-arrow" 'next-error-no-select 'next-error-no-select map
|
|
|
|
|
:rtl "left-arrow"
|
|
|
|
|
:help "Goto next error")
|
|
|
|
|
(tool-bar-local-item
|
|
|
|
|
"cancel" 'kill-compilation 'kill-compilation map
|
|
|
|
|
:enable '(let ((buffer (compilation-find-buffer)))
|
|
|
|
|
(get-buffer-process buffer))
|
|
|
|
|
:help "Stop compilation")
|
|
|
|
|
(tool-bar-local-item
|
|
|
|
|
"refresh" 'recompile 'recompile map
|
|
|
|
|
:help "Restart compilation")
|
2011-01-08 23:13:47 -05:00
|
|
|
|
map)))
|
2008-02-25 10:52:09 +00:00
|
|
|
|
|
1997-05-05 01:08:45 +00:00
|
|
|
|
(put 'compilation-mode 'mode-class 'special)
|
|
|
|
|
|
1995-12-20 19:41:30 +00:00
|
|
|
|
;;;###autoload
|
2004-10-16 15:12:25 +00:00
|
|
|
|
(defun compilation-mode (&optional name-of-mode)
|
1990-07-13 03:12:54 +00:00
|
|
|
|
"Major mode for compilation log buffers.
|
|
|
|
|
\\<compilation-mode-map>To visit the source for a line-numbered error,
|
1991-10-07 22:49:33 +00:00
|
|
|
|
move point to the error message line and type \\[compile-goto-error].
|
1992-03-06 00:28:08 +00:00
|
|
|
|
To kill the compilation, type \\[kill-compilation].
|
|
|
|
|
|
2005-07-09 20:45:26 +00:00
|
|
|
|
Runs `compilation-mode-hook' with `run-mode-hooks' (which see).
|
2004-08-16 22:44:56 +00:00
|
|
|
|
|
|
|
|
|
\\{compilation-mode-map}"
|
1990-07-13 03:12:54 +00:00
|
|
|
|
(interactive)
|
1994-10-07 09:52:36 +00:00
|
|
|
|
(kill-all-local-variables)
|
1990-07-13 03:12:54 +00:00
|
|
|
|
(use-local-map compilation-mode-map)
|
2008-06-10 16:08:48 +00:00
|
|
|
|
;; Let windows scroll along with the output.
|
|
|
|
|
(set (make-local-variable 'window-point-insertion-type) t)
|
2008-02-25 10:52:09 +00:00
|
|
|
|
(set (make-local-variable 'tool-bar-map) compilation-mode-tool-bar-map)
|
Derive from prog-mode, use derived-mode-p, and fix up various
minor style issues in lisp/progmodes.
* lisp/progmodes/vhdl-mode.el (vhdl-write-file-hooks-init)
(vhdl-hs-minor-mode, vhdl-ps-print-init): Fix make-local-variable ->
make-local-hook.
* lisp/progmodes/sh-script.el (sh-require-final-newline): Remove.
(sh-set-shell): Don't set require-final-newline since it's already done
by prog-mode.
* lisp/progmodes/modula2.el (m2-mode): Don't make m2-end-comment-column
since we never set it.
* lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation):
Use read-string and standard prompt.
* lisp/progmodes/dcl-mode.el (dcl-mode-map): Move init into declaration.
* lisp/progmodes/meta-mode.el (meta-mode-abbrev-table): Merge init and decl.
(meta-common-mode-syntax-table): Rename from meta-mode-syntax-table.
(meta-common-mode-map): Rename from meta-mode-map.
Remove C-m binding, which is a user preference, not mode specific.
(meta-common-mode): New major mode; replace meta-common-initialization.
* lisp/progmodes/js.el (js-mode): Call syntax-propertize rather than messing
around with font-lock.
* lisp/progmodes/etags.el (select-tags-table-mode):
Derive from special-mode.
* lisp/progmodes/octave-mod.el (octave-mode):
* lisp/progmodes/gdb-mi.el (gdb-inferior-io-mode, gdb-threads-mode)
(gdb-memory-mode, gdb-disassembly-mode, gdb-breakpoints-mode)
(gdb-frames-mode, gdb-locals-mode, gdb-registers-mode):
Let define-derived-mode do its job.
* lisp/progmodes/cpp.el (cpp-edit-mode-map):
Move initialization into declaration.
(cpp-edit-mode): Use define-derived-mode.
(cpp-edit-load): Use derived-mode-p.
* lisp/progmodes/mixal-mode.el (mixal-mode):
* lisp/progmodes/f90.el (f90-mode):
* lisp/progmodes/cfengine.el (cfengine-mode): Don't bother setting
require-final-newline since prog-mode does it already.
* lisp/progmodes/cc-cmds.el (c-update-modeline): Use match-string.
* lisp/progmodes/asm-mode.el (asm-mode-map): Fix menu setup.
* lisp/progmodes/antlr-mode.el: Require cc-mode upfront.
(antlr-mode-syntax-table, antlr-action-syntax-table): Initialize in
the declaration.
(antlr-directory-dependencies, antlr-show-makefile-rules):
Use derived-mode-p.
(antlr-language-option): Don't assume point-min==1.
(antlr-mode): Use define-derived-mode.
* lisp/progmodes/ada-mode.el: Use derived-mode-p.
(ada-mode): Use define-derived-mode.
Use hack-local-variables-hook.
* lisp/progmodes/vhdl-mode.el (vhdl-mode):
* lisp/progmodes/verilog-mode.el (verilog-mode):
* lisp/progmodes/vera-mode.el (vera-mode):
* lisp/progmodes/sql.el (sql-mode):
* lisp/progmodes/scheme.el (scheme-mode):
* lisp/progmodes/perl-mode.el (perl-mode):
* lisp/progmodes/octave-inf.el (inferior-octave-mode):
* lisp/progmodes/autoconf.el (autoconf-mode):
* lisp/progmodes/m4-mode.el (m4-mode):
* lisp/progmodes/inf-lisp.el (inferior-lisp-mode):
* lisp/progmodes/idlwave.el (idlwave-mode):
* lisp/progmodes/icon.el (icon-mode):
* lisp/progmodes/idlw-help.el (idlwave-help-mode):
* lisp/progmodes/dcl-mode.el (dcl-mode):
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode):
* lisp/progmodes/ebrowse.el (ebrowse-tree-mode, ebrowse-electric-list-mode)
(ebrowse-member-mode, ebrowse-electric-position-mode):
Use define-derived-mode.
* lisp/progmodes/xscheme.el (xscheme-start)
(local-set-scheme-interaction-buffer, scheme-interaction-mode):
* lisp/progmodes/which-func.el (which-function):
* lisp/progmodes/vhdl-mode.el (vhdl-set-style):
* lisp/progmodes/verilog-mode.el (verilog-set-compile-command)
(verilog-modify-compile-command, verilog-error-regexp-add-xemacs)
(verilog-set-define, verilog-auto-reeval-locals):
* lisp/progmodes/sql.el (sql-product-font-lock, sql-interactive-mode):
* lisp/progmodes/simula.el (simula-mode):
* lisp/progmodes/scheme.el (scheme-mode-variables, dsssl-mode):
* lisp/progmodes/python.el (python-check, python-mode):
* lisp/progmodes/prolog.el (prolog-mode-variables):
* lisp/progmodes/gud.el (gud-tooltip-activate-mouse-motions):
* lisp/progmodes/ebrowse.el (ebrowse-view-file-other-frame):
* lisp/progmodes/delphi.el (delphi-mode):
* lisp/progmodes/cc-styles.el (c-setup-paragraph-variables):
* lisp/progmodes/cc-mode.el (c-basic-common-init, c-common-init)
(c-font-lock-init): Move make-local-variable to their setq.
* lisp/progmodes/xscheme.el (exit-scheme-interaction-mode)
(xscheme-enter-interaction-mode, xscheme-enter-debugger-mode)
(xscheme-debugger-mode-p, xscheme-send-string-1):
* lisp/progmodes/tcl.el (inferior-tcl-proc, tcl-current-word)
(tcl-load-file, tcl-restart-with-file):
* lisp/progmodes/ps-mode.el (ps-run-running):
* lisp/progmodes/gdb-mi.el (gud-watch, gdb-mouse-set-clear-breakpoint):
* lisp/progmodes/js.el (js--get-all-known-symbols):
* lisp/progmodes/inf-lisp.el (inferior-lisp-proc):
* lisp/progmodes/idlwave.el (idlwave-beginning-of-statement)
(idlwave-template, idlwave-update-buffer-routine-info)
(idlwave-update-current-buffer-info)
(idlwave-get-routine-info-from-buffers, idlwave-choose)
(idlwave-scan-class-info, idlwave-fix-keywords)
(idlwave-list-buffer-load-path-shadows):
* lisp/progmodes/idlw-toolbar.el (idlwave-toolbar, idlwave-toolbar-add)
(idlwave-toolbar-remove):
* lisp/progmodes/idlw-shell.el (idlwave-shell-save-and-action)
(idlwave-shell-file-name, idlwave-shell-electric-debug-all-off)
(idlwave-shell-menu-def):
* lisp/progmodes/idlw-complete-structtag.el
(idlwave-prepare-structure-tag-completion):
* lisp/progmodes/gud.el (gud-set-buffer):
* lisp/progmodes/f90.el (f90-backslash-not-special):
* lisp/progmodes/delphi.el (delphi-find-unit): Use derived-mode-p.
2010-12-10 15:00:25 -05:00
|
|
|
|
(setq major-mode 'compilation-mode ; FIXME: Use define-derived-mode.
|
2004-10-16 15:12:25 +00:00
|
|
|
|
mode-name (or name-of-mode "Compilation"))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(set (make-local-variable 'page-delimiter)
|
|
|
|
|
compilation-page-delimiter)
|
2011-01-28 16:42:34 -05:00
|
|
|
|
;; (set (make-local-variable 'compilation-buffer-modtime) nil)
|
1993-04-28 22:44:29 +00:00
|
|
|
|
(compilation-setup)
|
2004-11-16 04:52:19 +00:00
|
|
|
|
(setq buffer-read-only t)
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(run-mode-hooks 'compilation-mode-hook))
|
|
|
|
|
|
2012-05-17 21:46:20 -04:00
|
|
|
|
;;;###autoload
|
|
|
|
|
(put 'define-compilation-mode 'doc-string-elt 3)
|
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(defmacro define-compilation-mode (mode name doc &rest body)
|
|
|
|
|
"This is like `define-derived-mode' without the PARENT argument.
|
|
|
|
|
The parent is always `compilation-mode' and the customizable `compilation-...'
|
2005-08-22 19:55:57 +00:00
|
|
|
|
variables are also set from the name of the mode you have chosen,
|
2013-02-12 09:36:54 -08:00
|
|
|
|
by replacing the first word, e.g., `compilation-scroll-output' from
|
2005-08-22 19:55:57 +00:00
|
|
|
|
`grep-scroll-output' if that variable exists."
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(let ((mode-name (replace-regexp-in-string "-mode\\'" "" (symbol-name mode))))
|
|
|
|
|
`(define-derived-mode ,mode compilation-mode ,name
|
|
|
|
|
,doc
|
|
|
|
|
,@(mapcar (lambda (v)
|
|
|
|
|
(setq v (cons v
|
|
|
|
|
(intern-soft (replace-regexp-in-string
|
|
|
|
|
"^compilation" mode-name
|
|
|
|
|
(symbol-name v)))))
|
|
|
|
|
(and (cdr v)
|
|
|
|
|
(or (boundp (cdr v))
|
2011-01-28 16:11:19 -05:00
|
|
|
|
;; FIXME: This is hackish, using undocumented info.
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(if (boundp 'byte-compile-bound-variables)
|
|
|
|
|
(memq (cdr v) byte-compile-bound-variables)))
|
|
|
|
|
`(set (make-local-variable ',(car v)) ,(cdr v))))
|
|
|
|
|
'(compilation-buffer-name-function
|
|
|
|
|
compilation-directory-matcher
|
|
|
|
|
compilation-error
|
|
|
|
|
compilation-error-regexp-alist
|
|
|
|
|
compilation-error-regexp-alist-alist
|
|
|
|
|
compilation-error-screen-columns
|
|
|
|
|
compilation-finish-function
|
|
|
|
|
compilation-finish-functions
|
|
|
|
|
compilation-first-column
|
|
|
|
|
compilation-mode-font-lock-keywords
|
|
|
|
|
compilation-page-delimiter
|
|
|
|
|
compilation-parse-errors-filename-function
|
|
|
|
|
compilation-process-setup-function
|
|
|
|
|
compilation-scroll-output
|
|
|
|
|
compilation-search-path
|
|
|
|
|
compilation-skip-threshold
|
|
|
|
|
compilation-window-height))
|
|
|
|
|
,@body)))
|
1993-04-28 22:44:29 +00:00
|
|
|
|
|
1997-05-19 01:04:04 +00:00
|
|
|
|
(defun compilation-revert-buffer (ignore-auto noconfirm)
|
2003-01-13 08:02:47 +00:00
|
|
|
|
(if buffer-file-name
|
|
|
|
|
(let (revert-buffer-function)
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
(revert-buffer ignore-auto noconfirm))
|
2003-01-13 08:02:47 +00:00
|
|
|
|
(if (or noconfirm (yes-or-no-p (format "Restart compilation? ")))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(apply 'compilation-start compilation-arguments))))
|
|
|
|
|
|
2004-04-04 12:56:01 +00:00
|
|
|
|
(defvar compilation-current-error nil
|
|
|
|
|
"Marker to the location from where the next error will be found.
|
|
|
|
|
The global commands next/previous/first-error/goto-error use this.")
|
2004-04-01 10:42:04 +00:00
|
|
|
|
|
2004-05-01 21:13:00 +00:00
|
|
|
|
(defvar compilation-messages-start nil
|
|
|
|
|
"Buffer position of the beginning of the compilation messages.
|
|
|
|
|
If nil, use the beginning of buffer.")
|
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(defun compilation-setup (&optional minor)
|
2004-04-16 23:22:07 +00:00
|
|
|
|
"Prepare the buffer for the compilation parsing commands to work.
|
|
|
|
|
Optional argument MINOR indicates this is called from
|
|
|
|
|
`compilation-minor-mode'."
|
2004-04-01 10:42:04 +00:00
|
|
|
|
(make-local-variable 'compilation-current-error)
|
2004-05-01 21:13:00 +00:00
|
|
|
|
(make-local-variable 'compilation-messages-start)
|
2000-08-08 18:30:47 +00:00
|
|
|
|
(make-local-variable 'compilation-error-screen-columns)
|
2004-04-13 22:46:18 +00:00
|
|
|
|
(make-local-variable 'overlay-arrow-position)
|
2005-05-16 00:01:46 +00:00
|
|
|
|
(set (make-local-variable 'overlay-arrow-string) "")
|
2005-04-07 15:15:38 +00:00
|
|
|
|
(setq next-error-overlay-arrow-position nil)
|
|
|
|
|
(add-hook 'kill-buffer-hook
|
|
|
|
|
(lambda () (setq next-error-overlay-arrow-position nil)) nil t)
|
2004-05-01 21:13:00 +00:00
|
|
|
|
;; Note that compilation-next-error-function is for interfacing
|
|
|
|
|
;; with the next-error function in simple.el, and it's only
|
|
|
|
|
;; coincidentally named similarly to compilation-next-error.
|
|
|
|
|
(setq next-error-function 'compilation-next-error-function)
|
2007-07-08 18:03:20 +00:00
|
|
|
|
(set (make-local-variable 'comint-file-name-prefix)
|
|
|
|
|
(or (file-remote-p default-directory) ""))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(set (make-local-variable 'compilation-locs)
|
|
|
|
|
(make-hash-table :test 'equal :weakness 'value))
|
2011-01-28 17:06:20 -05:00
|
|
|
|
;; It's generally preferable to use after-change-functions since they
|
|
|
|
|
;; can be subject to combine-after-change-calls, but if we do that, we risk
|
|
|
|
|
;; running our hook after font-lock, resulting in incorrect refontification.
|
|
|
|
|
(add-hook 'before-change-functions 'compilation--flush-parse nil t)
|
|
|
|
|
;; Also for minor mode, since it's not permanent-local.
|
|
|
|
|
(add-hook 'change-major-mode-hook #'compilation--remove-properties nil t)
|
2005-11-24 20:52:16 +00:00
|
|
|
|
(if minor
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(progn
|
2004-04-07 12:57:04 +00:00
|
|
|
|
(font-lock-add-keywords nil (compilation-mode-font-lock-keywords))
|
|
|
|
|
(if font-lock-mode
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(font-lock-fontify-buffer)))
|
|
|
|
|
(setq font-lock-defaults '(compilation-mode-font-lock-keywords t))))
|
1993-04-28 22:44:29 +00:00
|
|
|
|
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(defun compilation--unsetup ()
|
|
|
|
|
;; Only for minor mode.
|
|
|
|
|
(font-lock-remove-keywords nil (compilation-mode-font-lock-keywords))
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(remove-hook 'before-change-functions 'compilation--flush-parse t)
|
|
|
|
|
(kill-local-variable 'compilation--parsed)
|
|
|
|
|
(compilation--remove-properties)
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(if font-lock-mode
|
|
|
|
|
(font-lock-fontify-buffer)))
|
|
|
|
|
|
1999-01-11 17:37:34 +00:00
|
|
|
|
;;;###autoload
|
2002-11-07 19:16:15 +00:00
|
|
|
|
(define-minor-mode compilation-shell-minor-mode
|
2011-10-19 20:26:14 -04:00
|
|
|
|
"Toggle Compilation Shell minor mode.
|
|
|
|
|
With a prefix argument ARG, enable Compilation Shell minor mode
|
|
|
|
|
if ARG is positive, and disable it otherwise. If called from
|
|
|
|
|
Lisp, enable the mode if ARG is omitted or nil.
|
|
|
|
|
|
|
|
|
|
When Compilation Shell minor mode is enabled, all the
|
|
|
|
|
error-parsing commands of the Compilation major mode are
|
|
|
|
|
available but bound to keys that don't collide with Shell mode.
|
|
|
|
|
See `compilation-mode'."
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
nil " Shell-Compile"
|
2002-11-18 04:14:26 +00:00
|
|
|
|
:group 'compilation
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(if compilation-shell-minor-mode
|
|
|
|
|
(compilation-setup t)
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(compilation--unsetup)))
|
1999-01-11 17:37:34 +00:00
|
|
|
|
|
1993-08-03 21:38:31 +00:00
|
|
|
|
;;;###autoload
|
2002-11-07 19:16:15 +00:00
|
|
|
|
(define-minor-mode compilation-minor-mode
|
2011-10-19 20:26:14 -04:00
|
|
|
|
"Toggle Compilation minor mode.
|
|
|
|
|
With a prefix argument ARG, enable Compilation minor mode if ARG
|
|
|
|
|
is positive, and disable it otherwise. If called from Lisp,
|
|
|
|
|
enable the mode if ARG is omitted or nil.
|
|
|
|
|
|
|
|
|
|
When Compilation minor mode is enabled, all the error-parsing
|
|
|
|
|
commands of Compilation major mode are available. See
|
|
|
|
|
`compilation-mode'."
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
nil " Compilation"
|
2002-11-18 04:14:26 +00:00
|
|
|
|
:group 'compilation
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(if compilation-minor-mode
|
|
|
|
|
(compilation-setup t)
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(compilation--unsetup)))
|
1990-07-13 03:12:54 +00:00
|
|
|
|
|
1996-01-06 20:54:19 +00:00
|
|
|
|
(defun compilation-handle-exit (process-status exit-status msg)
|
2007-06-04 01:36:30 +00:00
|
|
|
|
"Write MSG in the current buffer and hack its `mode-line-process'."
|
2004-10-16 15:12:25 +00:00
|
|
|
|
(let ((inhibit-read-only t)
|
1996-01-06 20:54:19 +00:00
|
|
|
|
(status (if compilation-exit-message-function
|
|
|
|
|
(funcall compilation-exit-message-function
|
|
|
|
|
process-status exit-status msg)
|
|
|
|
|
(cons msg exit-status)))
|
|
|
|
|
(omax (point-max))
|
2007-05-23 08:12:59 +00:00
|
|
|
|
(opoint (point))
|
|
|
|
|
(cur-buffer (current-buffer)))
|
2004-04-13 22:46:18 +00:00
|
|
|
|
;; Record where we put the message, so we can ignore it later on.
|
1996-01-06 20:54:19 +00:00
|
|
|
|
(goto-char omax)
|
|
|
|
|
(insert ?\n mode-name " " (car status))
|
2002-03-28 18:28:24 +00:00
|
|
|
|
(if (and (numberp compilation-window-height)
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(zerop compilation-window-height))
|
|
|
|
|
(message "%s" (cdr status)))
|
1999-04-03 14:04:39 +00:00
|
|
|
|
(if (bolp)
|
|
|
|
|
(forward-char -1))
|
1996-01-06 20:54:19 +00:00
|
|
|
|
(insert " at " (substring (current-time-string) 0 19))
|
1999-04-03 14:04:39 +00:00
|
|
|
|
(goto-char (point-max))
|
2002-01-25 02:36:36 +00:00
|
|
|
|
;; Prevent that message from being recognized as a compilation error.
|
|
|
|
|
(add-text-properties omax (point)
|
|
|
|
|
(append '(compilation-handle-exit t) nil))
|
2008-02-24 20:44:24 +00:00
|
|
|
|
(setq mode-line-process
|
|
|
|
|
(let ((out-string (format ":%s [%s]" process-status (cdr status)))
|
2008-02-24 23:21:56 +00:00
|
|
|
|
(msg (format "%s %s" mode-name
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(replace-regexp-in-string "\n?$" ""
|
|
|
|
|
(car status)))))
|
2008-02-24 23:21:56 +00:00
|
|
|
|
(message "%s" msg)
|
|
|
|
|
(propertize out-string
|
2012-06-03 22:37:13 +08:00
|
|
|
|
'help-echo msg
|
|
|
|
|
'face (if (> exit-status 0)
|
|
|
|
|
'compilation-mode-line-fail
|
|
|
|
|
'compilation-mode-line-exit))))
|
1996-01-06 20:54:19 +00:00
|
|
|
|
;; Force mode line redisplay soon.
|
|
|
|
|
(force-mode-line-update)
|
|
|
|
|
(if (and opoint (< opoint omax))
|
|
|
|
|
(goto-char opoint))
|
2005-06-28 18:57:00 +00:00
|
|
|
|
(with-no-warnings
|
|
|
|
|
(if compilation-finish-function
|
2007-05-23 08:12:59 +00:00
|
|
|
|
(funcall compilation-finish-function cur-buffer msg)))
|
|
|
|
|
(run-hook-with-args 'compilation-finish-functions cur-buffer msg)))
|
1996-01-06 20:54:19 +00:00
|
|
|
|
|
1990-07-13 03:12:54 +00:00
|
|
|
|
;; Called when compilation process changes state.
|
|
|
|
|
(defun compilation-sentinel (proc msg)
|
1991-10-07 22:49:33 +00:00
|
|
|
|
"Sentinel for compilation buffers."
|
2004-04-13 22:46:18 +00:00
|
|
|
|
(if (memq (process-status proc) '(exit signal))
|
|
|
|
|
(let ((buffer (process-buffer proc)))
|
|
|
|
|
(if (null (buffer-name buffer))
|
|
|
|
|
;; buffer killed
|
|
|
|
|
(set-process-buffer proc nil)
|
|
|
|
|
(with-current-buffer buffer
|
|
|
|
|
;; Write something in the compilation buffer
|
|
|
|
|
;; and hack its mode line.
|
|
|
|
|
(compilation-handle-exit (process-status proc)
|
|
|
|
|
(process-exit-status proc)
|
|
|
|
|
msg)
|
|
|
|
|
;; Since the buffer and mode line will show that the
|
|
|
|
|
;; process is dead, we can delete it now. Otherwise it
|
|
|
|
|
;; will stay around until M-x list-processes.
|
|
|
|
|
(delete-process proc)))
|
|
|
|
|
(setq compilation-in-progress (delq proc compilation-in-progress)))))
|
1990-07-13 03:12:54 +00:00
|
|
|
|
|
1993-04-07 18:34:17 +00:00
|
|
|
|
(defun compilation-filter (proc string)
|
|
|
|
|
"Process filter for compilation buffers.
|
2009-02-17 16:49:40 +00:00
|
|
|
|
Just inserts the text,
|
|
|
|
|
handles carriage motion (see `comint-inhibit-carriage-motion'),
|
|
|
|
|
and runs `compilation-filter-hook'."
|
2008-06-13 16:22:16 +00:00
|
|
|
|
(when (buffer-live-p (process-buffer proc))
|
|
|
|
|
(with-current-buffer (process-buffer proc)
|
|
|
|
|
(let ((inhibit-read-only t)
|
|
|
|
|
;; `save-excursion' doesn't use the right insertion-type for us.
|
2009-05-18 16:30:59 +00:00
|
|
|
|
(pos (copy-marker (point) t))
|
2011-01-28 16:11:19 -05:00
|
|
|
|
;; `save-restriction' doesn't use the right insertion type either:
|
|
|
|
|
;; If we are inserting at the end of the accessible part of the
|
|
|
|
|
;; buffer, keep the inserted text visible.
|
2009-05-18 16:30:59 +00:00
|
|
|
|
(min (point-min-marker))
|
2011-05-08 01:17:17 -04:00
|
|
|
|
(max (copy-marker (point-max) t))
|
|
|
|
|
(compilation-filter-start (marker-position (process-mark proc))))
|
2008-06-13 16:22:16 +00:00
|
|
|
|
(unwind-protect
|
|
|
|
|
(progn
|
2009-05-18 16:30:59 +00:00
|
|
|
|
(widen)
|
2011-05-08 01:17:17 -04:00
|
|
|
|
(goto-char compilation-filter-start)
|
2008-06-13 16:22:16 +00:00
|
|
|
|
;; We used to use `insert-before-markers', so that windows with
|
|
|
|
|
;; point at `process-mark' scroll along with the output, but we
|
|
|
|
|
;; now use window-point-insertion-type instead.
|
|
|
|
|
(insert string)
|
2009-02-17 16:49:40 +00:00
|
|
|
|
(unless comint-inhibit-carriage-motion
|
|
|
|
|
(comint-carriage-motion (process-mark proc) (point)))
|
2008-06-13 16:22:16 +00:00
|
|
|
|
(set-marker (process-mark proc) (point))
|
2011-01-28 16:42:34 -05:00
|
|
|
|
;; (set (make-local-variable 'compilation-buffer-modtime)
|
|
|
|
|
;; (current-time))
|
2008-06-13 16:22:16 +00:00
|
|
|
|
(run-hooks 'compilation-filter-hook))
|
2009-05-18 16:30:59 +00:00
|
|
|
|
(goto-char pos)
|
|
|
|
|
(narrow-to-region min max)
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(set-marker pos nil)
|
2009-05-18 16:30:59 +00:00
|
|
|
|
(set-marker min nil)
|
|
|
|
|
(set-marker max nil))))))
|
1992-08-04 02:02:27 +00:00
|
|
|
|
|
2004-04-21 21:37:18 +00:00
|
|
|
|
;;; test if a buffer is a compilation buffer, assuming we're in the buffer
|
|
|
|
|
(defsubst compilation-buffer-internal-p ()
|
|
|
|
|
"Test if inside a compilation buffer."
|
|
|
|
|
(local-variable-p 'compilation-locs))
|
|
|
|
|
|
|
|
|
|
;;; test if a buffer is a compilation buffer, using compilation-buffer-internal-p
|
1994-01-06 15:25:19 +00:00
|
|
|
|
(defsubst compilation-buffer-p (buffer)
|
2004-04-21 21:37:18 +00:00
|
|
|
|
"Test if BUFFER is a compilation buffer."
|
|
|
|
|
(with-current-buffer buffer
|
|
|
|
|
(compilation-buffer-internal-p)))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2007-01-19 02:25:48 +00:00
|
|
|
|
(defmacro compilation-loop (< property-change 1+ error limit)
|
|
|
|
|
`(let (opt)
|
|
|
|
|
(while (,< n 0)
|
|
|
|
|
(setq opt pt)
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(or (setq pt (,property-change pt 'compilation-message))
|
2007-01-19 02:25:48 +00:00
|
|
|
|
;; Handle the case where where the first error message is
|
|
|
|
|
;; at the start of the buffer, and n < 0.
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(if (or (eq (get-text-property ,limit 'compilation-message)
|
|
|
|
|
(get-text-property opt 'compilation-message))
|
2007-01-19 02:25:48 +00:00
|
|
|
|
(eq pt opt))
|
Add new error and function `user-error'.
* lisp/subr.el (user-error): New function.
* lisp/window.el (switch-to-buffer):
* lisp/vc/smerge-mode.el (smerge-resolve-function, smerge-resolve)
(smerge-match-conflict):
* lisp/simple.el (previous-matching-history-element)
(next-matching-history-element, goto-history-element, undo-more)
(undo-start):
* lisp/progmodes/etags.el (visit-tags-table-buffer, find-tag-tag)
(find-tag-noselect, find-tag-in-order, etags-goto-tag-location)
(next-file, tags-loop-scan, list-tags, complete-tag):
* lisp/progmodes/compile.el (compilation-loop):
* lisp/mouse.el (mouse-minibuffer-check):
* lisp/man.el (Man-bgproc-sentinel, Man-goto-page):
* lisp/info.el (Info-find-node-2, Info-extract-pointer, Info-history-back)
(Info-history-forward, Info-follow-reference, Info-menu)
(Info-extract-menu-item, Info-extract-menu-counting)
(Info-forward-node, Info-backward-node, Info-next-menu-item)
(Info-last-menu-item, Info-next-preorder, Info-last-preorder)
(Info-next-reference, Info-prev-reference, Info-index)
(Info-index-next, Info-follow-nearest-node)
(Info-copy-current-node-name):
* lisp/imenu.el (imenu--make-index-alist)
(imenu-default-create-index-function, imenu-add-to-menubar):
* lisp/files.el (basic-save-buffer, recover-file):
* lisp/emacs-lisp/easy-mmode.el (easy-mmode-define-navigation):
* lisp/emacs-lisp/checkdoc.el (checkdoc-continue, checkdoc-comments)
(checkdoc-message-text, checkdoc-defun):
* lisp/dabbrev.el (dabbrev-completion, dabbrev--abbrev-at-point):
* lisp/cus-edit.el (customize-changed-options, customize-rogue)
(customize-saved, custom-variable-set, custom-variable-mark-to-save)
(custom-variable-mark-to-reset-standard)
(custom-variable-reset-backup, custom-face-mark-to-reset-standard)
(custom-file):
* lisp/completion.el (check-completion-length):
* lisp/comint.el (comint-search-arg)
(comint-previous-matching-input-string-position)
(comint-previous-matching-input)
(comint-replace-by-expanded-history-before-point, comint-send-input)
(comint-copy-old-input, comint-backward-matching-input)
(comint-goto-process-mark, comint-set-process-mark):
* lisp/calendar/calendar.el (calendar-cursor-to-date): Use it.
* lisp/bindings.el (debug-ignored-errors): Remove regexps, add `user-error'.
* src/data.c (PUT_ERROR): New macro.
(syms_of_data): Use it. Add new error type `user-error'.
* src/undo.c (user_error): New function.
(Fprimitive_undo): Use it.
* src/print.c (print_error_message): Adjust print style for `user-error'.
* src/keyboard.c (user_error): New function.
(Fexit_recursive_edit, Fabort_recursive_edit): Use it.
2012-05-04 19:16:47 -04:00
|
|
|
|
(user-error ,error compilation-error)
|
2007-01-19 02:25:48 +00:00
|
|
|
|
(setq pt ,limit)))
|
2011-01-28 16:11:19 -05:00
|
|
|
|
;; prop 'compilation-message usually has 2 changes, on and off, so
|
2007-01-19 02:25:48 +00:00
|
|
|
|
;; re-search if off
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(or (setq msg (get-text-property pt 'compilation-message))
|
|
|
|
|
(if (setq pt (,property-change pt 'compilation-message nil ,limit))
|
|
|
|
|
(setq msg (get-text-property pt 'compilation-message)))
|
Add new error and function `user-error'.
* lisp/subr.el (user-error): New function.
* lisp/window.el (switch-to-buffer):
* lisp/vc/smerge-mode.el (smerge-resolve-function, smerge-resolve)
(smerge-match-conflict):
* lisp/simple.el (previous-matching-history-element)
(next-matching-history-element, goto-history-element, undo-more)
(undo-start):
* lisp/progmodes/etags.el (visit-tags-table-buffer, find-tag-tag)
(find-tag-noselect, find-tag-in-order, etags-goto-tag-location)
(next-file, tags-loop-scan, list-tags, complete-tag):
* lisp/progmodes/compile.el (compilation-loop):
* lisp/mouse.el (mouse-minibuffer-check):
* lisp/man.el (Man-bgproc-sentinel, Man-goto-page):
* lisp/info.el (Info-find-node-2, Info-extract-pointer, Info-history-back)
(Info-history-forward, Info-follow-reference, Info-menu)
(Info-extract-menu-item, Info-extract-menu-counting)
(Info-forward-node, Info-backward-node, Info-next-menu-item)
(Info-last-menu-item, Info-next-preorder, Info-last-preorder)
(Info-next-reference, Info-prev-reference, Info-index)
(Info-index-next, Info-follow-nearest-node)
(Info-copy-current-node-name):
* lisp/imenu.el (imenu--make-index-alist)
(imenu-default-create-index-function, imenu-add-to-menubar):
* lisp/files.el (basic-save-buffer, recover-file):
* lisp/emacs-lisp/easy-mmode.el (easy-mmode-define-navigation):
* lisp/emacs-lisp/checkdoc.el (checkdoc-continue, checkdoc-comments)
(checkdoc-message-text, checkdoc-defun):
* lisp/dabbrev.el (dabbrev-completion, dabbrev--abbrev-at-point):
* lisp/cus-edit.el (customize-changed-options, customize-rogue)
(customize-saved, custom-variable-set, custom-variable-mark-to-save)
(custom-variable-mark-to-reset-standard)
(custom-variable-reset-backup, custom-face-mark-to-reset-standard)
(custom-file):
* lisp/completion.el (check-completion-length):
* lisp/comint.el (comint-search-arg)
(comint-previous-matching-input-string-position)
(comint-previous-matching-input)
(comint-replace-by-expanded-history-before-point, comint-send-input)
(comint-copy-old-input, comint-backward-matching-input)
(comint-goto-process-mark, comint-set-process-mark):
* lisp/calendar/calendar.el (calendar-cursor-to-date): Use it.
* lisp/bindings.el (debug-ignored-errors): Remove regexps, add `user-error'.
* src/data.c (PUT_ERROR): New macro.
(syms_of_data): Use it. Add new error type `user-error'.
* src/undo.c (user_error): New function.
(Fprimitive_undo): Use it.
* src/print.c (print_error_message): Adjust print style for `user-error'.
* src/keyboard.c (user_error): New function.
(Fexit_recursive_edit, Fabort_recursive_edit): Use it.
2012-05-04 19:16:47 -04:00
|
|
|
|
(user-error ,error compilation-error))
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(or (< (compilation--message->type msg) compilation-skip-threshold)
|
2007-01-19 02:25:48 +00:00
|
|
|
|
(if different-file
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(eq (prog1 last
|
|
|
|
|
(setq last (compilation--loc->file-struct
|
|
|
|
|
(compilation--message->loc msg))))
|
2007-01-19 02:25:48 +00:00
|
|
|
|
last))
|
|
|
|
|
(if compilation-skip-visited
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(compilation--loc->visited (compilation--message->loc msg)))
|
2007-01-19 02:25:48 +00:00
|
|
|
|
(if compilation-skip-to-next-location
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(eq (compilation--message->loc msg) loc))
|
2007-01-19 02:25:48 +00:00
|
|
|
|
;; count this message only if none of the above are true
|
|
|
|
|
(setq n (,1+ n))))))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(defun compilation-next-single-property-change (position prop
|
|
|
|
|
&optional object limit)
|
|
|
|
|
(let (parsed res)
|
|
|
|
|
(while (progn
|
|
|
|
|
;; We parse the buffer here "on-demand" by chunks of 500 chars.
|
|
|
|
|
;; But we could also just parse the whole buffer.
|
|
|
|
|
(compilation--ensure-parse
|
|
|
|
|
(setq parsed (max compilation--parsed
|
|
|
|
|
(min (+ position 500)
|
|
|
|
|
(or limit (point-max))))))
|
|
|
|
|
(and (or (not (setq res (next-single-property-change
|
|
|
|
|
position prop object limit)))
|
|
|
|
|
(eq res limit))
|
|
|
|
|
(< position (or limit (point-max)))))
|
|
|
|
|
(setq position parsed))
|
|
|
|
|
res))
|
|
|
|
|
|
2004-04-01 10:42:04 +00:00
|
|
|
|
(defun compilation-next-error (n &optional different-file pt)
|
1992-07-29 05:06:36 +00:00
|
|
|
|
"Move point to the next error in the compilation buffer.
|
2008-02-09 14:22:49 +00:00
|
|
|
|
This function does NOT find the source line like \\[next-error].
|
1999-10-27 22:38:17 +00:00
|
|
|
|
Prefix arg N says how many error messages to move forwards (or
|
|
|
|
|
backwards, if negative).
|
2008-02-09 14:22:49 +00:00
|
|
|
|
Optional arg DIFFERENT-FILE, if non-nil, means find next error for a
|
|
|
|
|
file that is different from the current one.
|
|
|
|
|
Optional arg PT, if non-nil, specifies the value of point to start
|
|
|
|
|
looking for the next message."
|
1992-07-29 05:06:36 +00:00
|
|
|
|
(interactive "p")
|
|
|
|
|
(or (compilation-buffer-p (current-buffer))
|
1999-10-27 22:38:17 +00:00
|
|
|
|
(error "Not in a compilation buffer"))
|
2004-04-01 10:42:04 +00:00
|
|
|
|
(or pt (setq pt (point)))
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(let* ((msg (get-text-property pt 'compilation-message))
|
2011-01-28 16:42:34 -05:00
|
|
|
|
;; `loc', `msg', and `last' are used by the compilation-loop macro.
|
2011-02-01 11:33:17 -05:00
|
|
|
|
(loc (and msg (compilation--message->loc msg)))
|
2004-04-01 10:42:04 +00:00
|
|
|
|
last)
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(if (zerop n)
|
|
|
|
|
(unless (or msg ; find message near here
|
2004-04-04 12:56:01 +00:00
|
|
|
|
(setq msg (get-text-property (max (1- pt) (point-min))
|
2011-01-28 16:11:19 -05:00
|
|
|
|
'compilation-message)))
|
|
|
|
|
(setq pt (previous-single-property-change pt 'compilation-message nil
|
2004-04-04 12:56:01 +00:00
|
|
|
|
(line-beginning-position)))
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(unless (setq msg (get-text-property (max (1- pt) (point-min))
|
|
|
|
|
'compilation-message))
|
|
|
|
|
(setq pt (next-single-property-change pt 'compilation-message nil
|
2004-04-04 12:56:01 +00:00
|
|
|
|
(line-end-position)))
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(or (setq msg (get-text-property pt 'compilation-message))
|
2004-04-13 22:46:18 +00:00
|
|
|
|
(setq pt (point)))))
|
2011-02-01 11:33:17 -05:00
|
|
|
|
(setq last (compilation--loc->file-struct loc))
|
2004-04-01 10:42:04 +00:00
|
|
|
|
(if (>= n 0)
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(compilation-loop > compilation-next-single-property-change 1-
|
2004-04-01 10:42:04 +00:00
|
|
|
|
(if (get-buffer-process (current-buffer))
|
|
|
|
|
"No more %ss yet"
|
2007-01-19 02:25:48 +00:00
|
|
|
|
"Moved past last %s")
|
|
|
|
|
(point-max))
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(compilation--ensure-parse pt)
|
2004-04-04 12:56:01 +00:00
|
|
|
|
;; Don't move "back" to message at or before point.
|
|
|
|
|
;; Pass an explicit (point-min) to make sure pt is non-nil.
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(setq pt (previous-single-property-change
|
|
|
|
|
pt 'compilation-message nil (point-min)))
|
2004-04-01 10:42:04 +00:00
|
|
|
|
(compilation-loop < previous-single-property-change 1+
|
2007-01-19 02:25:48 +00:00
|
|
|
|
"Moved back before first %s" (point-min))))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(goto-char pt)
|
|
|
|
|
(or msg
|
|
|
|
|
(error "No %s here" compilation-error))))
|
1992-07-29 05:06:36 +00:00
|
|
|
|
|
|
|
|
|
(defun compilation-previous-error (n)
|
|
|
|
|
"Move point to the previous error in the compilation buffer.
|
1999-10-27 22:38:17 +00:00
|
|
|
|
Prefix arg N says how many error messages to move backwards (or
|
|
|
|
|
forwards, if negative).
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
Does NOT find the source line like \\[previous-error]."
|
1992-07-29 05:06:36 +00:00
|
|
|
|
(interactive "p")
|
|
|
|
|
(compilation-next-error (- n)))
|
|
|
|
|
|
1992-08-04 02:02:27 +00:00
|
|
|
|
(defun compilation-next-file (n)
|
2004-03-28 08:32:16 +00:00
|
|
|
|
"Move point to the next error for a different file than the current one.
|
|
|
|
|
Prefix arg N says how many files to move forwards (or backwards, if negative)."
|
1992-08-04 02:02:27 +00:00
|
|
|
|
(interactive "p")
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(compilation-next-error n t))
|
1992-08-04 02:02:27 +00:00
|
|
|
|
|
|
|
|
|
(defun compilation-previous-file (n)
|
2004-03-28 08:32:16 +00:00
|
|
|
|
"Move point to the previous error for a different file than the current one.
|
|
|
|
|
Prefix arg N says how many files to move backwards (or forwards, if negative)."
|
1992-08-04 02:02:27 +00:00
|
|
|
|
(interactive "p")
|
|
|
|
|
(compilation-next-file (- n)))
|
|
|
|
|
|
2013-03-19 08:16:14 +08:00
|
|
|
|
(defun compilation-display-error ()
|
|
|
|
|
"Display the source for current error in another window."
|
|
|
|
|
(interactive)
|
|
|
|
|
(setq compilation-current-error (point))
|
|
|
|
|
(next-error-no-select 0))
|
|
|
|
|
|
1990-07-13 03:12:54 +00:00
|
|
|
|
(defun kill-compilation ()
|
2002-05-30 13:47:32 +00:00
|
|
|
|
"Kill the process made by the \\[compile] or \\[grep] commands."
|
1990-07-13 03:12:54 +00:00
|
|
|
|
(interactive)
|
1991-10-07 22:49:33 +00:00
|
|
|
|
(let ((buffer (compilation-find-buffer)))
|
1990-07-13 03:12:54 +00:00
|
|
|
|
(if (get-buffer-process buffer)
|
1991-10-07 22:49:33 +00:00
|
|
|
|
(interrupt-process (get-buffer-process buffer))
|
2005-08-22 19:55:57 +00:00
|
|
|
|
(error "The %s process is not running" (downcase mode-name)))))
|
1991-10-07 22:49:33 +00:00
|
|
|
|
|
2004-04-13 23:16:29 +00:00
|
|
|
|
(defalias 'compile-mouse-goto-error 'compile-goto-error)
|
2004-04-04 12:56:01 +00:00
|
|
|
|
|
2013-12-16 16:07:10 +08:00
|
|
|
|
(defun compile-goto-error (&optional event)
|
2004-04-13 23:16:29 +00:00
|
|
|
|
"Visit the source for the error message at point.
|
2013-12-16 16:07:10 +08:00
|
|
|
|
Use this command in a compilation log buffer."
|
2004-04-13 23:16:29 +00:00
|
|
|
|
(interactive (list last-input-event))
|
2004-04-14 17:30:49 +00:00
|
|
|
|
(if event (posn-set-point (event-end event)))
|
1991-10-07 22:49:33 +00:00
|
|
|
|
(or (compilation-buffer-p (current-buffer))
|
1999-10-27 22:38:17 +00:00
|
|
|
|
(error "Not in a compilation buffer"))
|
2011-01-28 17:06:20 -05:00
|
|
|
|
(compilation--ensure-parse (point))
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(if (get-text-property (point) 'compilation-directory)
|
|
|
|
|
(dired-other-window
|
|
|
|
|
(car (get-text-property (point) 'compilation-directory)))
|
2004-04-13 22:46:18 +00:00
|
|
|
|
(setq compilation-current-error (point))
|
2005-10-02 11:07:01 +00:00
|
|
|
|
(next-error-internal)))
|
1990-07-13 03:12:54 +00:00
|
|
|
|
|
2011-01-28 16:11:19 -05:00
|
|
|
|
;; This is mostly unused, but we keep it for the sake of some external
|
|
|
|
|
;; packages which seem to make use of it.
|
2004-12-27 16:09:37 +00:00
|
|
|
|
(defun compilation-find-buffer (&optional avoid-current)
|
2007-08-02 17:40:54 +00:00
|
|
|
|
"Return a compilation buffer.
|
2007-08-08 05:57:54 +00:00
|
|
|
|
If AVOID-CURRENT is nil, and the current buffer is a compilation buffer,
|
|
|
|
|
return it. If AVOID-CURRENT is non-nil, return the current buffer only
|
|
|
|
|
as a last resort."
|
|
|
|
|
(if (and (compilation-buffer-internal-p) (not avoid-current))
|
2007-08-02 17:40:54 +00:00
|
|
|
|
(current-buffer)
|
|
|
|
|
(next-error-find-buffer avoid-current 'compilation-buffer-internal-p)))
|
1991-10-07 22:49:33 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2004-04-21 21:37:18 +00:00
|
|
|
|
(defun compilation-next-error-function (n &optional reset)
|
2005-06-28 18:57:00 +00:00
|
|
|
|
"Advance to the next error message and visit the file where the error was.
|
|
|
|
|
This is the value of `next-error-function' in Compilation buffers."
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(interactive "p")
|
2004-04-21 21:37:18 +00:00
|
|
|
|
(when reset
|
|
|
|
|
(setq compilation-current-error nil))
|
2011-11-09 09:04:13 -05:00
|
|
|
|
(let* ((screen-columns compilation-error-screen-columns)
|
2012-01-24 21:01:22 -05:00
|
|
|
|
(first-column compilation-first-column)
|
2011-04-22 20:44:26 +02:00
|
|
|
|
(last 1)
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(msg (compilation-next-error (or n 1) nil
|
2004-05-01 21:13:00 +00:00
|
|
|
|
(or compilation-current-error
|
|
|
|
|
compilation-messages-start
|
|
|
|
|
(point-min))))
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(loc (compilation--message->loc msg))
|
|
|
|
|
(end-loc (compilation--message->end-loc msg))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(marker (point-marker)))
|
2004-04-01 10:42:04 +00:00
|
|
|
|
(setq compilation-current-error (point-marker)
|
2004-04-13 22:46:18 +00:00
|
|
|
|
overlay-arrow-position
|
|
|
|
|
(if (bolp)
|
|
|
|
|
compilation-current-error
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(copy-marker (line-beginning-position))))
|
2007-06-03 18:56:15 +00:00
|
|
|
|
;; If loc contains no marker, no error in that file has been visited.
|
|
|
|
|
;; If the marker is invalid the buffer has been killed.
|
|
|
|
|
;; So, recalculate all markers for that file.
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(unless (and (compilation--loc->marker loc)
|
|
|
|
|
(marker-buffer (compilation--loc->marker loc))
|
|
|
|
|
;; FIXME-omake: For "omake -P", which automatically recompiles
|
|
|
|
|
;; when the file is modified, the line numbers of new output
|
|
|
|
|
;; may not be related to line numbers from earlier output
|
|
|
|
|
;; (earlier markers), so we used to try to detect it here and
|
|
|
|
|
;; force a reparse. But that caused more problems elsewhere,
|
|
|
|
|
;; so instead we now flush the file-structure when we see
|
|
|
|
|
;; omake's message telling it's about to recompile a file.
|
|
|
|
|
;; (or (null (compilation--loc->timestamp loc)) ;A fake-loc
|
|
|
|
|
;; (equal (compilation--loc->timestamp loc)
|
|
|
|
|
;; (setq timestamp compilation-buffer-modtime)))
|
|
|
|
|
)
|
|
|
|
|
(with-current-buffer
|
2013-04-24 09:50:22 -04:00
|
|
|
|
(apply #'compilation-find-file
|
|
|
|
|
marker
|
|
|
|
|
(caar (compilation--loc->file-struct loc))
|
|
|
|
|
(cadr (car (compilation--loc->file-struct loc)))
|
|
|
|
|
(compilation--file-struct->formats
|
|
|
|
|
(compilation--loc->file-struct loc)))
|
2011-11-09 09:04:13 -05:00
|
|
|
|
(let ((screen-columns
|
|
|
|
|
;; Obey the compilation-error-screen-columns of the target
|
|
|
|
|
;; buffer if its major mode set it buffer-locally.
|
|
|
|
|
(if (local-variable-p 'compilation-error-screen-columns)
|
2012-01-24 21:01:22 -05:00
|
|
|
|
compilation-error-screen-columns screen-columns))
|
|
|
|
|
(compilation-first-column
|
|
|
|
|
(if (local-variable-p 'compilation-first-column)
|
|
|
|
|
compilation-first-column first-column)))
|
2011-11-09 09:04:13 -05:00
|
|
|
|
(save-restriction
|
|
|
|
|
(widen)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
;; Treat file's found lines in forward order, 1 by 1.
|
|
|
|
|
(dolist (line (reverse (cddr (compilation--loc->file-struct loc))))
|
|
|
|
|
(when (car line) ; else this is a filename w/o a line#
|
|
|
|
|
(beginning-of-line (- (car line) last -1))
|
|
|
|
|
(setq last (car line)))
|
|
|
|
|
;; Treat line's found columns and store/update a marker for each.
|
|
|
|
|
(dolist (col (cdr line))
|
|
|
|
|
(if (compilation--loc->col col)
|
|
|
|
|
(if (eq (compilation--loc->col col) -1)
|
|
|
|
|
;; Special case for range end.
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(compilation-move-to-column (compilation--loc->col col)
|
|
|
|
|
screen-columns))
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(skip-chars-forward " \t"))
|
|
|
|
|
(if (compilation--loc->marker col)
|
|
|
|
|
(set-marker (compilation--loc->marker col) (point))
|
|
|
|
|
(setf (compilation--loc->marker col) (point-marker)))
|
|
|
|
|
;; (setf (compilation--loc->timestamp col) timestamp)
|
|
|
|
|
))))))
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(compilation-goto-locus marker (compilation--loc->marker loc)
|
|
|
|
|
(compilation--loc->marker end-loc))
|
|
|
|
|
(setf (compilation--loc->visited loc) t)))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2004-05-02 20:44:55 +00:00
|
|
|
|
(defvar compilation-gcpro nil
|
|
|
|
|
"Internal variable used to keep some values from being GC'd.")
|
|
|
|
|
(make-variable-buffer-local 'compilation-gcpro)
|
|
|
|
|
|
2004-04-16 23:06:34 +00:00
|
|
|
|
(defun compilation-fake-loc (marker file &optional line col)
|
|
|
|
|
"Preassociate MARKER with FILE.
|
2004-04-25 12:55:43 +00:00
|
|
|
|
FILE should be ABSOLUTE-FILENAME or (RELATIVE-FILENAME . DIRNAME).
|
2004-04-16 23:06:34 +00:00
|
|
|
|
This is useful when you compile temporary files, but want
|
|
|
|
|
automatic translation of the messages to the real buffer from
|
2011-01-28 16:11:19 -05:00
|
|
|
|
which the temporary file came. This may also affect previous messages
|
|
|
|
|
about FILE.
|
2004-04-16 23:06:34 +00:00
|
|
|
|
|
|
|
|
|
Optional args LINE and COL default to 1 and beginning of
|
|
|
|
|
indentation respectively. The marker is expected to reflect
|
|
|
|
|
this. In the simplest case the marker points to the first line
|
|
|
|
|
of the region that was saved to the temp file.
|
|
|
|
|
|
|
|
|
|
If you concatenate several regions into the temp file (e.g. a
|
|
|
|
|
header with variable assignments and a code region), you must
|
|
|
|
|
call this several times, once each for the last line of one
|
|
|
|
|
region and the first line of the next region."
|
|
|
|
|
(or (consp file) (setq file (list file)))
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(compilation--flush-file-structure file)
|
|
|
|
|
(let ((fs (compilation-get-file-structure file)))
|
|
|
|
|
;; Between the current call to compilation-fake-loc and the first
|
|
|
|
|
;; occurrence of an error message referring to `file', the data is
|
|
|
|
|
;; only kept in the weak hash-table compilation-locs, so we need
|
|
|
|
|
;; to prevent this entry in compilation-locs from being GC'd
|
|
|
|
|
;; away. --Stef
|
|
|
|
|
(push fs compilation-gcpro)
|
|
|
|
|
(let ((loc (compilation-assq (or line 1) (cdr fs))))
|
|
|
|
|
(setq loc (compilation-assq col loc))
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 19:13:41 -04:00
|
|
|
|
(cl-assert (null (cdr loc)))
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(setcdr loc (compilation--make-cdrloc line fs marker))
|
2011-01-28 16:11:19 -05:00
|
|
|
|
loc)))
|
2004-04-16 23:06:34 +00:00
|
|
|
|
|
2005-05-16 00:01:46 +00:00
|
|
|
|
(defcustom compilation-context-lines nil
|
|
|
|
|
"Display this many lines of leading context before the current message.
|
|
|
|
|
If nil and the left fringe is displayed, don't scroll the
|
|
|
|
|
compilation output window; an arrow in the left fringe points to
|
|
|
|
|
the current message. If nil and there is no left fringe, the message
|
|
|
|
|
displays at the top of the window; there is no arrow."
|
2004-04-29 15:31:38 +00:00
|
|
|
|
:type '(choice integer (const :tag "No window scrolling" nil))
|
2004-04-07 12:57:04 +00:00
|
|
|
|
:group 'compilation
|
2005-02-09 15:50:47 +00:00
|
|
|
|
:version "22.1")
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
|
|
|
|
(defsubst compilation-set-window (w mk)
|
2004-04-16 23:22:07 +00:00
|
|
|
|
"Align the compilation output window W with marker MK near top."
|
2004-04-29 15:31:38 +00:00
|
|
|
|
(if (integerp compilation-context-lines)
|
|
|
|
|
(set-window-start w (save-excursion
|
2005-05-16 00:01:46 +00:00
|
|
|
|
(goto-char mk)
|
|
|
|
|
(beginning-of-line
|
|
|
|
|
(- 1 compilation-context-lines))
|
|
|
|
|
(point)))
|
2005-05-19 15:38:27 +00:00
|
|
|
|
;; If there is no left fringe.
|
|
|
|
|
(if (equal (car (window-fringes)) 0)
|
2005-05-16 00:01:46 +00:00
|
|
|
|
(set-window-start w (save-excursion
|
|
|
|
|
(goto-char mk)
|
|
|
|
|
(beginning-of-line 1)
|
|
|
|
|
(point)))))
|
|
|
|
|
(set-window-point w mk))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
|
2005-04-23 16:35:19 +00:00
|
|
|
|
(defvar next-error-highlight-timer)
|
|
|
|
|
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(defun compilation-goto-locus (msg mk end-mk)
|
2004-04-16 23:22:07 +00:00
|
|
|
|
"Jump to an error corresponding to MSG at MK.
|
2004-09-02 16:35:17 +00:00
|
|
|
|
All arguments are markers. If END-MK is non-nil, mark is set there
|
|
|
|
|
and overlay is highlighted between MK and END-MK."
|
1994-03-07 22:31:48 +00:00
|
|
|
|
;; Show compilation buffer in other window, scrolled to this error.
|
Do not call to `selected-window' where it is assumed by default.
Affected functions are `window-minibuffer-p', `window-dedicated-p',
`window-hscroll', `window-width', `window-height', `window-buffer',
`window-frame', `window-start', `window-point', `next-window'
and `window-display-table'.
* abbrev.el (abbrev--default-expand):
* bs.el (bs--show-with-configuration):
* buff-menu.el (Buffer-menu-mouse-select):
* calc/calc.el (calc):
* calendar/calendar.el (calendar-generate-window):
* calendar/diary-lib.el (diary-simple-display, diary-show-all-entries)
(diary-make-entry):
* comint.el (send-invisible, comint-dynamic-complete-filename)
(comint-dynamic-simple-complete, comint-dynamic-list-completions):
* completion.el (complete):
* dabbrev.el (dabbrev-expand, dabbrev--make-friend-buffer-list):
* disp-table.el (describe-current-display-table):
* doc-view.el (doc-view-insert-image):
* ebuff-menu.el (Electric-buffer-menu-mouse-select):
* ehelp.el (with-electric-help):
* emacs-lisp/easy-mmode.el (easy-mmode-define-navigation):
* emacs-lisp/edebug.el (edebug-two-window-p, edebug-pop-to-buffer):
* emacs-lisp/helper.el (Helper-help-scroller):
* emulation/cua-base.el (cua--post-command-handler-1):
* eshell/esh-mode.el (eshell-output-filter):
* ffap.el (ffap-gnus-wrapper):
* help-macro.el (make-help-screen):
* hilit-chg.el (highlight-compare-buffers):
* hippie-exp.el (hippie-expand, try-expand-dabbrev-visible):
* hl-line.el (global-hl-line-highlight):
* icomplete.el (icomplete-simple-completing-p):
* isearch.el (isearch-done):
* jit-lock.el (jit-lock-stealth-fontify):
* mail/rmailsum.el (rmail-summary-scroll-msg-up):
* lisp/mouse-drag.el (mouse-drag-should-do-col-scrolling):
* mpc.el (mpc-tagbrowser, mpc):
* net/rcirc.el (rcirc-any-buffer):
* play/gomoku.el (gomoku-max-width, gomoku-max-height):
* play/landmark.el (landmark-max-width, landmark-max-height):
* play/zone.el (zone):
* progmodes/compile.el (compilation-goto-locus):
* progmodes/ebrowse.el (ebrowse-view/find-file-and-search-pattern):
* progmodes/etags.el (find-tag-other-window):
* progmodes/fortran.el (fortran-column-ruler):
* progmodes/gdb-mi.el (gdb-mouse-toggle-breakpoint-fringe):
* progmodes/verilog-mode.el (verilog-point-text):
* reposition.el (reposition-window):
* rot13.el (toggle-rot13-mode):
* server.el (server-switch-buffer):
* shell.el (shell-dynamic-complete-command)
(shell-dynamic-complete-environment-variable):
* simple.el (insert-buffer, set-selective-display)
(delete-completion-window):
* speedbar.el (speedbar-timer-fn, speedbar-center-buffer-smartly)
(speedbar-recenter):
* startup.el (fancy-splash-head):
* textmodes/ispell.el (ispell-command-loop):
* textmodes/makeinfo.el (makeinfo-compilation-sentinel-region):
* tutorial.el (help-with-tutorial):
* vc/add-log.el (add-change-log-entry):
* vc/compare-w.el (compare-windows):
* vc/ediff-help.el (ediff-indent-help-message):
* vc/ediff-util.el (ediff-setup-control-buffer, ediff-position-region):
* vc/ediff-wind.el (ediff-skip-unsuitable-frames)
(ediff-setup-control-frame):
* vc/emerge.el (emerge-position-region):
* vc/pcvs-util.el (cvs-bury-buffer):
* window.el (walk-windows, mouse-autoselect-window-select):
* winner.el (winner-set-conf, winner-undo): Related users changed.
2013-08-05 18:26:57 +04:00
|
|
|
|
(let* ((from-compilation-buffer (eq (window-buffer)
|
2005-10-16 14:12:50 +00:00
|
|
|
|
(marker-buffer msg)))
|
|
|
|
|
;; Use an existing window if it is in a visible frame.
|
2005-09-05 15:43:22 +00:00
|
|
|
|
(pre-existing (get-buffer-window (marker-buffer msg) 0))
|
2005-10-16 14:12:50 +00:00
|
|
|
|
(w (if (and from-compilation-buffer pre-existing)
|
|
|
|
|
;; Calling display-buffer here may end up (partly) hiding
|
|
|
|
|
;; the error location if the two buffers are in two
|
|
|
|
|
;; different frames. So don't do it if it's not necessary.
|
|
|
|
|
pre-existing
|
2013-12-03 03:19:24 +02:00
|
|
|
|
(display-buffer (marker-buffer msg) '(nil (allow-no-window . t)))))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(highlight-regexp (with-current-buffer (marker-buffer msg)
|
|
|
|
|
;; also do this while we change buffer
|
2013-11-19 10:34:04 +08:00
|
|
|
|
(goto-char (marker-position msg))
|
|
|
|
|
(and w (compilation-set-window w msg))
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
compilation-highlight-regexp)))
|
2011-09-10 17:15:28 -04:00
|
|
|
|
;; Ideally, the window-size should be passed to `display-buffer'
|
|
|
|
|
;; so it's only used when creating a new window.
|
2013-11-19 10:34:04 +08:00
|
|
|
|
(when (and (not pre-existing) w)
|
|
|
|
|
(compilation-set-window-height w))
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
|
2005-10-16 14:12:50 +00:00
|
|
|
|
(if from-compilation-buffer
|
|
|
|
|
;; If the compilation buffer window was selected,
|
|
|
|
|
;; keep the compilation buffer in this window;
|
|
|
|
|
;; display the source in another window.
|
|
|
|
|
(let ((pop-up-windows t))
|
|
|
|
|
(pop-to-buffer (marker-buffer mk) 'other-window))
|
2011-09-02 12:38:40 -04:00
|
|
|
|
(switch-to-buffer (marker-buffer mk)))
|
2005-10-16 14:12:50 +00:00
|
|
|
|
(unless (eq (goto-char mk) (point))
|
2009-08-13 00:58:54 +00:00
|
|
|
|
;; If narrowing gets in the way of going to the right place, widen.
|
2005-10-16 14:12:50 +00:00
|
|
|
|
(widen)
|
2009-08-13 00:58:54 +00:00
|
|
|
|
(if next-error-move-function
|
|
|
|
|
(funcall next-error-move-function msg mk)
|
|
|
|
|
(goto-char mk)))
|
2005-10-16 14:12:50 +00:00
|
|
|
|
(if end-mk
|
|
|
|
|
(push-mark end-mk t)
|
|
|
|
|
(if mark-active (setq mark-active)))
|
|
|
|
|
;; If hideshow got in the way of
|
|
|
|
|
;; seeing the right place, open permanently.
|
|
|
|
|
(dolist (ov (overlays-at (point)))
|
|
|
|
|
(when (eq 'hs (overlay-get ov 'invisible))
|
|
|
|
|
(delete-overlay ov)
|
|
|
|
|
(goto-char mk)))
|
|
|
|
|
|
2004-09-02 16:35:17 +00:00
|
|
|
|
(when highlight-regexp
|
2005-03-29 04:57:52 +00:00
|
|
|
|
(if (timerp next-error-highlight-timer)
|
|
|
|
|
(cancel-timer next-error-highlight-timer))
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
(unless compilation-highlight-overlay
|
2004-04-04 12:56:01 +00:00
|
|
|
|
(setq compilation-highlight-overlay
|
|
|
|
|
(make-overlay (point-min) (point-min)))
|
2004-09-01 18:44:35 +00:00
|
|
|
|
(overlay-put compilation-highlight-overlay 'face 'next-error))
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(with-current-buffer (marker-buffer mk)
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
(save-excursion
|
2004-09-02 16:35:17 +00:00
|
|
|
|
(if end-mk (goto-char end-mk) (end-of-line))
|
2004-04-04 12:56:01 +00:00
|
|
|
|
(let ((end (point)))
|
2004-09-02 16:35:17 +00:00
|
|
|
|
(if mk (goto-char mk) (beginning-of-line))
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
(if (and (stringp highlight-regexp)
|
(compile-auto-highlight)
(compilation-error-list, compilation-old-error-list)
(compilation-parse-errors-function, compilation-parsing-end)
(compilation-error-message, compilation-directory-stack)
(compilation-enter-directory-regexp-alist)
(compilation-leave-directory-regexp-alist)
(compilation-file-regexp-alist, compilation-nomessage-regexp-alist)
(compilation-current-file, compilation-regexps): Remove vars.
(compile-error-at-point, compilation-error-filedata)
(compilation-error-filedata-file-name, compile-reinitialize-errors)
(compilation-next-error-locus, compilation-forget-errors)
(count-regexp-groupings, compilation-parse-errors)
(compile-collect-regexps, compile-buffer-substring): Remove funs.
(compile-internal): Make obsolete.
(compilation-first-column, compilation-error)
(compilation-directory-matcher, compilation-page-delimiter)
(compilation-mode-font-lock-keywords, compilation-debug)
(compilation-error-face, compilation-warning-face)
(compilation-info-face, compilation-line-face)
(compilation-column-face, compilation-enter-directory-face)
(compilation-leave-directory-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): New vars.
(compilation-warning-face, compilation-info-face)
(compilation-message-face): New faces.
(compilation-error-regexp-alist-alist): New constant.
(compilation-face, compilation-directory-properties)
(compilation-assq, compilation-error-properties, compilation-start)
(define-compilation-mode, compilation-loop)
(compilation-set-window): New functions.
(compile): Additional argument for interactive compiles like TeX.
2004-03-11 22:39:29 +00:00
|
|
|
|
(re-search-forward highlight-regexp end t))
|
(grep-command, grep-use-null-device)
(grep-find-command, grep-tree-command, grep-tree-files-aliases)
(grep-tree-ignore-case, grep-tree-ignore-CVS-directories)
(grep-regexp-alist, grep-program, find-program)
(grep-find-use-xargs, grep-history, grep-find-history)
(grep-process-setup, grep-compute-defaults)
(grep-default-command, grep, grep-tag-default, grep-find)
(grep-expand-command-macros, grep-tree-last-regexp)
(grep-tree-last-files, grep-tree): Move grep variables, functions
and commands to new file grep.el.
(compilation-mode-map): Remove grep commands from Compile sub-menu.
(compilation-process-setup-function): Doc fix.
(compilation-highlight-regexp, compilation-highlight-overlay): New
defvars used for highlighting current compile error in source buffer.
(compile-internal): New optional args HIGHLIGHT-REGEXP and
LOCAL-MAP which overrides compilation-highlight-regexp and
compilation-mode-map for this compilation.
Delay calling compilation-set-window-height until after running
compilation-process-setup-function so it can buffer-local override
compilation-window-height.
Check buffer-local value of compilation-scroll-output.
(compilation-set-window-height): Use buffer-local value of
compilation-window-height.
(compilation-revert-buffer): Don't pass (undefined)
preserve-modes arg to revert-buffer.
(next-error-no-select, previous-error-no-select): New commands.
(compilation-goto-locus): Temporarily highlight current match in
source buffer using compilation-highlight-regexp.
2003-11-23 20:57:47 +00:00
|
|
|
|
(progn
|
|
|
|
|
(goto-char (match-beginning 0))
|
2004-09-01 18:44:35 +00:00
|
|
|
|
(move-overlay compilation-highlight-overlay
|
|
|
|
|
(match-beginning 0) (match-end 0)
|
|
|
|
|
(current-buffer)))
|
|
|
|
|
(move-overlay compilation-highlight-overlay
|
|
|
|
|
(point) end (current-buffer)))
|
2006-09-24 20:42:08 +00:00
|
|
|
|
(if (or (eq next-error-highlight t)
|
|
|
|
|
(numberp next-error-highlight))
|
|
|
|
|
;; We want highlighting: delete overlay on next input.
|
|
|
|
|
(add-hook 'pre-command-hook
|
|
|
|
|
'compilation-goto-locus-delete-o)
|
|
|
|
|
;; We don't want highlighting: delete overlay now.
|
|
|
|
|
(delete-overlay compilation-highlight-overlay))
|
|
|
|
|
;; We want highlighting for a limited time:
|
|
|
|
|
;; set up a timer to delete it.
|
|
|
|
|
(when (numberp next-error-highlight)
|
|
|
|
|
(setq next-error-highlight-timer
|
|
|
|
|
(run-at-time next-error-highlight nil
|
|
|
|
|
'compilation-goto-locus-delete-o)))))))
|
2004-09-01 18:44:35 +00:00
|
|
|
|
(when (and (eq next-error-highlight 'fringe-arrow))
|
2006-09-24 20:42:08 +00:00
|
|
|
|
;; We want a fringe arrow (instead of highlighting).
|
2005-04-07 15:15:38 +00:00
|
|
|
|
(setq next-error-overlay-arrow-position
|
|
|
|
|
(copy-marker (line-beginning-position))))))
|
|
|
|
|
|
2006-09-24 20:42:08 +00:00
|
|
|
|
(defun compilation-goto-locus-delete-o ()
|
|
|
|
|
(delete-overlay compilation-highlight-overlay)
|
|
|
|
|
;; Get rid of timer and hook that would try to do this again.
|
|
|
|
|
(if (timerp next-error-highlight-timer)
|
|
|
|
|
(cancel-timer next-error-highlight-timer))
|
|
|
|
|
(remove-hook 'pre-command-hook
|
|
|
|
|
'compilation-goto-locus-delete-o))
|
1994-03-07 22:31:48 +00:00
|
|
|
|
|
2005-09-12 05:01:06 +00:00
|
|
|
|
(defun compilation-find-file (marker filename directory &rest formats)
|
1999-10-27 22:38:17 +00:00
|
|
|
|
"Find a buffer for file FILENAME.
|
2008-02-09 14:34:45 +00:00
|
|
|
|
If FILENAME is not found at all, ask the user where to find it.
|
|
|
|
|
Pop up the buffer containing MARKER and scroll to MARKER if we ask
|
|
|
|
|
the user where to find the file.
|
2000-08-16 20:20:43 +00:00
|
|
|
|
Search the directories in `compilation-search-path'.
|
|
|
|
|
A nil in `compilation-search-path' means to try the
|
2005-09-12 05:01:06 +00:00
|
|
|
|
\"current\" directory, which is passed in DIRECTORY.
|
2007-06-04 01:36:30 +00:00
|
|
|
|
If DIRECTORY is relative, it is combined with `default-directory'.
|
|
|
|
|
If DIRECTORY is nil, that means use `default-directory'.
|
2008-02-09 14:34:45 +00:00
|
|
|
|
FORMATS, if given, is a list of formats to reformat FILENAME when
|
|
|
|
|
looking for it: for each element FMT in FORMATS, this function
|
|
|
|
|
attempts to find a file whose name is produced by (format FMT FILENAME)."
|
1995-03-06 15:51:22 +00:00
|
|
|
|
(or formats (setq formats '("%s")))
|
2006-07-11 15:08:33 +00:00
|
|
|
|
(let ((dirs compilation-search-path)
|
|
|
|
|
(spec-dir (if directory
|
|
|
|
|
(expand-file-name directory)
|
|
|
|
|
default-directory))
|
|
|
|
|
buffer thisdir fmts name)
|
|
|
|
|
(if (file-name-absolute-p filename)
|
|
|
|
|
;; The file name is absolute. Use its explicit directory as
|
|
|
|
|
;; the first in the search path, and strip it from FILENAME.
|
|
|
|
|
(setq filename (abbreviate-file-name (expand-file-name filename))
|
|
|
|
|
dirs (cons (file-name-directory filename) dirs)
|
|
|
|
|
filename (file-name-nondirectory filename)))
|
|
|
|
|
;; Now search the path.
|
|
|
|
|
(while (and dirs (null buffer))
|
|
|
|
|
(setq thisdir (or (car dirs) spec-dir)
|
|
|
|
|
fmts formats)
|
|
|
|
|
;; For each directory, try each format string.
|
|
|
|
|
(while (and fmts (null buffer))
|
|
|
|
|
(setq name (expand-file-name (format (car fmts) filename) thisdir)
|
|
|
|
|
buffer (and (file-exists-p name)
|
|
|
|
|
(find-file-noselect name))
|
|
|
|
|
fmts (cdr fmts)))
|
|
|
|
|
(setq dirs (cdr dirs)))
|
2006-07-18 14:40:29 +00:00
|
|
|
|
(while (null buffer) ;Repeat until the user selects an existing file.
|
|
|
|
|
;; The file doesn't exist. Ask the user where to find it.
|
|
|
|
|
(save-excursion ;This save-excursion is probably not right.
|
2013-11-19 10:34:04 +08:00
|
|
|
|
(let ((w (let ((pop-up-windows t))
|
|
|
|
|
(display-buffer (marker-buffer marker)
|
2013-12-03 03:19:24 +02:00
|
|
|
|
'(nil (allow-no-window . t))))))
|
2013-11-19 10:34:04 +08:00
|
|
|
|
(with-current-buffer (marker-buffer marker)
|
|
|
|
|
(goto-char marker)
|
|
|
|
|
(and w (compilation-set-window w marker)))
|
2006-07-18 14:40:29 +00:00
|
|
|
|
(let* ((name (read-file-name
|
|
|
|
|
(format "Find this %s in (default %s): "
|
|
|
|
|
compilation-error filename)
|
2007-05-08 16:02:14 +00:00
|
|
|
|
spec-dir filename t nil
|
|
|
|
|
;; The predicate below is fine when called from
|
|
|
|
|
;; minibuffer-complete-and-exit, but it's too
|
|
|
|
|
;; restrictive otherwise, since it also prevents the
|
|
|
|
|
;; user from completing "fo" to "foo/" when she
|
|
|
|
|
;; wants to enter "foo/bar".
|
2007-06-04 01:36:30 +00:00
|
|
|
|
;;
|
2007-05-08 16:02:14 +00:00
|
|
|
|
;; Try to make sure the user can only select
|
|
|
|
|
;; a valid answer. This predicate may be ignored,
|
|
|
|
|
;; tho, so we still have to double-check afterwards.
|
|
|
|
|
;; TODO: We should probably fix read-file-name so
|
|
|
|
|
;; that it never ignores this predicate, even when
|
|
|
|
|
;; using popup dialog boxes.
|
|
|
|
|
;; (lambda (name)
|
|
|
|
|
;; (if (file-directory-p name)
|
|
|
|
|
;; (setq name (expand-file-name filename name)))
|
|
|
|
|
;; (file-exists-p name))
|
|
|
|
|
))
|
2006-07-18 14:40:29 +00:00
|
|
|
|
(origname name))
|
|
|
|
|
(cond
|
|
|
|
|
((not (file-exists-p name))
|
|
|
|
|
(message "Cannot find file `%s'" name)
|
|
|
|
|
(ding) (sit-for 2))
|
|
|
|
|
((and (file-directory-p name)
|
|
|
|
|
(not (file-exists-p
|
|
|
|
|
(setq name (expand-file-name filename name)))))
|
|
|
|
|
(message "No `%s' in directory %s" filename origname)
|
|
|
|
|
(ding) (sit-for 2))
|
|
|
|
|
(t
|
|
|
|
|
(setq buffer (find-file-noselect name))))))))
|
2006-07-11 15:08:33 +00:00
|
|
|
|
;; Make intangible overlays tangible.
|
2006-07-18 14:40:29 +00:00
|
|
|
|
;; This is weird: it's not even clear which is the current buffer,
|
|
|
|
|
;; so the code below can't be expected to DTRT here. -- Stef
|
|
|
|
|
(dolist (ov (overlays-in (point-min) (point-max)))
|
|
|
|
|
(when (overlay-get ov 'intangible)
|
|
|
|
|
(overlay-put ov 'intangible nil)))
|
2006-07-11 15:08:33 +00:00
|
|
|
|
buffer))
|
1999-12-26 12:59:52 +00:00
|
|
|
|
|
2004-04-25 12:55:43 +00:00
|
|
|
|
(defun compilation-get-file-structure (file &optional fmt)
|
|
|
|
|
"Retrieve FILE's file-structure or create a new one.
|
2005-09-12 05:01:06 +00:00
|
|
|
|
FILE should be (FILENAME) or (RELATIVE-FILENAME . DIRNAME).
|
|
|
|
|
In the former case, FILENAME may be relative or absolute.
|
2004-04-25 12:55:43 +00:00
|
|
|
|
|
2005-09-12 05:01:06 +00:00
|
|
|
|
The file-structure looks like this:
|
2011-01-28 16:11:19 -05:00
|
|
|
|
((FILENAME [DIR-FROM-PREV-MSG]) FMT LINE-STRUCT...)"
|
2004-04-25 12:55:43 +00:00
|
|
|
|
(or (gethash file compilation-locs)
|
|
|
|
|
;; File was not previously encountered, at least not in the form passed.
|
|
|
|
|
;; Let's normalize it and look again.
|
|
|
|
|
(let ((filename (car file))
|
2005-09-12 05:01:06 +00:00
|
|
|
|
;; Get the specified directory from FILE.
|
|
|
|
|
(spec-directory (if (cdr file)
|
|
|
|
|
(file-truename (cdr file)))))
|
2004-04-25 12:55:43 +00:00
|
|
|
|
|
|
|
|
|
;; Check for a comint-file-name-prefix and prepend it if appropriate.
|
|
|
|
|
;; (This is very useful for compilation-minor-mode in an rlogin-mode
|
|
|
|
|
;; buffer.)
|
2005-09-12 05:01:06 +00:00
|
|
|
|
(when (and (boundp 'comint-file-name-prefix)
|
|
|
|
|
(not (equal comint-file-name-prefix "")))
|
|
|
|
|
(if (file-name-absolute-p filename)
|
|
|
|
|
(setq filename
|
|
|
|
|
(concat comint-file-name-prefix filename))
|
|
|
|
|
(if spec-directory
|
|
|
|
|
(setq spec-directory
|
|
|
|
|
(file-truename
|
|
|
|
|
(concat comint-file-name-prefix spec-directory))))))
|
2004-04-25 12:55:43 +00:00
|
|
|
|
|
|
|
|
|
;; If compilation-parse-errors-filename-function is
|
|
|
|
|
;; defined, use it to process the filename.
|
|
|
|
|
(when compilation-parse-errors-filename-function
|
|
|
|
|
(setq filename
|
|
|
|
|
(funcall compilation-parse-errors-filename-function
|
|
|
|
|
filename)))
|
|
|
|
|
|
|
|
|
|
;; Some compilers (e.g. Sun's java compiler, reportedly) produce bogus
|
|
|
|
|
;; file names like "./bar//foo.c" for file "bar/foo.c";
|
|
|
|
|
;; expand-file-name will collapse these into "/foo.c" and fail to find
|
|
|
|
|
;; the appropriate file. So we look for doubled slashes in the file
|
|
|
|
|
;; name and fix them.
|
|
|
|
|
(setq filename (command-line-normalize-file-name filename))
|
|
|
|
|
|
|
|
|
|
;; Store it for the possibly unnormalized name
|
|
|
|
|
(puthash file
|
|
|
|
|
;; Retrieve or create file-structure for normalized name
|
2007-08-17 07:17:45 +00:00
|
|
|
|
;; The gethash used to not use spec-directory, but
|
|
|
|
|
;; this leads to errors when files in different
|
|
|
|
|
;; directories have the same name:
|
|
|
|
|
;; http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00463.html
|
|
|
|
|
(or (gethash (cons filename spec-directory) compilation-locs)
|
2007-09-07 03:48:30 +00:00
|
|
|
|
(puthash (cons filename spec-directory)
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(compilation--make-file-struct
|
|
|
|
|
(list filename spec-directory) fmt)
|
2005-09-12 05:01:06 +00:00
|
|
|
|
compilation-locs))
|
2004-04-25 12:55:43 +00:00
|
|
|
|
compilation-locs))))
|
1993-06-30 22:03:15 +00:00
|
|
|
|
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(defun compilation--flush-file-structure (file)
|
|
|
|
|
(or (consp file) (setq file (list file)))
|
|
|
|
|
(let ((fs (compilation-get-file-structure file)))
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 19:13:41 -04:00
|
|
|
|
(cl-assert (eq fs (gethash file compilation-locs)))
|
|
|
|
|
(cl-assert (eq fs (gethash (cons (caar fs) (cadr (car fs)))
|
2011-01-28 16:11:19 -05:00
|
|
|
|
compilation-locs)))
|
|
|
|
|
(maphash (lambda (k v)
|
|
|
|
|
(if (eq v fs) (remhash k compilation-locs)))
|
|
|
|
|
compilation-locs)))
|
|
|
|
|
|
2004-04-04 12:56:01 +00:00
|
|
|
|
;;; Compatibility with the old compile.el.
|
|
|
|
|
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(defvaralias 'compilation-last-buffer 'next-error-last-buffer)
|
|
|
|
|
(defvar compilation-parsing-end (make-marker))
|
|
|
|
|
(defvar compilation-error-list nil)
|
|
|
|
|
(defvar compilation-old-error-list nil)
|
2004-04-04 12:56:01 +00:00
|
|
|
|
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(defun compilation--compat-error-properties (err)
|
2004-04-16 23:22:07 +00:00
|
|
|
|
"Map old-style error ERR to new-style message."
|
2004-04-20 20:36:43 +00:00
|
|
|
|
;; Old-style structure is (MARKER (FILE DIR) LINE COL) or
|
|
|
|
|
;; (MARKER . MARKER).
|
|
|
|
|
(let ((dst (cdr err)))
|
|
|
|
|
(if (markerp dst)
|
2011-01-28 17:06:20 -05:00
|
|
|
|
`(compilation-message ,(compilation--make-message
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(cons nil (compilation--make-cdrloc
|
|
|
|
|
nil nil dst))
|
|
|
|
|
2 nil)
|
2004-04-20 20:36:43 +00:00
|
|
|
|
help-echo "mouse-2: visit the source location"
|
|
|
|
|
keymap compilation-button-map
|
|
|
|
|
mouse-face highlight)
|
|
|
|
|
;; Too difficult to do it by hand: dispatch to the normal code.
|
|
|
|
|
(let* ((file (pop dst))
|
|
|
|
|
(line (pop dst))
|
|
|
|
|
(col (pop dst))
|
|
|
|
|
(filename (pop file))
|
|
|
|
|
(dirname (pop file))
|
|
|
|
|
(fmt (pop file)))
|
|
|
|
|
(compilation-internal-error-properties
|
|
|
|
|
(cons filename dirname) line nil col nil 2 fmt)))))
|
2004-04-04 12:56:01 +00:00
|
|
|
|
|
2011-01-28 16:11:19 -05:00
|
|
|
|
(defun compilation--compat-parse-errors (limit)
|
2004-04-04 12:56:01 +00:00
|
|
|
|
(when compilation-parse-errors-function
|
|
|
|
|
;; FIXME: We should remove the rest of the compilation keywords
|
|
|
|
|
;; but we can't do that from here because font-lock is using
|
2011-01-28 16:11:19 -05:00
|
|
|
|
;; the value right now. --Stef
|
2004-04-04 12:56:01 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(setq compilation-error-list nil)
|
|
|
|
|
;; Reset compilation-parsing-end each time because font-lock
|
|
|
|
|
;; might force us the re-parse many times (typically because
|
|
|
|
|
;; some code adds some text-property to the output that we
|
|
|
|
|
;; already parsed). You might say "why reparse", well:
|
2011-01-28 16:11:19 -05:00
|
|
|
|
;; because font-lock has just removed the `compilation-message' property
|
|
|
|
|
;; so have to do it all over again.
|
2004-04-04 12:56:01 +00:00
|
|
|
|
(if compilation-parsing-end
|
|
|
|
|
(set-marker compilation-parsing-end (point))
|
|
|
|
|
(setq compilation-parsing-end (point-marker)))
|
|
|
|
|
(condition-case nil
|
|
|
|
|
;; Ignore any error: we're calling this function earlier than
|
|
|
|
|
;; in the old compile.el so things might not all be setup yet.
|
|
|
|
|
(funcall compilation-parse-errors-function limit nil)
|
|
|
|
|
(error nil))
|
|
|
|
|
(dolist (err (if (listp compilation-error-list) compilation-error-list))
|
|
|
|
|
(let* ((src (car err))
|
|
|
|
|
(dst (cdr err))
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(loc (cond ((markerp dst)
|
|
|
|
|
(cons nil
|
|
|
|
|
(compilation--make-cdrloc nil nil dst)))
|
2004-04-04 12:56:01 +00:00
|
|
|
|
((consp dst)
|
2011-01-28 16:42:34 -05:00
|
|
|
|
(cons (nth 2 dst)
|
|
|
|
|
(compilation--make-cdrloc
|
|
|
|
|
(nth 1 dst)
|
|
|
|
|
(cons (cdar dst) (caar dst))
|
|
|
|
|
nil))))))
|
2004-04-04 12:56:01 +00:00
|
|
|
|
(when loc
|
|
|
|
|
(goto-char src)
|
2011-01-28 16:11:19 -05:00
|
|
|
|
;; (put-text-property src (line-end-position)
|
|
|
|
|
;; 'font-lock-face 'font-lock-warning-face)
|
2004-04-04 12:56:01 +00:00
|
|
|
|
(put-text-property src (line-end-position)
|
2011-01-28 16:42:34 -05:00
|
|
|
|
'compilation-message
|
|
|
|
|
(compilation--make-message loc 2 nil)))))))
|
2004-04-04 12:56:01 +00:00
|
|
|
|
(goto-char limit)
|
|
|
|
|
nil)
|
|
|
|
|
|
2011-01-28 16:11:19 -05:00
|
|
|
|
;; Beware! this is not only compatibility code. New code also uses it. --Stef
|
2004-04-04 12:56:01 +00:00
|
|
|
|
(defun compilation-forget-errors ()
|
|
|
|
|
;; In case we hit the same file/line specs, we want to recompute a new
|
|
|
|
|
;; marker for them, so flush our cache.
|
2010-09-08 17:53:08 +02:00
|
|
|
|
(clrhash compilation-locs)
|
2004-05-02 20:44:55 +00:00
|
|
|
|
(setq compilation-gcpro nil)
|
2004-04-04 12:56:01 +00:00
|
|
|
|
;; FIXME: the old code reset the directory-stack, so maybe we should
|
|
|
|
|
;; put a `directory change' marker of some sort, but where? -stef
|
2004-04-13 22:46:18 +00:00
|
|
|
|
;;
|
2004-04-04 12:56:01 +00:00
|
|
|
|
;; FIXME: The old code moved compilation-current-error (which was
|
|
|
|
|
;; virtually represented by a mix of compilation-parsing-end and
|
|
|
|
|
;; compilation-error-list) to point-min, but that was only meaningful for
|
|
|
|
|
;; the internal uses of compilation-forget-errors: all calls from external
|
|
|
|
|
;; packages seem to be followed by a move of compilation-parsing-end to
|
2007-07-30 17:38:24 +00:00
|
|
|
|
;; something equivalent to point-max. So we heuristically move
|
2004-04-04 12:56:01 +00:00
|
|
|
|
;; compilation-current-error to point-max (since the external package
|
2007-07-30 17:38:24 +00:00
|
|
|
|
;; won't know that it should do it). --Stef
|
2004-05-01 21:13:00 +00:00
|
|
|
|
(setq compilation-current-error nil)
|
|
|
|
|
(let* ((proc (get-buffer-process (current-buffer)))
|
|
|
|
|
(mark (if proc (process-mark proc)))
|
|
|
|
|
(pos (or mark (point-max))))
|
|
|
|
|
(setq compilation-messages-start
|
|
|
|
|
;; In the future, ignore the text already present in the buffer.
|
|
|
|
|
;; Since many process filter functions insert before markers,
|
|
|
|
|
;; we need to put ours just before the insertion point rather
|
|
|
|
|
;; than at the insertion point. If that's not possible, then
|
|
|
|
|
;; don't use a marker. --Stef
|
2007-07-30 17:38:24 +00:00
|
|
|
|
(if (> pos (point-min)) (copy-marker (1- pos)) pos)))
|
|
|
|
|
;; Again, since this command is used in buffers that contain several
|
|
|
|
|
;; compilations, to set the beginning of "this compilation", it's a good
|
|
|
|
|
;; place to reset compilation-auto-jump-to-next.
|
|
|
|
|
(set (make-local-variable 'compilation-auto-jump-to-next)
|
2008-02-12 23:41:59 +00:00
|
|
|
|
(or compilation-auto-jump-to-first-error
|
|
|
|
|
(eq compilation-scroll-output 'first-error))))
|
2004-04-04 12:56:01 +00:00
|
|
|
|
|
1992-04-24 08:11:54 +00:00
|
|
|
|
(provide 'compile)
|
1992-06-11 02:31:08 +00:00
|
|
|
|
|
|
|
|
|
;;; compile.el ends here
|