all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Reto Zimmermann <reto@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: filename with new compile.el
Date: Sat, 06 Oct 2012 13:44:32 -0400	[thread overview]
Message-ID: <jwvd30vmrg8.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <506C7E6A.7010702@gnu.org> (Reto Zimmermann's message of "Wed, 03 Oct 2012 20:05:30 +0200")

> 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)))



  reply	other threads:[~2012-10-06 17:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-03 18:05 filename with new compile.el Reto Zimmermann
2012-10-06 17:44 ` Stefan Monnier [this message]
2012-10-08 12:55   ` Reto Zimmermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvd30vmrg8.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=reto@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.