* bug#25169: 26.0.50; display-buffer doesn't set window width correctly
@ 2016-12-11 12:18 Liu Hui
2016-12-11 16:19 ` martin rudalics
0 siblings, 1 reply; 4+ messages in thread
From: Liu Hui @ 2016-12-11 12:18 UTC (permalink / raw)
To: 25169
Recipe 1:
1. Emacs -Q
2. evaluate the following code in *scratch*:
(display-buffer (get-buffer-create "aaa")
'(display-buffer-pop-up-window
(window-width . 20)))
;; => correct window width for buffer "aaa"
(display-buffer (get-buffer-create "bbb")
'(display-buffer-pop-up-window
(window-width . 20)))
;; => changed and larger window width for buffer "bbb"
Recipe 2:
1. Emacs -Q
2. evaluate the following code in *scratch*:
(display-buffer (get-buffer-create "aaa")
'(display-buffer-in-side-window
(window-width . 20)
(side . right)))
;; => correct window width for buffer "aaa"
(display-buffer (get-buffer-create "bbb")
'(display-buffer-in-side-window
(window-width . 20)
(side . left)))
;; => correct width for buffer "bbb", but the window width of
;; buffer "aaa" is changed and becomes larger
In GNU Emacs 26.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
of 2016-12-10 built on lgw01-57
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description: Ubuntu 16.04.1 LTS
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#25169: 26.0.50; display-buffer doesn't set window width correctly
2016-12-11 12:18 bug#25169: 26.0.50; display-buffer doesn't set window width correctly Liu Hui
@ 2016-12-11 16:19 ` martin rudalics
2016-12-12 4:53 ` Liu Hui
0 siblings, 1 reply; 4+ messages in thread
From: martin rudalics @ 2016-12-11 16:19 UTC (permalink / raw)
To: Liu Hui, 25169
[-- Attachment #1: Type: text/plain, Size: 2177 bytes --]
Thanks for the report.
> Recipe 1:
>
> 1. Emacs -Q
> 2. evaluate the following code in *scratch*:
>
> (display-buffer (get-buffer-create "aaa")
> '(display-buffer-pop-up-window
> (window-width . 20)))
> ;; => correct window width for buffer "aaa"
>
> (display-buffer (get-buffer-create "bbb")
> '(display-buffer-pop-up-window
> (window-width . 20)))
> ;; => changed and larger window width for buffer "bbb"
Recipe 1 is difficult to reproduce here. I made my initial frame 169
columns wide to get a side-by-side split when displaying aaa and to
_not_ get another side-by-side split when displaying bbb. What happens
is that ‘display-buffer-pop-up-window’ refuses to make a new window for
bbb (you can reduce the value of ‘split-width-threshold’ to get a split)
so ‘display-buffer’ rather uses aaa's window to display bbb via
‘display-buffer-use-some-window’. The latter ignores the ‘window-width’
entry but applies ‘window--even-window-sizes’ instead.
So this is not a bug but admittedly a very confusing sequence of events.
> Recipe 2:
>
> 1. Emacs -Q
> 2. evaluate the following code in *scratch*:
>
> (display-buffer (get-buffer-create "aaa")
> '(display-buffer-in-side-window
> (window-width . 20)
> (side . right)))
> ;; => correct window width for buffer "aaa"
>
> (display-buffer (get-buffer-create "bbb")
> '(display-buffer-in-side-window
> (window-width . 20)
> (side . left)))
> ;; => correct width for buffer "bbb", but the window width of
> ;; buffer "aaa" is changed and becomes larger
This is a bug and I attached a fix for it. Please try it.
Note, however, that in general you can rely on Emacs to preserve the
size of a window like that of aaa in recipe 2 if and only if you run
‘window-preserve-size’ on that window - either explicitly or via a
`preserve-size' argument.
martin
(BTW: Does the ibuffer scenario from bug#25115 work orderly now?)
[-- Attachment #2: window.el.diff --]
[-- Type: text/plain, Size: 898 bytes --]
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -2797,7 +2797,7 @@ window-resize
window delta horizontal ignore nil nil nil t)))
(window--resize-reset frame horizontal)
(window--resize-this-window window delta horizontal ignore t)
- (if (and (not window-combination-resize)
+ (if (and (not (eq window-combination-resize t))
(window-combined-p window horizontal)
(setq sibling (or (window-right window) (window-left window)))
(window-sizable-p
@@ -4049,7 +4049,7 @@ delete-window
(sibling (or (window-left window) (window-right window))))
(window--resize-reset frame horizontal)
(cond
- ((and (not window-combination-resize)
+ ((and (not (eq window-combination-resize t))
sibling (window-sizable-p sibling size horizontal nil t))
;; Resize WINDOW's sibling.
(window--resize-this-window sibling size horizontal nil t)
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#25169: 26.0.50; display-buffer doesn't set window width correctly
2016-12-11 16:19 ` martin rudalics
@ 2016-12-12 4:53 ` Liu Hui
2016-12-12 10:00 ` martin rudalics
0 siblings, 1 reply; 4+ messages in thread
From: Liu Hui @ 2016-12-12 4:53 UTC (permalink / raw)
To: martin rudalics; +Cc: 25169
> Recipe 1 is difficult to reproduce here. I made my initial frame 169
> columns wide to get a side-by-side split when displaying aaa and to
> _not_ get another side-by-side split when displaying bbb. What happens
> is that ‘display-buffer-pop-up-window’ refuses to make a new window for
> bbb (you can reduce the value of ‘split-width-threshold’ to get a split)
> so ‘display-buffer’ rather uses aaa's window to display bbb via
> ‘display-buffer-use-some-window’. The latter ignores the ‘window-width’
> entry but applies ‘window--even-window-sizes’ instead.
>
> So this is not a bug but admittedly a very confusing sequence of events.
I see. Thanks for the explanation.
> This is a bug and I attached a fix for it. Please try it.
>
> Note, however, that in general you can rely on Emacs to preserve the
> size of a window like that of aaa in recipe 2 if and only if you run
> ‘window-preserve-size’ on that window - either explicitly or via a
> `preserve-size' argument.
The problem is fixed. Thanks again!
> (BTW: Does the ibuffer scenario from bug#25115 work orderly now?)
Yes, and I'll add some information in that thread.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-12-12 10:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-11 12:18 bug#25169: 26.0.50; display-buffer doesn't set window width correctly Liu Hui
2016-12-11 16:19 ` martin rudalics
2016-12-12 4:53 ` Liu Hui
2016-12-12 10:00 ` martin rudalics
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.