[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Allow next-error to work with csc.exe

From: D Chiesa
Subject: Allow next-error to work with csc.exe
Date: Tue, 27 May 2008 14:52:45 -0700

Hey, I posted this independently, and someone suggested I should send it to this mailing list. I don't read the list, so I'm not sure if this is useful or on-topic or what. My apologies in advance if this is noise.

Here is a fragment of elisp to allow next-error to grok errors generated by the Microsoft C# compiler (csc.exe).

I'm sure this isn't the best format for general use, and someone will probably want to format it properly, and use the append and so on. But the regex's are there for the taking.

I also added regex's for vjc.exe, which is the Visual J++ compiler, and the C/C++ compiler from Microsoft. These are all command-line compilers available in the Windows Platform SDK (a free download) and the .NET Framework SDK (also a free download).

send me mail if questions or problems.

ps: my original post is here: http://blogs.msdn.com/dotnetinterop/archive/2008/05/22/emacs-regex-to-grok-csc-compilation-errors.aspx

;; to allow next-error to work with csc.exe:
(setq compilation-scroll-output t)
(setq-default compilation-error-regexp-alist
;       (append
; Microsoft VJC:
;sample.java(6,1) : error J0020: Expected 'class' or 'interface'
("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)[,]\\([0-9]+\\)): \\(error\\|warning\\) VJS[0-9]+:" 1 3 4)

;; Wed, 04 Aug 2004  09:29
;; also handle whitespace at beginning of line (for nant output)
;C# Compiler
;t.cs(6,18): error SC1006: Name of constructor must match name of class
("[ \t]*\\(\\([_a-zA-Z:\]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)[,]\\([0-9]+\\)): \\(error\\|warning\\) CS[0-9]+:" 1 3 4)

; Microsoft C/C++:
;  keyboard.c(537) : warning C4005: 'min' : macro redefinition
;  d:\tmp\test.c(23) : error C2143: syntax error : missing ';' before 'if'
;e:\projects\myce40\tok.h(85) : error C2236: unexpected 'class' '$S1'
;myc.cpp(14) : error C3149: 'class System::String' : illegal use of managed type 'String'; did you forget a '*'?
   ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \
: \\(error\\|warning\\) C[0-9]+:" 1 3)
;;  compilation-error-regexp-alist)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]