all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Aurélien Aptel" <aurelien.aptel+emacs@gmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Display compilation buffer only if compilation failed
Date: Sat, 11 Feb 2012 19:06:49 +0100	[thread overview]
Message-ID: <CA+5B0FPJ7p3ZxPgvtqjGhnr1HXq9HWMSEY6VKOO-uVwYMaPi=w@mail.gmail.com> (raw)
In-Reply-To: <2A710B90B5974D5F8EFD545F7BADC5B1@us.oracle.com>

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.



  reply	other threads:[~2012-02-11 18:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-11 16:38 Display compilation buffer only if compilation failed Aurélien Aptel
2012-02-11 17:29 ` Drew Adams
2012-02-11 18:06   ` Aurélien Aptel [this message]
2012-02-11 18:13     ` Aurélien Aptel
2012-02-11 18:20       ` Drew Adams
2012-02-11 20:24         ` Aurélien Aptel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+5B0FPJ7p3ZxPgvtqjGhnr1HXq9HWMSEY6VKOO-uVwYMaPi=w@mail.gmail.com' \
    --to=aurelien.aptel+emacs@gmail.com \
    --cc=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.