From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alan Salewski Newsgroups: gmane.emacs.bugs Subject: patch: customize window resize behavior of *vc-diff* window Date: Thu, 12 Sep 2002 12:23:30 -0400 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <20020912162330.GC2218@ig88.charlesjones.com> Reply-To: alans@charlesjones.com NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="yrj/dFKFPuw6o+aM" X-Trace: main.gmane.org 1031847724 20541 127.0.0.1 (12 Sep 2002 16:22:04 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 12 Sep 2002 16:22:04 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17pWj9-0005Kp-00 for ; Thu, 12 Sep 2002 18:21:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17pWjK-00073G-00; Thu, 12 Sep 2002 12:22:10 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17pWil-00071z-00 for bug-gnu-emacs@gnu.org; Thu, 12 Sep 2002 12:21:35 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17pWie-00071k-00 for bug-gnu-emacs@gnu.org; Thu, 12 Sep 2002 12:21:34 -0400 Original-Received: from popmail.charlesjones.com ([12.3.71.165] helo=mail1.charlesjones.com) by monty-python.gnu.org with esmtp (Exim 4.10) id 17pWid-00071g-00 for bug-gnu-emacs@gnu.org; Thu, 12 Sep 2002 12:21:27 -0400 Original-Received: from ig88.charlesjones.com ([172.17.160.183]) by mail1.charlesjones.com (8.11.0/8.11.0) with ESMTP id g8CGKfK26694 for ; Thu, 12 Sep 2002 12:20:41 -0400 Original-Received: from alans by ig88.charlesjones.com with local (Exim 3.35 #1 (Debian)) id 17pWkc-0000p4-00 for ; Thu, 12 Sep 2002 12:23:30 -0400 Original-To: bug-gnu-emacs@gnu.org Content-Disposition: inline User-Agent: Mutt/1.3.28i Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:3497 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:3497 --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I've attached a very simple patch for vc.el, made against the version distributed as part of emacs 21.2. The Id tag at the top of the vc.el file is: ;; $Id: vc.el,v 1.311.4.5 2002/03/05 13:41:05 spiegel Exp $ The patch creates a variable that is customizable by the user for controlling the resizing behavior of the window that contains the *vc-diff* buffer. Motivation: I work with multiple windows visible in a single emacs frame; some of the windows are marked as 'dedicated' using `set-window-dedicated-p', and are sized to be visible, but mostly out of the way: +---------------------------------------------------------+ | | | | | | | | | | | | | | | | | | | | | | | | | *vc-diff* | some source file | | or | | | some source file | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-----------------------------+ | | *Completions* (dedicated) | | | | | +-----------------------------+---------------------------+ | | | *shell* (dedicated) | | | +---------------------------------------------------------+ With the above configuration, I do not want the size of the windows to change because I want as much viewing area as possible for the source windows. However, with the existing behavior, running `vc-diff' on the source file on the top right may cause the *vc-diff* buffer to shrink (sometimes quite a bit). This means that when I switch buffers from *vc-diff* to some other source file in the window on the top left, I need to resize the window to make it larger. The attached patch simply allows the user to turn off this resizing, but preserves the original behavior by default. Please consider including this patch as part of the main vc.el distribution. Thanks, -Al -- Alan D. Salewski, Programmer Charles Jones, LLC e-mail: alans@charlesjones.com voice: (609) 538-1000 x5512 --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="vc.el.patch" 613a614,623 > (defcustom vc-diff-do-shrink-window-if-larger-than-buff t > "*This variable controls the resizing behavior of the > window that contains the `*vc-diff*' buffer. If non-nil, then > the window will shrink to occupy only the required buffer space > if the contents of the buffer are less than the size of the > window. If nil, then the size of the window will not change to > reflect the size of the buffer contents." > :type 'boolean > :group 'vc) > 1795c1805,1806 < (shrink-window-if-larger-than-buffer))) --- > (and vc-diff-do-shrink-window-if-larger-than-buff > (shrink-window-if-larger-than-buffer)))) --yrj/dFKFPuw6o+aM--