unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* filename with new compile.el
@ 2012-10-03 18:05 Reto Zimmermann
  2012-10-06 17:44 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Reto Zimmermann @ 2012-10-03 18:05 UTC (permalink / raw)
  To: emacs-devel

Hi,

I would like to ask the author of the new compile.el how filenames are 
obtained when they are not part of the error message, but instead just 
printed out once at the beginning of a compile.  In the old compile.el 
there was variable compilation-file-regexp-alist for this purpose.  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.

Any hint at how this can be done?  I need this to update vhdl-mode.el.

Thanks,
Reto




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: filename with new compile.el
  2012-10-03 18:05 filename with new compile.el Reto Zimmermann
@ 2012-10-06 17:44 ` Stefan Monnier
  2012-10-08 12:55   ` Reto Zimmermann
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2012-10-06 17:44 UTC (permalink / raw)
  To: Reto Zimmermann; +Cc: emacs-devel

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: filename with new compile.el
  2012-10-06 17:44 ` Stefan Monnier
@ 2012-10-08 12:55   ` Reto Zimmermann
  0 siblings, 0 replies; 3+ messages in thread
From: Reto Zimmermann @ 2012-10-08 12:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier wrote:
>> 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?

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

Okay, I figured it out now.  Thanks for the help.

Reto



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-10-08 12:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-03 18:05 filename with new compile.el Reto Zimmermann
2012-10-06 17:44 ` Stefan Monnier
2012-10-08 12:55   ` Reto Zimmermann

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).