unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 45688@debbugs.gnu.org
Subject: bug#45688: 28.0.50; New action for display-buffer?
Date: Tue, 12 Jan 2021 10:06:45 +0100	[thread overview]
Message-ID: <568151d0-c8fd-1643-56a7-87ff36ce234d@gmx.at> (raw)
In-Reply-To: <87im83cn02.fsf@gnus.org>

 > This fixes the reproducer, but not the case of actually jumping around
 > manually -- `M-x display-buffer' sometimes chooses to resize the
 > windows.  :-/

Have you ever read the Elisp manual where it says

      ‘display-buffer’ is not overly well suited for displaying several
      buffers in sequence and making sure that all these buffers are
      shown orderly in the resulting window configuration.  Again, the
      standard action functions ‘display-buffer-pop-up-window’ and
      ‘display-buffer-use-some-window’ are not very suited for this
      purpose due to their somewhat chaotic nature in more complex
      configurations.

Maybe you bumped into this with your experiments, in particular when
trying to reuse a window that you've already used before.

'display-buffer' still lives in the paradigm of <= 2 windows frames set
up in the past century and probably still the only reasonable one for
TTY frames.  For that it supports things like 'even-window-heights' and
a 'split-height-threshold' of 80 with its "If, however, a window is the
only window on its frame, or all the other ones are dedicated,
‘split-window-sensibly’ may split it vertically disregarding the value
of this variable." exception.  Hence a first step to get your rampages
produce more reasonable results might be to ask whether that paradigm is
still a valid one.

If we don't want to do that, we can try to do some cosmetics in the size
restoring mechanism.  Basically, that mechanism is used when you display
a temporary buffer in a two windows layout and you have
'temp-buffer-resize-mode' enabled.  Suppose with emacs -Q you enable
that mode and type C-h f push RET and then C-x 4 f to find some file.
This will re-enlarge the window used for showing the 'push' help to its
prior size so you get what you intend for showing that file.

If we want 'display-buffer-use-some-window' to not do such size
restorations, we can just add a 'do-no-restore-size' alist entry and an
appropriate check like

       (when (and (not (cdr (assq 'do-no-restore-size alist)))
                  (listp quad)
                  (integerp (nth 3 quad))
                  (> (nth 3 quad) (window-total-height window)))

'display-buffer-use-least-recent-window' (and/or the application/user)
could then set that entry at their like.

 > In related news, get-lru-window doesn't seem to work reliably?  I don't
 > have a reproducer for that, either, but it seems to happen if I have a
 > three window frame, and I call:
 >
 > (setq lru (get-lru-window (selected-frame) nil t))
 > (window-bump-use-time lru)
 > (get-lru-window (selected-frame) nil t)
 >
 > will then return the same window as `lru'...

How do you "call"?  I suppose there's no chance to make another window
but the selected one the mru one.  We would have to look into the inner
workings of that "call".

martin






  reply	other threads:[~2021-01-12  9:06 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 12:02 bug#45688: 28.0.50; New action for display-buffer? Lars Ingebrigtsen
2021-01-06 13:36 ` martin rudalics
2021-01-06 14:09   ` Lars Ingebrigtsen
2021-01-06 15:52     ` martin rudalics
2021-01-07 11:45       ` Lars Ingebrigtsen
2021-01-07 13:18         ` martin rudalics
2021-01-07 14:47           ` Lars Ingebrigtsen
2021-01-07 15:17             ` martin rudalics
2021-01-07 15:35             ` martin rudalics
2021-01-07 15:49               ` Lars Ingebrigtsen
2021-01-07 16:54                 ` martin rudalics
2021-01-06 15:45 ` Eli Zaretskii
2021-01-06 17:20   ` Lars Ingebrigtsen
2021-01-06 18:17     ` Eli Zaretskii
2021-01-07 11:40       ` Lars Ingebrigtsen
2021-01-07 13:17         ` martin rudalics
2021-01-07 15:39           ` Lars Ingebrigtsen
2021-01-07 16:54             ` martin rudalics
2021-01-10 11:24               ` Lars Ingebrigtsen
2021-01-10 16:05                 ` martin rudalics
2021-01-10 16:14                   ` martin rudalics
2021-01-11 14:43                     ` Lars Ingebrigtsen
2021-01-11 18:23                       ` martin rudalics
2021-01-11 18:55                         ` martin rudalics
2021-01-19  3:20                           ` Lars Ingebrigtsen
2021-01-11 19:05                         ` Lars Ingebrigtsen
2021-01-12  9:06                           ` martin rudalics [this message]
2021-01-19  3:26                             ` Lars Ingebrigtsen
2021-01-20  8:08                               ` martin rudalics
2021-01-20 16:34                                 ` Lars Ingebrigtsen
2021-01-20 17:11                                   ` martin rudalics
2021-01-19 17:50                             ` Juri Linkov
2021-01-20  8:09                               ` martin rudalics
2021-01-20 21:45                                 ` Juri Linkov
2021-01-25 19:03                                   ` martin rudalics
2021-01-25 20:08                                     ` Juri Linkov
2021-01-26 15:57                                       ` martin rudalics
2021-01-27  9:38                                         ` Juri Linkov
2021-01-28  9:40                                           ` martin rudalics
2021-10-03 18:12                                         ` Juri Linkov
2021-10-04  8:28                                           ` martin rudalics
2021-10-04 17:31                                             ` Juri Linkov
2021-10-05  6:43                                               ` Lars Ingebrigtsen
2021-10-05  8:10                                               ` martin rudalics
2021-10-05 16:49                                                 ` Juri Linkov
2021-10-06  7:41                                                   ` martin rudalics
2021-10-06 17:45                                               ` Juri Linkov
2021-10-13  8:36                                                 ` martin rudalics
2021-01-11 14:45                   ` Lars Ingebrigtsen
2021-01-07 18:43         ` Juri Linkov
2021-01-08  8:31           ` martin rudalics
2021-01-10 11:26             ` Lars Ingebrigtsen
2021-01-12 18:36               ` Juri Linkov
2021-01-19 17:52                 ` Juri Linkov
2021-01-25 20:10                   ` Juri Linkov
2021-01-26 15:57                     ` martin rudalics
2021-01-27  9:35                       ` Juri Linkov
2021-01-28  9:40                         ` martin rudalics
2021-01-28 18:46                           ` Juri Linkov
2021-01-29  7:51                             ` martin rudalics
2021-01-06 17:41 ` Juri Linkov
2021-01-06 18:28   ` Drew Adams
2021-01-06 18:47   ` martin rudalics

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=568151d0-c8fd-1643-56a7-87ff36ce234d@gmx.at \
    --to=rudalics@gmx.at \
    --cc=45688@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).