emacs-devel
[Top][All Lists]
Advanced

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

Re: emacs-25 3722a69: Fix bugs in window resizing code


From: martin rudalics
Subject: Re: emacs-25 3722a69: Fix bugs in window resizing code
Date: Tue, 01 Mar 2016 18:04:17 +0100

>> Sorry, but this fix was motivated by the following explanation in the
>> Emacs manual:
>>
>>        The command `C-x ^' (`enlarge-window') makes the selected window one
>>     line taller, taking space from a vertically adjacent window without
>>     changing the height of the frame.  With a positive numeric argument,
>>     this command increases the window height by that many lines; with a
>>     negative argument, it reduces the height by that many lines.  If there
>>     are no vertically adjacent windows (i.e., the window is at the full
>>     frame height), that signals an error.  The command also signals an
>>     error if you attempt to reduce the height of any window below a certain
>>                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>     minimum number of lines, specified by the variable `window-min-height'
>>     (the default is 4).
>>
>>        Similarly, `C-x }' (`enlarge-window-horizontally') makes the
>>     selected window wider, and `C-x {' (`shrink-window-horizontally') makes
>>     it narrower.  These commands signal an error if you attempt to reduce
>>                                                         ^^^^^^^^^^^^^^^^^
>>     the width of any window below a certain minimum number of columns,
>>     ^^^^^^^^^^^^^^^^^^^^^^^
>>     specified by the variable `window-min-width' (the default is 10).
>
> Please note that the above talks about reducing window dimensions below
> a threshold.

I'm confused.  Isn't that what would happen in your case?  If you want
to enlarge one window you will always need to shrink at least one other
window.

> Also, it is about interactive use.

We nowhere ever mention that these functions might behave differently in
interactive/non-interactive use.

> `enlarge-window' appears on several places on the Elisp sources,
> including calls like
>
> textmodes/two-column.el:305:6:    (enlarge-window 99999 t))
>
> which now will result on a error.

Ugly.  Earlier, with code like this you never knew whether the author's
intention was to maximize the window or to delete all other windows in
the same combination.  The author should either use ‘maximize-window’ or
`delete-other-windows-vertically' instead.  Please file a bug report.

> To be clear, I have nothing against throwing an error on the interactive
> case, but against throwing the error on the non-interactive one. That's
> what constitutes an API change on my book.
>
> So I would suggest to remove the `error' and consider where and when to
> add it after the release, after studying the code in the wild.

I can make any change people want but won't make any decision.  John,
Eli?

martin




reply via email to

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