]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix assertion violation when restoring hscrolled window configurations.
authorEli Zaretskii <eliz@gnu.org>
Thu, 17 Jul 2014 15:25:21 +0000 (18:25 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 17 Jul 2014 15:25:21 +0000 (18:25 +0300)
 src/xdisp.c (hscroll_window_tree): Don't try hscrolling windows whose cursor
 row has zero buffer position as their start position.  Reported by
 Martin Rudalics <rudalics@gmx.at>.

src/ChangeLog
src/xdisp.c

index 463c895e5da72832b3708a396e228d4793c2714f..737a5078b244c2ec3e54658c2f03cf4aa40ba94b 100644 (file)
@@ -4,6 +4,9 @@
        buffer position where we are to start the iteration.
        (handle_invisible_prop): Record in it->stop_charpos the position
        where the invisible text ends.  (Bug#18035)
+       (hscroll_window_tree): Don't try hscrolling windows whose cursor
+       row has zero buffer position as their start position.  Reported by
+       martin rudalics <rudalics@gmx.at>.
 
 2014-07-16  Eli Zaretskii  <eliz@gnu.org>
 
index 3ab1dd766549145d31357903f678d3dada4cbdcf..d1016b6b8d7946645b9784e9da3694d837ff0e89 100644 (file)
@@ -12880,6 +12880,13 @@ hscroll_window_tree (Lisp_Object window)
          h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w);
 
          if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->contents))
+             /* In some pathological cases, like restoring a window
+                configuration into a frame that is much smaller than
+                the one from which the configuration was saved, we
+                get glyph rows whose start and end have zero buffer
+                positions, which we cannot handle below.  Just skip
+                such windows.  */
+             && CHARPOS (cursor_row->start.pos) >= BUF_BEG (w->contents)
              /* For left-to-right rows, hscroll when cursor is either
                 (i) inside the right hscroll margin, or (ii) if it is
                 inside the left margin and the window is already