Avoid weird behavior with large horizontal scrolls.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 4 Jul 2012 06:15:31 +0000 (23:15 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 4 Jul 2012 06:15:31 +0000 (23:15 -0700)
commit24a212eb232e081c12f6b52429757657f0528e66
tree47ad3a7628ff477f5d7e957b82f0a05ecb5ef7ab
parentdea7f1e5a400cfa9a42eef08be86cdc0992660b5
Avoid weird behavior with large horizontal scrolls.

Without this change, for example, large hscroll values would
mess up Emacs's display on Fedora 15 x86, presumably due to
overflows in int calculations in the display code.
Also, if buffers had long lines, Emacs would freeze.
* window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
(set_window_hscroll): New function, containing the old guts of
Fset_window_hscroll.  Return the clipped value.
(Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
This avoids the need to check against PTRDIFF_MAX.
src/ChangeLog
src/window.c