all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#11810: 24.1.50; `vc-diff' shrinks pre-existing window
@ 2012-06-28 19:22 Dmitry Gutov
  2012-06-28 22:32 ` Andreas Schwab
  2012-06-29  7:12 ` martin rudalics
  0 siblings, 2 replies; 28+ messages in thread
From: Dmitry Gutov @ 2012-06-28 19:22 UTC (permalink / raw)
  To: 11810

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

Steps to reproduce:

1) Have a frame with such width and height that when there are 4 equal
windows inside it, a `pop-to-window' invocation reuses an existing
window.

2) Start with just 1 window, do C-x 3, then C-x 2 in both resulting
windows.

3) Open a VC-backed file in one of the windows, make a tiny change,
save, do `vc-diff'. Diff will open in one of the existing windows, and
it will be shrunk to the height of the buffer.

4) Quit the diff buffer with `q'. See that the window height stays
shrunk.

In a similar scenario, open a file from a repository with tiny history
(1 commit or so), do `vc-print-log', observe the same behavior.
Thankfully, this is a much more rare occurrence.

Simple patch attached.

Commands messing up existing window configuration is one of my top
Emacs annoyances, and AFAIK it confuses the new users, too.
Maybe nil check for (window-prev-buffers) should be instead included in
`shrink-window-if-larger-than-buffer', with a way to override it?

[-- Attachment #2: 0001-vc.el-vc-diff-finish-vc-log-internal-common-Never-sh.patch --]
[-- Type: text/plain, Size: 1257 bytes --]

From e1f5971c81fabac74280f798802b7958a44db08c Mon Sep 17 00:00:00 2001
From: Dmitry Gutov <dgutov@yandex.ru>
Date: Thu, 28 Jun 2012 23:18:41 +0400
Subject: [PATCH] * vc.el (vc-diff-finish, vc-log-internal-common): Never
 shrink   pre-existing windows

---
 lisp/vc/vc.el |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 87e4e1c..697b212 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1531,7 +1531,7 @@ to override the value of `vc-diff-switches' and `diff-switches'."
 	       (message "%s" (cdr messages))))
 	(diff-setup-whitespace)
 	(goto-char (point-min))
-	(when window
+	(when (and window (not (window-prev-buffers)))
 	  (shrink-window-if-larger-than-buffer window)))
       (when (and messages (not emptyp))
 	(message "%sdone" (car messages))))))
@@ -2147,7 +2147,8 @@ Not all VC backends support short logs!")
     (vc-exec-after
      `(let ((inhibit-read-only t))
 	(funcall ',setup-buttons-func ',backend ',files ',retval)
-	(shrink-window-if-larger-than-buffer)
+	(unless (window-prev-buffers)
+	  (shrink-window-if-larger-than-buffer))
 	(funcall ',goto-location-func ',backend)
 	(setq vc-sentinel-movepoint (point))
 	(set-buffer-modified-p nil)))))
-- 
1.7.10.msysgit.1


^ permalink raw reply related	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2012-07-06 12:25 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-28 19:22 bug#11810: 24.1.50; `vc-diff' shrinks pre-existing window Dmitry Gutov
2012-06-28 22:32 ` Andreas Schwab
2012-06-28 22:45   ` Dmitry Gutov
2012-06-29  7:12     ` Andreas Schwab
2012-06-29  7:12 ` martin rudalics
2012-06-29 22:39   ` Dmitry Gutov
2012-06-30  9:09     ` martin rudalics
2012-06-30 21:34       ` Juanma Barranquero
2012-07-01  9:06         ` martin rudalics
2012-06-30 23:18       ` Dmitry Gutov
2012-07-01  9:06         ` martin rudalics
     [not found]           ` <4FF05DC0.4080609@yandex.ru>
2012-07-02  7:00             ` martin rudalics
2012-07-02 13:33               ` Dmitry Gutov
2012-07-02 13:33               ` Dmitry Gutov
2012-07-02 16:32                 ` martin rudalics
2012-07-02 16:32                 ` martin rudalics
2012-07-02 20:39                   ` Dmitry Gutov
2012-07-03  7:14                     ` martin rudalics
2012-07-03 12:48                       ` Dmitry Gutov
2012-07-03 16:40                         ` martin rudalics
2012-07-03 18:56                           ` Dmitry Gutov
2012-07-04  9:18                             ` martin rudalics
2012-07-04 16:12                               ` Dmitry Gutov
2012-07-05  9:53                                 ` martin rudalics
2012-07-05 23:19                                   ` Dmitry Gutov
2012-07-06  6:36                                     ` martin rudalics
2012-07-06 12:25                                       ` Dmitry Gutov
2012-07-02 20:39                   ` Dmitry Gutov

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.