bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#69983: Use category for display-buffer-alist


From: Juri Linkov
Subject: bug#69983: Use category for display-buffer-alist
Date: Wed, 10 Apr 2024 09:45:49 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)

>> >> >>> One problem is that I can't find an alist item to limit
>> >> >>> the window height, i.e. can't find window-max-height
>> >> >>> that would be like window-min-height, but to set a max height.
>> >> >>> Could you suggest such an alist item?
>> >> >>
>> >> >> The intention was to have such behavior:
>> >> >> 1. after the first call that adds 1 line to the output buffer,
>> >> >>     resize the displayed buffer to 1 line height;
>> >> >> 2. after the second call grow the output window height to 2 lines,
>> >> >>     it seems fit-window-to-buffer should do this;
>> >> >> 3. after 10th call limit the window height to 10 lines only,
>> >> >>     so later calls should not increase the output window height
>> >> >>     more than 10 lines.
>> >> >
>> >> > You mean that when a 'window-height' action alist entry is provided that
>> >> > specifies 'fit-window-to-buffer' as 'window-height' value, we should
>> >> > pass it the value of any 'window-max-height' entry present as MAX-HEIGHT
>> >> > argument here
>> >> >
>> >> >          ((functionp height)
>> >> >           (ignore-errors (funcall height window))
>> >> >
>> >> > and probably do the same for all the other arguments of
>> >> > 'fit-window-to-buffer'?
>> >>
>> >> Probably we can't change the existing arguments to not break
>> >> backward-compatibility.  But this is fine since still can use
>> >> the explicit function call:
>> >>
>> >> diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
>> >> index 8b43c6a8726..75b519067ac 100644
>> >> --- a/lisp/emacs-lisp/warnings.el
>> >> +++ b/lisp/emacs-lisp/warnings.el
>> >> @@ -362,7 +362,12 @@ display-warning
>> >
>> > Why does adding a new feature require changes in existing features,
>> > let alone such basic features as warnings.el?  Can't we introduce the
>> > category and leave warnings.el, flymake.el, and others alone?  I don't
>> > want to make unsolicited changes in those other places, because that
>> > runs the risk of disturbing people's arrangements of windows and their
>> > habits as to where the various windows pop up.
>>
>> This is part of continuing development to improve
>> window handling for users of horizontally split windows.
>
> I don't think I understand how category is related to horizontally
> split windows, please explain.  We are still in the context of
> bug#69983 and its Subject, aren't we?
>
> If there are some problems related to horizontally split windows that
> interfere with showing warnings, please describe them.

The function 'display-warning' has the argument 'buffer-name'.
This means it's impossible to match the buffer name in
'display-buffer-alist', because the buffer name can be anything.
Therefore the 'category' should be added to the 'display-buffer'
call in 'display-warning'.

Currently the warning buffer is displayed in a random place
in horizontally split windows.  The change is needed to display it
in the consistent place.  This change is accompanied with adding
the category for the case if someone don't like this change
(very unlikely) and wants to revert it to display the buffer
in a random place.  It will be possible to customize this
by using the category in 'display-buffer-alist'.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]