GNU bug report logs - #56772
29.0.50; regexp-builder window is very tall when temp-buffer-resize-mode is enabled

Previous Next

Package: emacs;

Reported by: Daniel Martín <mardani29 <at> yahoo.es>

Date: Mon, 25 Jul 2022 23:21:01 UTC

Severity: minor

Tags: patch

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 56772 in the body.
You can then email your comments to 56772 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#56772; Package emacs. (Mon, 25 Jul 2022 23:21:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daniel Martín <mardani29 <at> yahoo.es>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 25 Jul 2022 23:21:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Daniel Martín <mardani29 <at> yahoo.es>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; regexp-builder window is very tall when
 temp-buffer-resize-mode is enabled
Date: Tue, 26 Jul 2022 01:19:56 +0200
Steps to reproduce:

emacs -Q
M-x temp-buffer-resize-mode RET
M-x regexp-builder RET

Actual result:

The regexp-builder window occupies half of the frame's height (much more
than its empty contents would require).

Expected result:

The regexp-builder window takes 4 lines, just as when
temp-buffer-resize-mode is not enabled.

Workaround:

Calling M-x fit-window-to-buffer after M-x regexp-builder resizes the
window successfully.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56772; Package emacs. (Tue, 26 Jul 2022 12:40:02 GMT) Full text and rfc822 format available.

Message #8 received at 56772 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Daniel Martín <mardani29 <at> yahoo.es>
Cc: 56772 <at> debbugs.gnu.org
Subject: Re: bug#56772: 29.0.50; regexp-builder window is very tall when
 temp-buffer-resize-mode is enabled
Date: Tue, 26 Jul 2022 14:38:58 +0200
Daniel Martín <mardani29 <at> yahoo.es> writes:

> Steps to reproduce:
>
> emacs -Q
> M-x temp-buffer-resize-mode RET
> M-x regexp-builder RET
>
> Actual result:
>
> The regexp-builder window occupies half of the frame's height (much more
> than its empty contents would require).

I'm unable to reproduce this problem on the current trunk.  Are there
any additional steps needed?





Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 26 Jul 2022 12:40:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56772; Package emacs. (Tue, 26 Jul 2022 13:04:02 GMT) Full text and rfc822 format available.

Message #13 received at 56772 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Martín <mardani29 <at> yahoo.es>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 56772 <at> debbugs.gnu.org
Subject: Re: bug#56772: 29.0.50; regexp-builder window is very tall when
 temp-buffer-resize-mode is enabled
Date: Tue, 26 Jul 2022 15:03:35 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Daniel Martín <mardani29 <at> yahoo.es> writes:
>
>> Steps to reproduce:
>>
>> emacs -Q
>> M-x temp-buffer-resize-mode RET
>> M-x regexp-builder RET
>>
>> Actual result:
>>
>> The regexp-builder window occupies half of the frame's height (much more
>> than its empty contents would require).
>
> I'm unable to reproduce this problem on the current trunk.  Are there
> any additional steps needed?

The reproduction steps were not precise enough, I think.  I can
reproduce it consistently with:

emacs -Q
M-x temp-buffer-resize-mode RET
M-x regexp-builder RET
C-c C-q
C-h m
C-x o
q
M-x regexp-builder RET

This second time the window will occupy more space than necessary.

If I omit setting temp-buffer-resize-mode in the first step, I cannot
reproduce the behavior.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56772; Package emacs. (Wed, 27 Jul 2022 07:50:03 GMT) Full text and rfc822 format available.

Message #16 received at 56772 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Daniel Martín <mardani29 <at> yahoo.es>
Cc: 56772 <at> debbugs.gnu.org
Subject: Re: bug#56772: 29.0.50; regexp-builder window is very tall when
 temp-buffer-resize-mode is enabled
Date: Wed, 27 Jul 2022 10:35:23 +0300
[Message part 1 (text/plain, inline)]
> Expected result:
>
> The regexp-builder window takes 4 lines, just as when
> temp-buffer-resize-mode is not enabled.
>
> Workaround:
>
> Calling M-x fit-window-to-buffer after M-x regexp-builder resizes the
> window successfully.

Before 57354bc6 it was hard-coded to 4, so a possible fix would be

              (window-height . ,(+ (if header-line-format 1 0)
                                   (if tab-line-format 1 0)
                                   4))

But a better fix is this:

[re-builder-fit-window-to-buffer.patch (text/x-diff, inline)]
diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index 46b429ce6f..84018f06ac 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -369,7 +369,8 @@ re-builder
             (get-buffer-create reb-buffer)
             `((display-buffer-in-direction)
               (direction . ,dir)
-              (dedicated . t))))))
+              (dedicated . t)
+              (window-height . fit-window-to-buffer))))))
     (font-lock-mode 1)
     (reb-initialize-buffer)))
 
[Message part 3 (text/plain, inline)]
I don't know why it resizes to less lines with tab-line-mode,
but this is a separate problem.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56772; Package emacs. (Wed, 27 Jul 2022 09:35:01 GMT) Full text and rfc822 format available.

Message #19 received at 56772 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Daniel Martín <mardani29 <at> yahoo.es>
Cc: 56772 <at> debbugs.gnu.org
Subject: Re: bug#56772: 29.0.50; regexp-builder window is very tall when
 temp-buffer-resize-mode is enabled
Date: Wed, 27 Jul 2022 11:33:58 +0200
Daniel Martín <mardani29 <at> yahoo.es> writes:

> The reproduction steps were not precise enough, I think.  I can
> reproduce it consistently with:
>
> emacs -Q
> M-x temp-buffer-resize-mode RET
> M-x regexp-builder RET
> C-c C-q
> C-h m
> C-x o
> q
> M-x regexp-builder RET
>
> This second time the window will occupy more space than necessary.

Thanks; with that I'm able to reproduce the problem.






Removed tag(s) moreinfo. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Thu, 04 Aug 2022 13:59:06 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Thu, 04 Aug 2022 13:59:06 GMT) Full text and rfc822 format available.

Severity set to 'minor' from 'normal' Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Thu, 04 Aug 2022 13:59:06 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56772; Package emacs. (Mon, 05 Sep 2022 19:00:02 GMT) Full text and rfc822 format available.

Message #28 received at 56772 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 56772 <at> debbugs.gnu.org, Daniel Martín <mardani29 <at> yahoo.es>
Subject: Re: bug#56772: 29.0.50; regexp-builder window is very tall when
 temp-buffer-resize-mode is enabled
Date: Mon, 05 Sep 2022 20:58:49 +0200
Juri Linkov <juri <at> linkov.net> writes:

> But a better fix is this:
>
> diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
> index 46b429ce6f..84018f06ac 100644
> --- a/lisp/emacs-lisp/re-builder.el
> +++ b/lisp/emacs-lisp/re-builder.el
> @@ -369,7 +369,8 @@ re-builder
>              (get-buffer-create reb-buffer)
>              `((display-buffer-in-direction)
>                (direction . ,dir)
> -              (dedicated . t))))))
> +              (dedicated . t)
> +              (window-height . fit-window-to-buffer))))))

So I pushed this to Emacs 29 now.




bug marked as fixed in version 29.1, send any further explanations to 56772 <at> debbugs.gnu.org and Daniel Martín <mardani29 <at> yahoo.es> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 05 Sep 2022 19:00:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 04 Oct 2022 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 198 days ago.

Previous Next


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