unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* patch: customize window resize behavior of *vc-diff* window
@ 2002-09-12 16:23 Alan Salewski
  0 siblings, 0 replies; only message in thread
From: Alan Salewski @ 2002-09-12 16:23 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 3224 bytes --]

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

[-- Attachment #2: vc.el.patch --]
[-- Type: text/plain, Size: 648 bytes --]

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)
> \f
1795c1805,1806
< 		      (shrink-window-if-larger-than-buffer)))
---
> 		      (and vc-diff-do-shrink-window-if-larger-than-buff
> 			   (shrink-window-if-larger-than-buffer))))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-09-12 16:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-12 16:23 patch: customize window resize behavior of *vc-diff* window Alan Salewski

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).