[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Display compilation buffer only if compilation failed
From: |
Aurélien Aptel |
Subject: |
Re: Display compilation buffer only if compilation failed |
Date: |
Sat, 11 Feb 2012 19:06:49 +0100 |
On Sat, Feb 11, 2012 at 6:29 PM, Drew Adams <drew.adams@oracle.com> wrote:
>> But it doesn't work...
>
> AFAICT, `recompile' invokes `compilation-start', which calls `display-buffer'
> on
> the output buffer.
save-window-excursion prevents the display-buffer call. It does work.
The real problem is after.
Consider this:
(with-current-buffer "obfu.c"
(let ((buf "*compilation*"))
(print buf)
(my-compile-success-p buf)))
"*compilation*"
=> t
(with-current-buffer "obfu.c"
(let ((buf (buffer-name (recompile))))
(print buf)
(my-compile-success-p buf)))
"*compilation*"
=> nil
In both case buf has the same value (both code prints "*compilation*")
but when passed to my-compile-success-p, the return value is
different.