aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/scroll-bar.el42
1 files changed, 22 insertions, 20 deletions
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el
index 5458ab0054f..d8e21921458 100644
--- a/lisp/scroll-bar.el
+++ b/lisp/scroll-bar.el
@@ -250,16 +250,17 @@ EVENT should be a scroll bar click."
250 (before-scroll)) 250 (before-scroll))
251 (with-current-buffer (window-buffer window) 251 (with-current-buffer (window-buffer window)
252 (setq before-scroll point-before-scroll)) 252 (setq before-scroll point-before-scroll))
253 (save-selected-window 253 (unwind-protect
254 (let ((portion-whole (nth 2 end-position))) 254 (save-selected-window
255 (select-window window) 255 (let ((portion-whole (nth 2 end-position)))
256 (setq before-scroll 256 (select-window window)
257 (or before-scroll (point))) 257 (setq before-scroll
258 (scroll-down 258 (or before-scroll (point)))
259 (scroll-bar-scale portion-whole (1- (window-height)))))) 259 (scroll-down
260 (sit-for 0) 260 (scroll-bar-scale portion-whole (1- (window-height)))))
261 (with-current-buffer (window-buffer window) 261 (sit-for 0))
262 (setq point-before-scroll before-scroll)))) 262 (with-current-buffer (window-buffer window)
263 (setq point-before-scroll before-scroll)))))
263 264
264(defun scroll-bar-scroll-up (event) 265(defun scroll-bar-scroll-up (event)
265 "Scroll the line next to the scroll bar click to the top of the window. 266 "Scroll the line next to the scroll bar click to the top of the window.
@@ -270,16 +271,17 @@ EVENT should be a scroll bar click."
270 (before-scroll)) 271 (before-scroll))
271 (with-current-buffer (window-buffer window) 272 (with-current-buffer (window-buffer window)
272 (setq before-scroll point-before-scroll)) 273 (setq before-scroll point-before-scroll))
273 (save-selected-window 274 (unwind-protect
274 (let ((portion-whole (nth 2 end-position))) 275 (save-selected-window
275 (select-window window) 276 (let ((portion-whole (nth 2 end-position)))
276 (setq before-scroll 277 (select-window window)
277 (or before-scroll (point))) 278 (setq before-scroll
278 (scroll-up 279 (or before-scroll (point)))
279 (scroll-bar-scale portion-whole (1- (window-height)))))) 280 (scroll-up
280 (sit-for 0) 281 (scroll-bar-scale portion-whole (1- (window-height)))))
281 (with-current-buffer (window-buffer window) 282 (sit-for 0))
282 (setq point-before-scroll before-scroll)))) 283 (with-current-buffer (window-buffer window)
284 (setq point-before-scroll before-scroll)))))
283 285
284 286
285;;;; Bindings. 287;;;; Bindings.