aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2014-07-17 18:25:21 +0300
committerEli Zaretskii2014-07-17 18:25:21 +0300
commit9180cde1125adced11ca5125ebed4e988d776539 (patch)
tree852f845ce11c2c6d2e0fa13238f237aa805b03b0 /src
parent137448c0939848661fdf6e89075c1ac706d30c5e (diff)
downloademacs-9180cde1125adced11ca5125ebed4e988d776539.tar.gz
emacs-9180cde1125adced11ca5125ebed4e988d776539.zip
Fix assertion violation when restoring hscrolled window configurations.
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>.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/xdisp.c7
2 files changed, 10 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 463c895e5da..737a5078b24 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -4,6 +4,9 @@
4 buffer position where we are to start the iteration. 4 buffer position where we are to start the iteration.
5 (handle_invisible_prop): Record in it->stop_charpos the position 5 (handle_invisible_prop): Record in it->stop_charpos the position
6 where the invisible text ends. (Bug#18035) 6 where the invisible text ends. (Bug#18035)
7 (hscroll_window_tree): Don't try hscrolling windows whose cursor
8 row has zero buffer position as their start position. Reported by
9 martin rudalics <rudalics@gmx.at>.
7 10
82014-07-16 Eli Zaretskii <eliz@gnu.org> 112014-07-16 Eli Zaretskii <eliz@gnu.org>
9 12
diff --git a/src/xdisp.c b/src/xdisp.c
index 3ab1dd76654..d1016b6b8d7 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12880,6 +12880,13 @@ hscroll_window_tree (Lisp_Object window)
12880 h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w); 12880 h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w);
12881 12881
12882 if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->contents)) 12882 if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->contents))
12883 /* In some pathological cases, like restoring a window
12884 configuration into a frame that is much smaller than
12885 the one from which the configuration was saved, we
12886 get glyph rows whose start and end have zero buffer
12887 positions, which we cannot handle below. Just skip
12888 such windows. */
12889 && CHARPOS (cursor_row->start.pos) >= BUF_BEG (w->contents)
12883 /* For left-to-right rows, hscroll when cursor is either 12890 /* For left-to-right rows, hscroll when cursor is either
12884 (i) inside the right hscroll margin, or (ii) if it is 12891 (i) inside the right hscroll margin, or (ii) if it is
12885 inside the left margin and the window is already 12892 inside the left margin and the window is already