emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110778: * window.c (decode_next_wind


From: Dmitry Antipov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110778: * window.c (decode_next_window_args): Update window arg after
Date: Sat, 03 Nov 2012 09:11:34 +0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110778
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Sat 2012-11-03 09:11:34 +0400
message:
  * window.c (decode_next_window_args): Update window arg after
  calling decode_live_window and so fix crash reported at
  http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
  by Juanma Barranquero <address@hidden>.
  (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
  * font.c (Ffont_at): Likewise.
modified:
  src/ChangeLog
  src/font.c
  src/window.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-11-01 22:44:53 +0000
+++ b/src/ChangeLog     2012-11-03 05:11:34 +0000
@@ -1,3 +1,12 @@
+2012-11-03  Dmitry Antipov  <address@hidden>
+
+       * window.c (decode_next_window_args): Update window arg after
+       calling decode_live_window and so fix crash reported at
+       http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
+       by Juanma Barranquero <address@hidden>.
+       (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
+       * font.c (Ffont_at): Likewise.
+
 2012-11-01  Jan Djärv  <address@hidden>
 
        * widget.c (resize_cb): New function.

=== modified file 'src/font.c'
--- a/src/font.c        2012-11-02 10:34:26 +0000
+++ b/src/font.c        2012-11-03 05:11:34 +0000
@@ -4766,7 +4766,6 @@
   (Lisp_Object position, Lisp_Object window, Lisp_Object string)
 {
   struct window *w = decode_live_window (window);
-  ptrdiff_t pos;
 
   if (NILP (string))
     {
@@ -4775,7 +4774,6 @@
       CHECK_NUMBER_COERCE_MARKER (position);
       if (! (BEGV <= XINT (position) && XINT (position) < ZV))
        args_out_of_range_3 (position, make_number (BEGV), make_number (ZV));
-      pos = XINT (position);
     }
   else
     {
@@ -4783,10 +4781,9 @@
       CHECK_STRING (string);
       if (! (0 <= XINT (position) && XINT (position) < SCHARS (string)))
        args_out_of_range (string, position);
-      pos = XINT (position);
     }
 
-  return font_at (-1, pos, NULL, w, string);
+  return font_at (-1, XINT (position), NULL, w, string);
 }
 
 #if 0

=== modified file 'src/window.c'
--- a/src/window.c      2012-11-02 10:34:26 +0000
+++ b/src/window.c      2012-11-03 05:11:34 +0000
@@ -774,8 +774,7 @@
 exclude partially-visible lines, use `window-text-height'.  */)
   (Lisp_Object window)
 {
-  struct window *w = decode_live_window (window);
-  return make_number (window_body_lines (w));
+  return make_number (window_body_lines (decode_live_window (window)));
 }
 
 DEFUN ("window-body-width", Fwindow_body_width, Swindow_body_width, 0, 1, 0,
@@ -787,8 +786,7 @@
 expressed as an integer multiple of the default character width.  */)
   (Lisp_Object window)
 {
-  struct window *w = decode_live_window (window);
-  return make_number (window_body_cols (w));
+  return make_number (window_body_cols (decode_live_window (window)));
 }
 
 DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0,
@@ -2254,6 +2252,7 @@
 {
   struct window *w = decode_live_window (*window);
 
+  XSETWINDOW (*window, w);
   /* MINIBUF nil may or may not include minibuffers.  Decide if it
      does.  */
   if (NILP (*minibuf))


reply via email to

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