* bug#56772: 29.0.50; regexp-builder window is very tall when temp-buffer-resize-mode is enabled
[not found] <m11qu8eq5f.fsf.ref@yahoo.es>
@ 2022-07-25 23:19 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-26 12:38 ` Lars Ingebrigtsen
2022-07-27 7:35 ` Juri Linkov
0 siblings, 2 replies; 6+ messages in thread
From: Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-07-25 23:19 UTC (permalink / raw)
To: 56772
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#56772: 29.0.50; regexp-builder window is very tall when temp-buffer-resize-mode is enabled
2022-07-25 23:19 ` bug#56772: 29.0.50; regexp-builder window is very tall when temp-buffer-resize-mode is enabled Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-07-26 12:38 ` Lars Ingebrigtsen
2022-07-26 13:03 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-27 7:35 ` Juri Linkov
1 sibling, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2022-07-26 12:38 UTC (permalink / raw)
To: Daniel Martín; +Cc: 56772
Daniel Martín <mardani29@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?
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#56772: 29.0.50; regexp-builder window is very tall when temp-buffer-resize-mode is enabled
2022-07-26 12:38 ` Lars Ingebrigtsen
@ 2022-07-26 13:03 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-27 9:33 ` Lars Ingebrigtsen
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-07-26 13:03 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 56772
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Daniel Martín <mardani29@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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#56772: 29.0.50; regexp-builder window is very tall when temp-buffer-resize-mode is enabled
2022-07-25 23:19 ` bug#56772: 29.0.50; regexp-builder window is very tall when temp-buffer-resize-mode is enabled Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-26 12:38 ` Lars Ingebrigtsen
@ 2022-07-27 7:35 ` Juri Linkov
2022-09-05 18:58 ` Lars Ingebrigtsen
1 sibling, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2022-07-27 7:35 UTC (permalink / raw)
To: Daniel Martín; +Cc: 56772
[-- Attachment #1: Type: text/plain, Size: 491 bytes --]
> 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:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: re-builder-fit-window-to-buffer.patch --]
[-- Type: text/x-diff, Size: 520 bytes --]
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)))
[-- Attachment #3: Type: text/plain, Size: 95 bytes --]
I don't know why it resizes to less lines with tab-line-mode,
but this is a separate problem.
^ permalink raw reply related [flat|nested] 6+ messages in thread
* bug#56772: 29.0.50; regexp-builder window is very tall when temp-buffer-resize-mode is enabled
2022-07-27 7:35 ` Juri Linkov
@ 2022-09-05 18:58 ` Lars Ingebrigtsen
0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-05 18:58 UTC (permalink / raw)
To: Juri Linkov; +Cc: 56772, Daniel Martín
Juri Linkov <juri@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.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-09-05 18:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <m11qu8eq5f.fsf.ref@yahoo.es>
2022-07-25 23:19 ` bug#56772: 29.0.50; regexp-builder window is very tall when temp-buffer-resize-mode is enabled Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-26 12:38 ` Lars Ingebrigtsen
2022-07-26 13:03 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-27 9:33 ` Lars Ingebrigtsen
2022-07-27 7:35 ` Juri Linkov
2022-09-05 18:58 ` Lars Ingebrigtsen
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).