GNU bug report logs -
#76911
dedicated side windows lose their dedication upon reuse
Previous Next
To reply to this bug, email your comments to 76911 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76911
; Package
emacs
.
(Mon, 10 Mar 2025 08:00:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Daniel Colascione <dancol <at> dancol.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 10 Mar 2025 08:00:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Consider the code below:
(let ((b1 (get-buffer-create "*b1*"))
(b2 (get-buffer-create "*b2*"))
(action '(display-buffer-in-side-window
(dedicated . t)
(side . left))))
(display-buffer b1 action)
(sit-for 1)
(display-buffer b2 action))
It puts b1 in a side window, then reuses that side window for b2.
When we display b2, the window loses the strong dedication it had to b1
despite the display action for b2 including a request for a
dedicated window.
I'd expect the window to be dedicated to b2 at the end of the
above snippet.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76911
; Package
emacs
.
(Mon, 10 Mar 2025 16:38:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 76911 <at> debbugs.gnu.org (full text, mbox):
> From: Daniel Colascione <dancol <at> dancol.org>
> Date: Mon, 10 Mar 2025 00:58:53 -0700
>
>
> Consider the code below:
>
> (let ((b1 (get-buffer-create "*b1*"))
> (b2 (get-buffer-create "*b2*"))
> (action '(display-buffer-in-side-window
> (dedicated . t)
> (side . left))))
> (display-buffer b1 action)
> (sit-for 1)
> (display-buffer b2 action))
>
> It puts b1 in a side window, then reuses that side window for b2.
> When we display b2, the window loses the strong dedication it had to b1
> despite the display action for b2 including a request for a
> dedicated window.
>
> I'd expect the window to be dedicated to b2 at the end of the
> above snippet.
Martin, any comments?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76911
; Package
emacs
.
(Mon, 10 Mar 2025 17:49:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 76911 <at> debbugs.gnu.org (full text, mbox):
>> Consider the code below:
>>
>> (let ((b1 (get-buffer-create "*b1*"))
>> (b2 (get-buffer-create "*b2*"))
>> (action '(display-buffer-in-side-window
>> (dedicated . t)
>> (side . left))))
>> (display-buffer b1 action)
>> (sit-for 1)
>> (display-buffer b2 action))
>>
>> It puts b1 in a side window, then reuses that side window for b2.
>> When we display b2, the window loses the strong dedication it had to b1
>> despite the display action for b2 including a request for a
>> dedicated window.
>>
>> I'd expect the window to be dedicated to b2 at the end of the
>> above snippet.
>
> Martin, any comments?
The following emacs -Q example shows what may happen then:
(let* ((b1 (get-buffer-create "*b1*"))
(b2 (get-buffer-create "*b2*"))
(b3 (get-buffer-create "*b3*"))
(action '(display-buffer-in-side-window
(dedicated . t)
(side . left)))
(window (display-buffer b1 action)))
(message "%s" (window-dedicated-p window))
(sit-for 3)
(display-buffer b2 action)
(message "%s" (window-dedicated-p window))
(sit-for 3)
(display-buffer b3 t))
*b3* is shown in the side window although this is reserved for buffers
displayed via 'display-buffer-in-side-window'.
I checked in a fix. Please try again.
Thanks for the report, martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76911
; Package
emacs
.
(Mon, 17 Mar 2025 02:26:03 GMT)
Full text and
rfc822 format available.
Message #14 received at 76911 <at> debbugs.gnu.org (full text, mbox):
martin rudalics <rudalics <at> gmx.at> writes:
>>> Consider the code below:
>>>
>>> (let ((b1 (get-buffer-create "*b1*"))
>>> (b2 (get-buffer-create "*b2*"))
>>> (action '(display-buffer-in-side-window
>>> (dedicated . t)
>>> (side . left))))
>>> (display-buffer b1 action)
>>> (sit-for 1)
>>> (display-buffer b2 action))
>>>
>>> It puts b1 in a side window, then reuses that side window for b2.
>>> When we display b2, the window loses the strong dedication it had to b1
>>> despite the display action for b2 including a request for a
>>> dedicated window.
>>>
>>> I'd expect the window to be dedicated to b2 at the end of the
>>> above snippet.
>>
>> Martin, any comments?
>
> The following emacs -Q example shows what may happen then:
>
> (let* ((b1 (get-buffer-create "*b1*"))
> (b2 (get-buffer-create "*b2*"))
> (b3 (get-buffer-create "*b3*"))
> (action '(display-buffer-in-side-window
> (dedicated . t)
> (side . left)))
> (window (display-buffer b1 action)))
> (message "%s" (window-dedicated-p window))
> (sit-for 3)
> (display-buffer b2 action)
> (message "%s" (window-dedicated-p window))
> (sit-for 3)
> (display-buffer b3 t))
>
> *b3* is shown in the side window although this is reserved for buffers
> displayed via 'display-buffer-in-side-window'.
>
> I checked in a fix. Please try again.
>
> Thanks for the report, martin
Thanks for the fix. The original bug is gone. I've noticed a few times
buffers being in side windows I didn't intend to have, but I haven't
been able to find a repro. Probably an unrelated bug. We should
probably visually style side windows differently by default.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76911
; Package
emacs
.
(Mon, 17 Mar 2025 08:59:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 76911 <at> debbugs.gnu.org (full text, mbox):
> Thanks for the fix. The original bug is gone. I've noticed a few times
> buffers being in side windows I didn't intend to have, but I haven't
> been able to find a repro. Probably an unrelated bug.
You could try without passing (dedicated . t) as alist element. The
manual says
The dedicated flag (*note Dedicated Windows::) has a slightly
different meaning for side windows. When a side window is
created, that flag is set to the value ‘side’ to prevent
‘display-buffer’ to use the window in other action functions.
Its value persists across invocations of ‘quit-window’,
‘kill-buffer’, ‘previous-buffer’ and ‘next-buffer’.
So a dedicated flag that does not equal 'side' might cause the problem
here. If it persists, I can write some code for 'display-buffer' so we
can find the offender.
> We should
> probably visually style side windows differently by default.
We could try to paint the window dividers accordingly.
martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76911
; Package
emacs
.
(Mon, 17 Mar 2025 21:47:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 76911 <at> debbugs.gnu.org (full text, mbox):
On March 17, 2025 4:58:01 AM EDT, martin rudalics <rudalics <at> gmx.at> wrote:
>> Thanks for the fix. The original bug is gone. I've noticed a few times
>> buffers being in side windows I didn't intend to have, but I haven't
>> been able to find a repro. Probably an unrelated bug.
>
>You could try without passing (dedicated . t) as alist element. The
>manual says
>
> The dedicated flag (*note Dedicated Windows::) has a slightly
> different meaning for side windows. When a side window is
> created, that flag is set to the value ‘side’ to prevent
> ‘display-buffer’ to use the window in other action functions.
> Its value persists across invocations of ‘quit-window’,
> ‘kill-buffer’, ‘previous-buffer’ and ‘next-buffer’.
>
>So a dedicated flag that does not equal 'side' might cause the problem
>here. If it persists, I can write some code for 'display-buffer' so we
>can find the offender.
But I want the strong dedication semantics. Specifically, I'm looking for something like an omnipresent always available panel I can summon and dismiss any time with a simple keybinding. I also have facilities for cycling its size and extracting the omnipresent thing into a conventional window temporarily. I want not only strong dedication, but also no-other-window and no-delete-other-windows, which I set. Modulo bugs, it all seems to work.
For finding those bugs, maybe we need a history of recent window changes we can examine after something has gone wrong. Just today I got into a weird state in which I had two side windows with the same slot and have no idea how I got into that state or how I'd repro.
>
>> We should
>> probably visually style side windows differently by default.
>
>We could try to paint the window dividers accordingly.
>
Fringe arrows or something? Not sure what it should look like. I'm a programmer, not an artist. :-)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76911
; Package
emacs
.
(Tue, 18 Mar 2025 09:03:03 GMT)
Full text and
rfc822 format available.
Message #23 received at 76911 <at> debbugs.gnu.org (full text, mbox):
>> So a dedicated flag that does not equal 'side' might cause the problem
>> here. If it persists, I can write some code for 'display-buffer' so we
>> can find the offender.
>
> But I want the strong dedication semantics. Specifically, I'm looking
> for something like an omnipresent always available panel I can summon
> and dismiss any time with a simple keybinding. I also have facilities
> for cycling its size and extracting the omnipresent thing into a
> conventional window temporarily. I want not only strong dedication,
> but also no-other-window and no-delete-other-windows, which I
> set. Modulo bugs, it all seems to work.
You might be asking a bit too much here: The side windows mechanism does
its own handling of dedicatedness which means that if you specify
'display-buffer-in-side-window' for a buffer-2 and the window at that
slot is strongly dedicated to buffer-1, buffer-2 will be still displayed
in that window. There's no other way because I cannot display buffer-2
reasonably anywhere else.
BTW why do you set 'no-delete-other-windows' for a side window? You
cannot avoid an error when incidentally doing C-x 5 1 in it I suppose.
> For finding those bugs, maybe we need a history of recent window
> changes we can examine after something has gone wrong. Just today I
> got into a weird state in which I had two side windows with the same
> slot and have no idea how I got into that state or how I'd repro.
As a matter of fact, this should never happen. You could try running
Emacs with the patch below - it might help to detect such a situation.
martin
diff --git a/lisp/window.el b/lisp/window.el
index 1e8f4e323bc..dd7a463aa3b 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -7824,6 +7824,12 @@ window--display-buffer
(dolist (parameter parameters)
(set-window-parameter
window (car parameter) (cdr parameter)))))
+ (with-current-buffer (get-buffer-create "*display-buffer-history*")
+ (goto-char (point-max))
+ (insert (format " window: %s" window)
+ (format " [%s]" type)
+ (format " alist: %s" alist)
+ (format " parameters: %s\n" (window-parameters window))))
window))
(defun window--maybe-raise-frame (frame)
@@ -8220,6 +8226,9 @@ display-buffer
(split-window-keep-point t)
;; Handle the old form of the first argument.
(inhibit-same-window (and action (not (listp action)))))
+ (with-current-buffer (get-buffer-create "*display-buffer-history*")
+ (goto-char (point-max))
+ (insert (format "buffer: %s" buffer) (format " action: %s\n" action)))
(unless (listp action) (setq action nil))
(let* ((user-action
(display-buffer-assq-regexp
This bug report was last modified 25 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.