From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Amin Bandali Newsgroups: gmane.emacs.help Subject: Re: Show *compilation* only if build did not succeed Date: Sat, 22 Dec 2018 12:52:06 -0500 Message-ID: <87ftupxxdl.fsf@aminb.org> References: <87h8f5fvdo.fsf@aminb.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1545501060 19459 195.159.176.226 (22 Dec 2018 17:51:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 22 Dec 2018 17:51:00 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 22 18:50:56 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1galQN-0004xb-Gk for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Dec 2018 18:50:55 +0100 Original-Received: from localhost ([::1]:45181 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1galSU-00013Q-9a for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Dec 2018 12:53:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1galRr-000134-4k for help-gnu-emacs@gnu.org; Sat, 22 Dec 2018 12:52:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1galRp-0007Im-3n for help-gnu-emacs@gnu.org; Sat, 22 Dec 2018 12:52:27 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1galRX-00071a-V6; Sat, 22 Dec 2018 12:52:09 -0500 Original-Received: from [2607:fea8:3ba0:f85::5] (port=51052 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1galRX-0001pW-P1; Sat, 22 Dec 2018 12:52:07 -0500 In-Reply-To: (Stefan Monnier's message of "Sat, 22 Dec 2018 11:49:01 -0500") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:119021 Archived-At: On 2018-12-22 11:49 AM, Stefan Monnier wrote: > > Yes: the two replacements suggested by the warning. > Thanks for the reply, Stefan. I had already tried both, but for some reason I could not get it to work. I gave it another shot, and it seems like I got it right this time around. For future reference, here=E2=80=99s what I ended up with in my config: #+begin_src emacs-lisp (defun amin--compilation-finish-function (buffer outstr) (unless (string-match "finished" outstr) (switch-to-buffer-other-window buffer)) t) (setq compilation-finish-functions #'amin--compilation-finish-function) (require 'cl-macs) (defadvice compilation-start (around inhibit-display (command &optional mode name-function highlight-regexp)) (if (not (string-match "^\\(find\\|grep\\)" command)) (cl-letf (((symbol-function 'display-buffer) #'ignore) ((symbol-function 'set-window-point) #'ignore) ((symbol-function 'goto-char) #'ignore)) (save-window-excursion ad-do-it)) ad-do-it)) (ad-activate 'compilation-start) #+end_src Best, amin