all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: martin rudalics <rudalics@gmx.at>
Cc: 11810@debbugs.gnu.org
Subject: bug#11810: 24.1.50; `vc-diff' shrinks pre-existing window
Date: Fri, 06 Jul 2012 03:19:37 +0400	[thread overview]
Message-ID: <4FF62109.6000608@yandex.ru> (raw)
In-Reply-To: <4FF56410.7000705@gmx.at>

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

On 05.07.2012 13:53, martin rudalics wrote:
>  > I tried it with just my patch applied, and it didn't work, because in
>  > this case the stored height value was of already resized window:
>  > `display-buffer-record-window' is called from `window--display-buffer',
>  > and `display-buffer-use-some-window' calls `window--even-window-heights'
>  > before `window--display-buffer'.
>
> I think we could do
>
>      (when window
>        (prog1
>        (window--display-buffer buffer window 'reuse)
>        (window--even-window-heights window)))
>
> in `display-buffer-use-some-window'.

That should work, but IMO `even-window-heights' behavior is just too 
surprising (with its conditions on window positions), so, if you don't 
mind, I'll open another bug with proposal to change its default value, 
presenting the above as alternative.

>  > Until then, the issue is somewhat alleviated by the fact that you can
>  > press 'z' or 'C-x k' instead of 'q', and both of these won't trigger
>  > height restoration.
>
> I'm more concerned with the fact that an application might reuse the
> shrunk window via `display-buffer'.

In this case, unless the new buffer is the same as the one already 
displayed in the shrunk window, `display-buffer-record-window' will
overwrite the 'quit-restore parameter, so I don't see what the problem 
scenario would be. Hadn't managed to reproduce one either.

>  > If someone wants `shrink-window-if-...' to have no effect only in
>  > `vc-diff', well, that's a different goal.
>
> But that's probably what some people want.

I don't think we've seen a request exactly like that yet, but that would 
require a vc-prefixed variable.
Asynchronous `with-output-to-temp-buffer' proposal is better in that regard.

>  >> Let's close this thread as follows: Remove the
> `temp-buffer-resize-mode'
>  >> check in `quit-window' and add an integerp check for the third element.
>  >
>  > Agreed.
>
> Can you install it?  Else please post the patch and a ChangeLog entry.

Nope. Is unified diff okay?

window.el (quit-window): Always restore window height when it's saved in 
quit-restore parameter.

-- Dmitry

[-- Attachment #2: quit-window.diff --]
[-- Type: text/plain, Size: 719 bytes --]

diff --git a/lisp/window.el b/lisp/window.el
index b362f40..f9adf84 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -3069,9 +3069,8 @@ one.  If non-nil, reset `quit-restore' parameter to nil."
 	   (buffer-live-p (car quad))
 	   (eq (nth 3 quit-restore) buffer))
       ;; Show another buffer stored in quit-restore parameter.
-      (setq resize (with-current-buffer buffer
-		     (and temp-buffer-resize-mode
-			  (/= (nth 3 quad) (window-total-size window)))))
+      (setq resize (and (integerp (nth 3 quad))
+                        (/= (nth 3 quad) (window-total-size window))))
       (set-window-dedicated-p window nil)
       (when resize
 	;; Try to resize WINDOW to its old height but don't signal an

  reply	other threads:[~2012-07-05 23:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 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 [this message]
2012-07-06  6:36                                     ` martin rudalics
2012-07-06 12:25                                       ` Dmitry Gutov
2012-07-02 20:39                   ` Dmitry Gutov
2012-07-02 16:32                 ` martin rudalics
2012-07-02 13:33               ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FF62109.6000608@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=11810@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.