aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv2010-02-28 15:36:34 +0100
committerJan Djärv2010-02-28 15:36:34 +0100
commit71572c0330cd8ba69e47bacab1f0764878702233 (patch)
tree9bfb984040d5cdfd7cd85174a22f0a792379adad
parent412c01b6f0ab2661d5161062eb1d988482ae0d7d (diff)
downloademacs-71572c0330cd8ba69e47bacab1f0764878702233.tar.gz
emacs-71572c0330cd8ba69e47bacab1f0764878702233.zip
scroll-bar.el (scroll-bar-drag-1): Add save-excursion, bug #5654.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/scroll-bar.el15
2 files changed, 12 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 329139951a9..0a8105a7aeb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12010-02-28 Jan Djärv <jan.h.d@swipnet.se>
2
3 * scroll-bar.el (scroll-bar-drag-1): Add save-excursion, bug #5654.
4
12010-02-28 Michael Albinus <michael.albinus@gmx.de> 52010-02-28 Michael Albinus <michael.albinus@gmx.de>
2 6
3 * net/tramp.el (tramp-handle-write-region): START can be a string. 7 * 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 c28a417a8f3..3f763fc59da 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."
210 (let* ((start-position (event-start event)) 210 (let* ((start-position (event-start event))
211 (window (nth 0 start-position)) 211 (window (nth 0 start-position))
212 (portion-whole (nth 2 start-position))) 212 (portion-whole (nth 2 start-position)))
213 (with-current-buffer (window-buffer window) 213 (save-excursion
214 ;; Calculate position relative to the accessible part of the buffer. 214 (with-current-buffer (window-buffer window)
215 (goto-char (+ (point-min) 215 ;; Calculate position relative to the accessible part of the buffer.
216 (scroll-bar-scale portion-whole 216 (goto-char (+ (point-min)
217 (- (point-max) (point-min))))) 217 (scroll-bar-scale portion-whole
218 (vertical-motion 0 window) 218 (- (point-max) (point-min)))))
219 (set-window-start window (point))))) 219 (vertical-motion 0 window)
220 (set-window-start window (point))))))
220 221
221(defun scroll-bar-drag (event) 222(defun scroll-bar-drag (event)
222 "Scroll the window by dragging the scroll bar slider. 223 "Scroll the window by dragging the scroll bar slider.