diff options
author | Karl Heuer <kwzh@gnu.org> | 1996-05-21 14:40:56 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1996-05-21 14:40:56 +0000 |
commit | caf9b328c30608c3603d958d82c5899cd1645f8b (patch) | |
tree | 9d44cb722771072a8562f57ce8832755474f3541 /lisp/term/w32-win.el | |
parent | 9c005c6533576cd20c393cf7ea6e9eae11ef15ba (diff) | |
download | emacs-caf9b328c30608c3603d958d82c5899cd1645f8b.tar.gz |
(win32-handle-scroll-bar-event): Restore
original window selection after scrolling.
Diffstat (limited to 'lisp/term/w32-win.el')
-rw-r--r-- | lisp/term/w32-win.el | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index d5da3ab9f7e..559075cf313 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -84,24 +84,27 @@ (defun win32-handle-scroll-bar-event (event) "Handle Win32 scroll bar events to do normal Window style scrolling." (interactive "e") - (let* ((position (event-start event)) - (window (nth 0 position)) - (portion-whole (nth 2 position)) - (bar-part (nth 4 position))) - (save-excursion - (select-window window) - (cond - ((eq bar-part 'up) - (scroll-down 1)) - ((eq bar-part 'above-handle) - (scroll-down)) - ((eq bar-part 'handle) - (scroll-bar-maybe-set-window-start event)) - ((eq bar-part 'below-handle) - (scroll-up)) - ((eq bar-part 'down) - (scroll-up 1)) - )))) + (let ((old-window (selected-window))) + (unwind-protect + (let* ((position (event-start event)) + (window (nth 0 position)) + (portion-whole (nth 2 position)) + (bar-part (nth 4 position))) + (save-excursion + (select-window window) + (cond + ((eq bar-part 'up) + (scroll-down 1)) + ((eq bar-part 'above-handle) + (scroll-down)) + ((eq bar-part 'handle) + (scroll-bar-maybe-set-window-start event)) + ((eq bar-part 'below-handle) + (scroll-up)) + ((eq bar-part 'down) + (scroll-up 1)) + ))) + (select-window old-window)))) ;; The following definition is used for debugging. ;(defun win32-handle-scroll-bar-event (event) (interactive "e") (princ event)) |