diff options
author | Jan Djärv <[email protected]> | 2010-02-28 15:36:34 +0100 |
---|---|---|
committer | Jan Djärv <[email protected]> | 2010-02-28 15:36:34 +0100 |
commit | 71572c0330cd8ba69e47bacab1f0764878702233 (patch) | |
tree | 9bfb984040d5cdfd7cd85174a22f0a792379adad /lisp | |
parent | 412c01b6f0ab2661d5161062eb1d988482ae0d7d (diff) |
scroll-bar.el (scroll-bar-drag-1): Add save-excursion, bug #5654.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 4 | ||||
-rw-r--r-- | lisp/scroll-bar.el | 15 |
2 files changed, 12 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 329139951a..0a8105a7ae 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2010-02-28 Jan Djärv <[email protected]> + + * scroll-bar.el (scroll-bar-drag-1): Add save-excursion, bug #5654. + 2010-02-28 Michael Albinus <[email protected]> * net/tramp.el (tramp-handle-write-region): START can be a string. diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el index c28a417a8f..3f763fc59d 100644 --- a/lisp/scroll-bar.el +++ b/lisp/scroll-bar.el @@ -210,13 +210,14 @@ EVENT should be a scroll bar click or drag event." (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. |