[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: filename with new compile.el
From: |
Stefan Monnier |
Subject: |
Re: filename with new compile.el |
Date: |
Sat, 06 Oct 2012 13:44:32 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) |
> In the old compile.el there was variable compilation-file-regexp-alist
> for this purpose.
By "old" you mean the one in Emacs < 22, right?
> From the comments for variable compilation-error-regexp-alist it
> sounds like this type of filename parsing is still possible but
> I can't figure out how. There doesn't seem to be an example for this
> in the predefined regexp settings.
IIUC the way it works is that you have one regexp that matches the
message with the file name (can have nil for its LINE/COLUMN info), and
then have another that matches the messages without file name (this one
will have nil for the FILE part but presumably non-nil for the LINE and
maybe COLUMN part).
If you look at the way compile-internal was implemented in Emacs-22 and
23 (quoted below), you see you should be able to just use your
compilation-file-regexp-alist entries directly in
compilation-error-regexp-alist (assuming that worked in Emacs-23).
Stefan
(defun compile-internal (command error-message
&optional name-of-mode parser
error-regexp-alist name-function
enter-regexp-alist leave-regexp-alist
file-regexp-alist nomessage-regexp-alist
no-async highlight-regexp local-map)
(if parser
(error "Compile now works very differently, see
`compilation-error-regexp-alist'"))
(let ((compilation-error-regexp-alist
(append file-regexp-alist (or error-regexp-alist
compilation-error-regexp-alist)))
(compilation-error (replace-regexp-in-string "^No more \\(.+\\)s\\.?"
"\\1" error-message)))
(compilation-start command nil name-function highlight-regexp)))