all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: martin rudalics <rudalics@gmx.at>
Cc: E Sabof <esabof@gmail.com>, 16738@debbugs.gnu.org
Subject: bug#16738: Errors while resizing vertically
Date: Fri, 21 Feb 2014 12:29:31 -0800	[thread overview]
Message-ID: <5307B72B.9000808@cs.ucla.edu> (raw)
In-Reply-To: <53074FAE.60701@gmx.at>

[-- Attachment #1: Type: text/plain, Size: 374 bytes --]

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.



[-- Attachment #2: newpixel.diff --]
[-- Type: text/x-patch, Size: 674 bytes --]

=== 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))


  reply	other threads:[~2014-02-21 20:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13 10:06 bug#16738: Errors while resizing vertically E Sabof
2014-02-14 11:39 ` martin rudalics
2014-02-15  2:08   ` E Sabof
2014-02-16 10:32     ` martin rudalics
2014-02-21 13:07   ` martin rudalics
2014-02-21 20:29     ` Paul Eggert [this message]
2014-02-21 21:29       ` martin rudalics
2014-02-24  0:03         ` E Sabof
2014-02-24  7:40           ` martin rudalics
2014-02-24 13:06             ` E Sabof
2014-02-26 10:15               ` martin rudalics
2014-02-21 13:07 ` martin rudalics
2014-09-19  8:18   ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5307B72B.9000808@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=16738@debbugs.gnu.org \
    --cc=esabof@gmail.com \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.