# HG changeset patch # User Jan D. # Date 1267367794 -3600 # Node ID 251ddf5539cc0ced7b22ef673e049d54e063647f # Parent 272295a562eccafe85022627114c96d9835a80b8 scroll-bar.el (scroll-bar-drag-1): Add save-excursion, bug #5654. diff -r 272295a562ec -r 251ddf5539cc lisp/scroll-bar.el --- a/lisp/scroll-bar.el Sun Feb 28 15:36:24 2010 +0100 +++ b/lisp/scroll-bar.el Sun Feb 28 15:36:34 2010 +0100 @@ -210,13 +210,14 @@ (let* ((start-position (event-start event)) (window (nth 0 start-position)) (portion-whole (nth 2 start-position))) - (with-current-buffer (window-buffer window) - ;; Calculate position relative to the accessible part of the buffer. - (goto-char (+ (point-min) - (scroll-bar-scale portion-whole - (- (point-max) (point-min))))) - (vertical-motion 0 window) - (set-window-start window (point))))) + (save-excursion + (with-current-buffer (window-buffer window) + ;; Calculate position relative to the accessible part of the buffer. + (goto-char (+ (point-min) + (scroll-bar-scale portion-whole + (- (point-max) (point-min))))) + (vertical-motion 0 window) + (set-window-start window (point)))))) (defun scroll-bar-drag (event) "Scroll the window by dragging the scroll bar slider.