Mercurial > emacs
changeset 107263:d8c6d8e3da50
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:37:20 +0100 |
parents | d8f04397b77a (current diff) 251ddf5539cc (diff) |
children | 349c5e0bbe82 |
files | |
diffstat | 2 files changed, 12 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Sun Feb 28 09:19:31 2010 -0500 +++ b/lisp/ChangeLog Sun Feb 28 15:37:20 2010 +0100 @@ -1,3 +1,7 @@ +2010-02-28 Jan Djärv <jan.h.d@swipnet.se> + + * scroll-bar.el (scroll-bar-drag-1): Add save-excursion, bug #5654. + 2010-02-28 Michael Albinus <michael.albinus@gmx.de> * net/tramp.el (tramp-handle-write-region): START can be a string.
--- a/lisp/scroll-bar.el Sun Feb 28 09:19:31 2010 -0500 +++ b/lisp/scroll-bar.el Sun Feb 28 15:37:20 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.