Mercurial > emacs
changeset 107262:251ddf5539cc
scroll-bar.el (scroll-bar-drag-1): Add save-excursion, bug #5654.
author | Jan D. <jan.h.d@swipnet.se> |
---|---|
date | Sun, 28 Feb 2010 15:36:34 +0100 |
parents | 272295a562ec |
children | d8c6d8e3da50 fec42ef390ce |
files | lisp/scroll-bar.el |
diffstat | 1 files changed, 8 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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.