all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* M-x compile problem  under tramp
@ 2008-05-13 13:43 sunway
  2008-05-13 21:24 ` Michael Albinus
       [not found] ` <mailman.11565.1210713878.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 4+ messages in thread
From: sunway @ 2008-05-13 13:43 UTC (permalink / raw
  To: help-gnu-emacs

I have been using this elisp code:

(setq compilation-finish-function
      (lambda (buf str)
        (if (string-match "exited abnormally" str)
            (message "compilation errors, press C-x ` to visit")
          ;;no errors, make the compilation window go away in 0.5
seconds
          (run-at-time 0.5 nil 'delete-windows-on buf)
          (message "NO COMPILATION ERRORS!"))))

to close the Compilation buffer when there is no compilation error
when compiling.

how ever, when using M-x compile under tramp, the command will always
return "..finished.." instead of "exited abnormally" when there is
compilation error.  so the Compilation buffer will always be closed.
how to fix the problem?


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

* Re: M-x compile problem  under tramp
  2008-05-13 13:43 M-x compile problem under tramp sunway
@ 2008-05-13 21:24 ` Michael Albinus
       [not found] ` <mailman.11565.1210713878.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Albinus @ 2008-05-13 21:24 UTC (permalink / raw
  To: help-gnu-emacs

sunway <sunwayforever@gmail.com> writes:

> how ever, when using M-x compile under tramp, the command will always
> return "..finished.." instead of "exited abnormally" when there is
> compilation error.  so the Compilation buffer will always be closed.
> how to fix the problem?

You might try something like this:

(setq compile-command "make -k || echo Compilation exited abnormally with code $?")

Best regards, Michael.





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

* Re: M-x compile problem under tramp
       [not found] ` <mailman.11565.1210713878.18990.help-gnu-emacs@gnu.org>
@ 2008-05-14  3:09   ` sunway
  2008-05-14  8:13     ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: sunway @ 2008-05-14  3:09 UTC (permalink / raw
  To: help-gnu-emacs

On May 14, 5:24 am, Michael Albinus <michael.albi...@gmx.de> wrote:
> sunway <sunwayfore...@gmail.com> writes:
> > how ever, when using M-x compile under tramp, the command will always
> > return "..finished.." instead of "exited abnormally" when there is
> > compilation error.  so the Compilation buffer will always be closed.
> > how to fix the problem?
>
> You might try something like this:
>
> (setq compile-command "make -k || echo Compilation exited abnormally with code $?")
>
> Best regards, Michael.

Compilation started at Wed May 14 11:07:42

make -k || echo Compilation exited abnormally with code $?
g++ -g -I./occi/occi_header -I./matlab/include -DDEBUG   -c -o data.o
data.cpp
data.cpp:13: error: `ata_sniffer' has not been declared
data.cpp:13: error: expected `)' before '*' token
make: *** [data.o] Error 1
make: Target `all' not remade because of errors.
Compilation exited abnormally with code 2

///618cabfa20e529686c9b6e0b5a405636

exit
Connection to matlab closed.
exit

Compilation finished at Wed May 14 11:07:45


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

* Re: M-x compile problem under tramp
  2008-05-14  3:09   ` sunway
@ 2008-05-14  8:13     ` Michael Albinus
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Albinus @ 2008-05-14  8:13 UTC (permalink / raw
  To: sunway; +Cc: help-gnu-emacs

sunway <sunwayforever@gmail.com> writes:

> Compilation started at Wed May 14 11:07:42
>
> make -k || echo Compilation exited abnormally with code $?
> g++ -g -I./occi/occi_header -I./matlab/include -DDEBUG   -c -o data.o
> data.cpp
> data.cpp:13: error: `ata_sniffer' has not been declared
> data.cpp:13: error: expected `)' before '*' token
> make: *** [data.o] Error 1
> make: Target `all' not remade because of errors.
> Compilation exited abnormally with code 2
>
> ///618cabfa20e529686c9b6e0b5a405636
>
> exit
> Connection to matlab closed.
> exit
>
> Compilation finished at Wed May 14 11:07:45

Of course, you must also change your `compilation-finish-function'.
STR is still the success message of the process. Instead of, you might
check the buffer for the error message, like this (untested):

(setq compilation-finish-function
      (lambda (buf str)
        (save-excursion
          (with-current-buffer buf
            (goto-char (point-min))
            (if (re-search-forward "exited abnormally" nil t)
                (message "compilation errors, press C-x ` to visit")
              ;;no errors, make the compilation window go away in 0.5 seconds
              (run-at-time 0.5 nil 'delete-windows-on buf)
              (message "NO COMPILATION ERRORS!"))))))

Best regards, Michael.





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

end of thread, other threads:[~2008-05-14  8:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-13 13:43 M-x compile problem under tramp sunway
2008-05-13 21:24 ` Michael Albinus
     [not found] ` <mailman.11565.1210713878.18990.help-gnu-emacs@gnu.org>
2008-05-14  3:09   ` sunway
2008-05-14  8:13     ` Michael Albinus

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.