summaryrefslogtreecommitdiff
path: root/lisp/mouse.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2005-12-12 05:21:33 +0000
committerRichard M. Stallman <rms@gnu.org>2005-12-12 05:21:33 +0000
commit4199d5be3e91af4dbb1f1d4a665df6162e615a07 (patch)
tree712a83814751bf80c5fe8261d9f7bd5f6df89361 /lisp/mouse.el
parent658e7a9fc51aee12dd0035ea772178ae93118ca3 (diff)
(mouse-drag-vertical-line): Use adjust-window-trailing-edge.
Diffstat (limited to 'lisp/mouse.el')
-rw-r--r--lisp/mouse.el30
1 files changed, 11 insertions, 19 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 2c5d9cbddd6..b5881272835 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -594,14 +594,15 @@ resized by dragging their header-line."
((null (car (cdr mouse)))
nil)
(t
- (save-selected-window
- ;; If the scroll bar is on the window's left,
- ;; adjust the window on the left.
- (unless (eq which-side 'right)
- (select-window (previous-window)))
+ (let ((window
+ ;; If the scroll bar is on the window's left,
+ ;; adjust the window on the left.
+ (if (eq which-side 'right)
+ (selected-window)
+ (previous-window))))
(setq x (- (car (cdr mouse))
(if (eq which-side 'right) 0 2))
- edges (window-edges)
+ edges (window-edges window)
left (nth 0 edges)
right (nth 2 edges))
;; scale back a move that would make the
@@ -609,19 +610,10 @@ resized by dragging their header-line."
(if (< (- x left -1) window-min-width)
(setq x (+ left window-min-width -1)))
;; compute size change needed
- (setq growth (- x right -1)
- wconfig (current-window-configuration))
- (enlarge-window growth t)
- ;; if this window's growth caused another
- ;; window to be deleted because it was too
- ;; thin, rescind the change.
- ;;
- ;; if size change caused space to be stolen
- ;; from a window to the left of this one,
- ;; rescind the change.
- (if (or (/= start-nwindows (count-windows t))
- (/= left (nth 0 (window-edges))))
- (set-window-configuration wconfig))))))))))
+ (setq growth (- x right -1))
+ (condition-case nil
+ (adjust-window-trailing-edge window growth t)
+ (error nil))))))))))
(defun mouse-set-point (event)
"Move point to the position clicked on with the mouse.