From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?B?Tm9yZGz2dw==?= Newsgroups: gmane.emacs.help Subject: Re: Shrinking grep/compile window to fit contents of buffer Date: Tue, 13 Nov 2007 02:06:10 -0800 Organization: http://groups.google.com Message-ID: <1194948370.123761.38960@57g2000hsv.googlegroups.com> References: <1194941921.778084.96870@v3g2000hsg.googlegroups.com> <1194946738.067410.88880@o80g2000hse.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1194950462 23931 80.91.229.12 (13 Nov 2007 10:41:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Nov 2007 10:41:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 13 11:41:07 2007 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 1IrtCY-0002No-2F for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Nov 2007 11:41:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IrtCL-0001g9-Mz for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Nov 2007 05:40:49 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!57g2000hsv.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-NNTP-Posting-Host: 150.227.15.253 Original-X-Trace: posting.google.com 1194948370 391 127.0.0.1 (13 Nov 2007 10:06:10 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 13 Nov 2007 10:06:10 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.7) Gecko/20070923 Firefox/2.0.0.7 (Swiftfox),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 netcache (NetCache NetApp/6.1.1RC1) Complaints-To: groups-abuse@google.com Injection-Info: 57g2000hsv.googlegroups.com; posting-host=150.227.15.253; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Original-Xref: shelby.stanford.edu gnu.emacs.help:153760 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:49207 Archived-At: Great! Thanks! Here is the code that solves my problem: ;;; --------------------------------------------------------------------------- ;; Compilation Autoshrink (defun shrink-compilation-window-if-larger-than-buffer (buf str) (shrink-window-if-larger-than-buffer (get-buffer-window buf)) ) (defcustom compilation-window-shrink-to-fit t "Define to non-nil to make compilation/grep-window shrink to fit its contents.") (if compilation-window-shrink-to-fit (progn (add-hook 'compilation-finish-functions 'shrink-compilation-window-if-larger-than-buffer) (setq compilation-window-height nil) (setq grep-window-height nil) ) (progn ;; set to a specific height or nil if we use half of buffer height (setq compilation-window-height 10) (setq grep-window-height 20) )) /Nordl=F6w