unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: martin rudalics <rudalics@gmx.at>
Cc: 51062@debbugs.gnu.org
Subject: bug#51062: Customizable window resizing
Date: Wed, 13 Oct 2021 21:46:58 +0300	[thread overview]
Message-ID: <871r4oahjx.fsf@mail.linkov.net> (raw)
In-Reply-To: <63433373-a57b-a68a-8ccc-6d4a9192d9a4@gmx.at> (martin rudalics's message of "Wed, 13 Oct 2021 10:36:27 +0200")

>> There are two ways how window resizing is currently hard-coded:
>>
>> 1. As discussed in
>>     https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg01627.html
>>     when temp-buffer-resize-mode is enabled, it's impossible
>>     to disable automatic window resizing of the Help buffer.
>>
>>     Thanks to Martin, the patch in
>>     https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg01873.html
>>     allows customization when display-buffer-alist contains
>>     (window-height . nil)
>
> That patch should help wherever 'temp-buffer-resize-mode' applies, not
> just in a Help buffer.
>
> This patch has been meanwhile applied on master.

Strange, when I tested the patch that you sent to emacs-devel,
it worked correctly.  But after you applied the patch on master,
it doesn't work.  I'm trying to debug why (window-height . nil)
has no effect on Help buffers.

>> 2. As discussed in bug#45688, such commands as vc-log
>
> Which command is 'vc-log'?

I meant log-related vc-commands that use
shrink-window-if-larger-than-buffer, i.e.
all commands that use vc-log-internal-common.

>>     , vc-diff
>>     automatically resize the window, and the problem is that currently
>>     shrink-window-if-larger-than-buffer is used in these commands by default,
>>     but this behavior is hard-coded and can't be disabled by customization.
>>     A solution is to create a new hook like 'after-display-buffer-function'
>>     that by default will contain 'shrink-window-if-larger-than-buffer'.
>
> Wherever we currently use an idiom like
>
> (pop-to-buffer (current-buffer))
> (goto-char (point-min))
> (shrink-window-if-larger-than-buffer)
>
> we should use
>
> (pop-to-buffer
>  (current-buffer)
>  '(nil (window-height . shrink-window-if-larger-than-buffer)))
> (goto-char (point-min))
>
> instead.  But if 'display-buffer' is not involved, there isn't much we
> can do.  Maybe something like 'display-buffer-same-window' _after_
> putting the buffer into the selected window, but this might not be 100%
> compatible.  Certainly not for Emacs 28.

This is a good idea to try.  But not sure how this is possible to use in
vc-run-delayed that is called when the buffer was already displayed long ago.





  reply	other threads:[~2021-10-13 18:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-06 17:31 bug#51062: Customizable window resizing Juri Linkov
2021-10-07  9:08 ` martin rudalics
2021-10-13  8:36 ` martin rudalics
2021-10-13 18:46   ` Juri Linkov [this message]
2021-10-14  9:13     ` martin rudalics
2021-10-14 16:01       ` Juri Linkov
2021-10-14 17:01         ` martin rudalics
2021-10-14 17:14           ` Juri Linkov
2021-10-14 17:47             ` martin rudalics
2021-10-18 16:10             ` Juri Linkov
2021-10-18 17:44               ` martin rudalics
2021-10-19  6:54                 ` Juri Linkov
2021-12-29 17:27                 ` Juri Linkov
2021-12-29 19:12                   ` bug#51062: [External] : " Drew Adams
2021-12-31  9:12                   ` martin rudalics
2021-12-31 15:55                     ` bug#51062: [External] : " Drew Adams
2022-01-04  8:33                     ` Juri Linkov
2022-01-04 10:27                       ` martin rudalics
2022-01-11 17:35                         ` Juri Linkov

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=871r4oahjx.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=51062@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 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).