From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: emacs-25 3722a69: Fix bugs in window resizing code Date: Tue, 01 Mar 2016 09:07:16 +0100 Message-ID: <56D54DB4.1080502@gmx.at> References: <20160218102715.15576.42604@vcs.savannah.gnu.org> <87si0bj85l.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1456819669 17700 80.91.229.3 (1 Mar 2016 08:07:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Mar 2016 08:07:49 +0000 (UTC) To: =?UTF-8?B?w5NzY2FyIEZ1ZW50ZXM=?= , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 01 09:07:40 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aafLG-0005ks-Qh for ged-emacs-devel@m.gmane.org; Tue, 01 Mar 2016 09:07:38 +0100 Original-Received: from localhost ([::1]:41532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aafLF-0004hG-RU for ged-emacs-devel@m.gmane.org; Tue, 01 Mar 2016 03:07:37 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aafLB-0004ge-UI for emacs-devel@gnu.org; Tue, 01 Mar 2016 03:07:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aafL6-0007Yo-VM for emacs-devel@gnu.org; Tue, 01 Mar 2016 03:07:33 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:50276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aafL6-0007Yg-MY for emacs-devel@gnu.org; Tue, 01 Mar 2016 03:07:28 -0500 Original-Received: from [192.168.1.100] ([212.95.7.52]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0M8pKi-1akaQA3s1k-00CAJy; Tue, 01 Mar 2016 09:07:23 +0100 In-Reply-To: <87si0bj85l.fsf@wanadoo.es> X-Provags-ID: V03:K0:2e3Nh+/Pjjfgjr3e56BVCxdcve5WFLOCGdLJwb+QyH4ym/ntEwI ad8yzo6wBFnQm0VSQuxvkOgA0A2yTlcmx0dNXfhhgnSgZmqaBZ6gYpWknhZMn0ix5kugbyG xcynCIh6mkHYIkGfyXV0qG8EbYbiHmZxBf4vJx4rzXHaJxRPVfHSCt5rAr/Juj3xEoA1dY1 zv6rrxymIlzOrnHVZPbQw== X-UI-Out-Filterresults: notjunk:1;V01:K0:hMLL6oNWQ3I=:RJJEEvmML/6uVP7qoQruXp Pnf95+ARvI1wwJQiMEn3axiuV0DQ0GXRDV+n1PhOUuAVAOkRd6vCRpaeLaCnGRV+sFtH3IvRE 8OOG6fwJh3Oq6VqxWOhkLq3O8Ap4C4w4bl/KBnH0uI0+D2veFCBypZe4wUO+VGjAb40eprIXu sSIOdLGddDWx19RrU1Q/ilIGVje2uKBcM1uUsAsuRmNhEkT/CeZG1j1iuV+hhk/0tJ0zSEPaZ vNes1oDnWs1mHBOqSor8yIw1eODvOCXcWq4yrukVam8HhYMfnItK7dAD+smQiXCZP4XxAWcvi iD6EqcY8BEmFlsAJUMmAJeDYe6ZlcfXMK+FFlX/XTIdtBcFwMuQ1AbmUhV1EGrzSplbXO4FUc yKd4Zza7xRED2DWZioyB93YDDGKZVdxhvC4syL8Z1iHQ0VuN5L9DAKl2OcviHesrt/2vL2DQ1 VKyBR7UWkcpc8BOdQToIInll+frOI4vi+SSc3TYKcW2A0Y64497fPW2gfv7e2aOqE2W+9ki/n bYuZGyElmIF+zq81gfB1yWEFuR49tn/mNzrUCbiv+/NmtuKXgdeqr1wsVqGUSQrLh3O+VL9br FQupGwqwRX2dsW/AxS2CAMCOKKMwczH9trFZc07oAmbgS2IpSw/nYFyJjrK83QBstCf4a0sD3 V7LHHRW0FRjO4bKQu/KH6jFSrDuU2fmOdnPB7ptqmsnORXfSPqnh7XBd3uk4v2zl4T1BfRA+N +IGmGIl/UPSWuuXHqIb9521xGga/EZlkJ4IkVpy5S1BtLAKSfh4AsvUHmofGl65fGX2z9sWr X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:200843 Archived-At: >> (shrink-window, enlarge-window): Fix bug#22723 where windows >> with preserved size would not get resized. Also now signal an >> error when the window cannot be shrunk or enlarged as requested.= > > [snip] > >> + (error "Cannot shrink selected window"))))) > > I was surprised to see my code failing because of this change. Throwin= g > an error on a case where previously nothing was done amounts to an API= > change. My code was fixed by wrapping the call to enlarge-window with > ignore-errors, but I'm worried about all the code out there. Sorry, but this fix was motivated by the following explanation in the Emacs manual: The command `C-x ^' (`enlarge-window') makes the selected window o= ne 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 ther= e 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 certa= in ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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') mak= es 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). We can easily change that to not signal an error but then behaviors like the one reported by Eli will get passed by unnoticed. Emacsen < 23 silently could delete windows when you made them too small with these commands. This was deprecated but IIRC no one ever expressed a preference as to how these functions _should_ behave when there is not enough space. Suggestions welcome. Personally, I'd never use =E2=80=98enlarge-window=E2=80=99 and =E2=80=98s= hrink-window=E2=80=99 in Lisp code. IMO these are for interactive use only (supported by the fact that neither of these functions is documented in the Elisp manual). martin