From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: harven Newsgroups: gmane.emacs.help Subject: Re: kill buffer in other window Date: Thu, 24 Apr 2008 05:47:01 -0700 (PDT) Organization: http://groups.google.com Message-ID: <30697245-4f06-4e56-9bf5-c758fb2c7ca0@f36g2000hsa.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1209044453 22560 80.91.229.12 (24 Apr 2008 13:40:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Apr 2008 13:40:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 24 15:41:29 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jp1hT-0001JQ-5i for geh-help-gnu-emacs@m.gmane.org; Thu, 24 Apr 2008 15:41:23 +0200 Original-Received: from localhost ([127.0.0.1]:53765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jp1gn-0007PX-4w for geh-help-gnu-emacs@m.gmane.org; Thu, 24 Apr 2008 09:40:41 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!f36g2000hsa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 50 Original-NNTP-Posting-Host: 82.240.200.149 Original-X-Trace: posting.google.com 1209041221 26534 127.0.0.1 (24 Apr 2008 12:47:01 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 24 Apr 2008 12:47:01 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f36g2000hsa.googlegroups.com; posting-host=82.240.200.149; posting-account=hanW0AoAAADuR-PIr5jGeb298Y3jGR7p User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:158147 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:53511 Archived-At: On Mar 3, 9:45 pm, Florian Kaufmann wrote: > Hello > > Say you called something that displays a new buffer in the 'other > window', e.g. describe-function, grep. When you done reading that > buffer, you want to undo the displaying. That is kill the buffer, and > delete the window if one was created. I din't found yet a convenient > way to do it. Of course I can write a small lisp function, but I think > there are other cool ways. > > Greetings > > Flo Here is a short code snippet which gets ride of a hanging compilation window if compilation was successful. Taken from some .emacs file found on the wiki. ;; I also don't like that the compilation window sticks around after a ;; successful compile. After all, most of the time, all I care about ;; is that the compile completed cleanly. Here's how I make the ;; compilation window go away, only if there was no compilation ;; errors: (setq compilation-finish-function (lambda (buf str) (if (string-match "exited abnormally" str) ;; there were errors (message "compilation errors, press C-x ` to visit") ;; no errors, make compilation window go away in 0.5 sec (run-at-time 0.5 nil 'delete-windows-on buf) (message "NO COMPILATION ERRORS!")))) I use something similar to get rid of a hanging help window when compiling successfully a tex file using auctex. (defadvice TeX-command-master (after kill-Help-window) (if (and TeX-error-report-switches (plist-get TeX-error-report-switches (intern (plist-get TeX-error-report-switches 'TeX-current- master)))) (TeX-next-error 1) (when (get-buffer "*TeX Help*") (set-buffer "*TeX Help*") (kill-buffer-and-window)))) (ad-activate 'TeX-command-master) (setq TeX-process-asynchronous nil) Hope this helps.