GNU bug report logs - #73627
29.3; window-main-window: Discrepancy between behaviour and docstring

Previous Next

Package: emacs;

Reported by: "Nussbaum Ferdinand" <ferdinand.nussbaum <at> inf.ethz.ch>

Date: Fri, 4 Oct 2024 15:44:01 UTC

Severity: normal

Found in version 29.3

Fixed in version 31.1

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: "Nussbaum  Ferdinand" <ferdinand.nussbaum <at> inf.ethz.ch>
Subject: bug#73627: closed (Re: bug#73627: 29.3; window-main-window:
 Discrepancy between behaviour and docstring)
Date: Sun, 20 Oct 2024 08:36:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#73627: 29.3; window-main-window: Discrepancy between behaviour and docstring

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 73627 <at> debbugs.gnu.org.

-- 
73627: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73627
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: ferdinand.nussbaum <at> inf.ethz.ch, 73627-done <at> debbugs.gnu.org
Subject: Re: bug#73627: 29.3; window-main-window: Discrepancy between
 behaviour and docstring
Date: Sun, 20 Oct 2024 10:34:47 +0200
Version: 31.1
> Installed on master.

Closing this bug, martin


[Message part 3 (message/rfc822, inline)]
From: "Nussbaum  Ferdinand" <ferdinand.nussbaum <at> inf.ethz.ch>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 29.3; window-main-window: Discrepancy between behaviour and docstring
Date: Fri, 4 Oct 2024 15:09:18 +0000
[Message part 4 (text/plain, inline)]
To reproduce from emacs -Q, evaluate in the scratch buffer:

(display-buffer-in-side-window
  (get-scratch-buffer-create)
  '((side . left)))
(split-window (frame-root-window) nil 'below)
(window-main-window)

Observe that (window-main-window) returns the selected window. However, the
window that was created by splitting below is not a side window, and it does not
descend from the selected window. This contradicts part of the docstring of
window-main-window:

"If FRAME has no side windows, return FRAME's root window. Otherwise, return
either an internal non-side window such that all other non-side windows on FRAME
descend from it, or the single live non-side window of FRAME."

Splitting a frame's root window in the presence of side windows seems to often
lead to such discrepancies. I have observed such behaviour in the packages hydra
(on ELPA, in its lv-window function), and shell-pop (from another package
archive).

Related to that: Is the following supposed to be an invariant for each frame,
and should it be considered a bug when packages violate it?

Invariant:
There exists a window MAIN such that for all live windows WIN (other than MAIN)
we have: WIN descends from MAIN if and only if it is not a side window.

This is something I assumed and was surprised to see violated.

Best,
Ferdinand

[Message part 5 (text/html, inline)]

This bug report was last modified 275 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.