emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-24 r116975: Fix bug #17281 with infloop in line-pixe


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-24 r116975: Fix bug #17281 with infloop in line-pixel-height.
Date: Thu, 17 Apr 2014 08:59:32 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116975
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/17281
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Thu 2014-04-17 11:58:59 +0300
message:
  Fix bug #17281 with infloop in line-pixel-height.
  
   src/xdisp.c (Fline_pixel_height): Don't assume that the current
   buffer and the selected window's buffer are one and the same.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/xdisp.c                    xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-04-17 07:24:40 +0000
+++ b/src/ChangeLog     2014-04-17 08:58:59 +0000
@@ -1,5 +1,9 @@
 2014-04-17  Eli Zaretskii  <address@hidden>
 
+       * xdisp.c (Fline_pixel_height): Don't assume that the current
+       buffer and the selected window's buffer are one and the same.
+       (Bug#17281)
+
        * insdel.c (invalidate_buffer_caches): Invalidate the bidi
        paragraph-start cache before the newline cache.  (Bug#17269)
 

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2014-04-12 11:21:47 +0000
+++ b/src/xdisp.c       2014-04-17 08:58:59 +0000
@@ -1262,12 +1262,23 @@
   struct it it;
   struct text_pos pt;
   struct window *w = XWINDOW (selected_window);
+  struct buffer *old_buffer = NULL;
+  Lisp_Object result;
 
+  if (XBUFFER (w->contents) != current_buffer)
+    {
+      old_buffer = current_buffer;
+      set_buffer_internal_1 (XBUFFER (w->contents));
+    }
   SET_TEXT_POS (pt, PT, PT_BYTE);
   start_display (&it, w, pt);
   it.vpos = it.current_y = 0;
   last_height = 0;
-  return make_number (line_bottom_y (&it));
+  result = make_number (line_bottom_y (&it));
+  if (old_buffer)
+    set_buffer_internal_1 (old_buffer);
+
+  return result;
 }
 
 /* Return the default pixel height of text lines in window W.  The


reply via email to

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