From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Aur=C3=A9lien_Aptel?= Newsgroups: gmane.emacs.help Subject: Re: Display compilation buffer only if compilation failed Date: Sat, 11 Feb 2012 19:06:49 +0100 Message-ID: References: <2A710B90B5974D5F8EFD545F7BADC5B1@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1328983624 24192 80.91.229.3 (11 Feb 2012 18:07:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 11 Feb 2012 18:07:04 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 11 19:07:03 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RwHLe-00036C-Eq for geh-help-gnu-emacs@m.gmane.org; Sat, 11 Feb 2012 19:06:58 +0100 Original-Received: from localhost ([::1]:56690 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwHLc-0001ee-O7 for geh-help-gnu-emacs@m.gmane.org; Sat, 11 Feb 2012 13:06:56 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:55564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwHLX-0001b8-O5 for help-gnu-emacs@gnu.org; Sat, 11 Feb 2012 13:06:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RwHLW-0006yZ-6Z for help-gnu-emacs@gnu.org; Sat, 11 Feb 2012 13:06:51 -0500 Original-Received: from mail-tul01m020-f169.google.com ([209.85.214.169]:39872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwHLW-0006yL-31 for help-gnu-emacs@gnu.org; Sat, 11 Feb 2012 13:06:50 -0500 Original-Received: by obbta7 with SMTP id ta7so6208051obb.0 for ; Sat, 11 Feb 2012 10:06:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=xWSDg35gyYyM+cIvawxspMbp3GMIKcmFHb5yjMNNJ88=; b=UYvZ7Nt59wycB+TlE0ZuAS3Ravtkdpeg4rF4QjvsBP88wlUU+4W9/50brrk3ovFwkQ qctfWZ8YDbRVaRZV2dkUF1GNLLfvB61AEjM4XtiyByXk9Q5q7XfiytTH5t46l8CgIu7M V001x4z13JTHKFfo/yC8Mk7QxDctKIWGWhC+U= Original-Received: by 10.182.74.102 with SMTP id s6mr7003248obv.46.1328983609527; Sat, 11 Feb 2012 10:06:49 -0800 (PST) Original-Received: by 10.182.11.166 with HTTP; Sat, 11 Feb 2012 10:06:49 -0800 (PST) In-Reply-To: <2A710B90B5974D5F8EFD545F7BADC5B1@us.oracle.com> X-Google-Sender-Auth: 1Lp-ahNbKUR2g_8a_XESvd0Ea64 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83706 Archived-At: On Sat, Feb 11, 2012 at 6:29 PM, Drew Adams 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.