home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
editor
/
me_cd.arc
/
COMPILE.MUT
< prev
next >
Wrap
Lisp/Scheme
|
1988-09-07
|
2KB
|
50 lines
; compile.mut: compiling made easy.
; Save the current buffer (if need be), run make from ME,
; collect the error/warning messages and parse the errors.
; If ERROR or WARNING is found, the file with the error is
; visited, the cursor is placed on the line containing the error
; and the error is displayed.
; ^X^E is usally bound to compile.
; ^X^N is usally bound to get next error.
; Notes:
; This is set up to parse LATTICE C. You'll probably have to
; change things for some other compiler.
; Microsoft MASM does not send errors to stdout. Those bozos. So you
; can't use this for masm.
; C Durland
(defun compile ; fork make
{
(string cb 80)(cb (buffer-name -1))
(delete-other-windows)(save-buffer)
(kill-buffer "*error-log*" "yes")(switch-to-buffer "*error-log*")
(set-mark)(msg "Compiling.....")(filter-region "make")
(buffer-modified -1 FALSE)(use-old-buffer cb)(next-error)
})
(defun next-error ; display the next error or warning
{
(string cb 80)(cb (buffer-name -1))
(delete-other-windows)(switch-to-buffer "error.log")
(forward-line 1) ; assume 1st line is not an error line
(if (re-search-forward "[ewEW][raRA]r[onON]") ; look for "error" or "warn"
{ ; found it
(split-window)(while (shrink-window) {}) ; 1 line error window
(beginning-of-line)
(if (looking-at '^\(\w+\.\w+\) \(\d+\)') ;get file name, line#
{
(visit-file (get-matched '\1')) ; visit the file with the error
(goto-line (atoi(get-matched '\2'))) ; put dot at error
(msg "") ; clear minibuffer
}
{(use-old-buffer cb)(msg "Can't parse.")}
)
}
{(use-old-buffer cb)(msg "No errors")}
)
(update)
})
(bind-to-key "compile" "^X^E")
(bind-to-key "next-error" "^X^N")