From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#16738: Errors while resizing vertically Date: Fri, 21 Feb 2014 12:29:31 -0800 Organization: UCLA Computer Science Department Message-ID: <5307B72B.9000808@cs.ucla.edu> References: <87y51fnx7u.fsf@gmail.com> <52FE008E.1010503@gmx.at> <53074FAE.60701@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080901090901010703010904" X-Trace: ger.gmane.org 1393014622 21192 80.91.229.3 (21 Feb 2014 20:30:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Feb 2014 20:30:22 +0000 (UTC) Cc: E Sabof , 16738@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 21 21:30:29 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1WGwjq-0007OP-Js for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Feb 2014 21:30:26 +0100 Original-Received: from localhost ([::1]:46797 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGwjp-0006Fh-Q5 for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Feb 2014 15:30:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGwjd-0005zF-UV for bug-gnu-emacs@gnu.org; Fri, 21 Feb 2014 15:30:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGwjU-0001J0-QJ for bug-gnu-emacs@gnu.org; Fri, 21 Feb 2014 15:30:13 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGwjU-0001GP-6i for bug-gnu-emacs@gnu.org; Fri, 21 Feb 2014 15:30:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WGwjT-0000EB-Dq for bug-gnu-emacs@gnu.org; Fri, 21 Feb 2014 15:30:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Feb 2014 20:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16738 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16738-submit@debbugs.gnu.org id=B16738.1393014580820 (code B ref 16738); Fri, 21 Feb 2014 20:30:03 +0000 Original-Received: (at 16738) by debbugs.gnu.org; 21 Feb 2014 20:29:40 +0000 Original-Received: from localhost ([127.0.0.1]:35075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WGwj6-0000D9-Ch for submit@debbugs.gnu.org; Fri, 21 Feb 2014 15:29:40 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:54207) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WGwj3-0000Ct-T5 for 16738@debbugs.gnu.org; Fri, 21 Feb 2014 15:29:38 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 029FAA6005B; Fri, 21 Feb 2014 12:29:32 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id akcilVLZ01-b; Fri, 21 Feb 2014 12:29:31 -0800 (PST) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 9EF3C39E801F; Fri, 21 Feb 2014 12:29:31 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: <53074FAE.60701@gmx.at> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:85996 Archived-At: This is a multi-part message in MIME format. --------------080901090901010703010904 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit My change adjusted set-window-new-pixel so that it rejects attempts to set the new pixel size to a negative value. Here, new-pixel is currently 0, so (set-window-new-pixel window-17 t) is attempting to change new-pixel to be -17. Are negative new-pixel values allowed? If so, the attached patch should fix the problem. If not, the problem's probably in the caller. --------------080901090901010703010904 Content-Type: text/x-patch; name="newpixel.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="newpixel.diff" === modified file 'src/window.c' --- src/window.c 2014-02-21 08:02:05 +0000 +++ src/window.c 2014-02-21 20:25:41 +0000 @@ -3702,8 +3702,9 @@ (Lisp_Object window, Lisp_Object size, Lisp_Object add) { struct window *w = decode_valid_window (window); - EMACS_INT size_min = NILP (add) ? 0 : - XINT (w->new_pixel); - EMACS_INT size_max = size_min + min (INT_MAX, MOST_POSITIVE_FIXNUM); + EMACS_INT new_pixel = NILP (add) ? 0 : XINT (w->new_pixel); + EMACS_INT size_min = max (INT_MIN, MOST_NEGATIVE_FIXNUM) - new_pixel; + EMACS_INT size_max = min (INT_MAX, MOST_POSITIVE_FIXNUM) - new_pixel; CHECK_RANGED_INTEGER (size, size_min, size_max); if (NILP (add)) --------------080901090901010703010904--