Commit 4199d5be authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(mouse-drag-vertical-line): Use adjust-window-trailing-edge.

parent 658e7a9f
...@@ -594,14 +594,15 @@ resized by dragging their header-line." ...@@ -594,14 +594,15 @@ resized by dragging their header-line."
((null (car (cdr mouse))) ((null (car (cdr mouse)))
nil) nil)
(t (t
(save-selected-window (let ((window
;; If the scroll bar is on the window's left, ;; If the scroll bar is on the window's left,
;; adjust the window on the left. ;; adjust the window on the left.
(unless (eq which-side 'right) (if (eq which-side 'right)
(select-window (previous-window))) (selected-window)
(previous-window))))
(setq x (- (car (cdr mouse)) (setq x (- (car (cdr mouse))
(if (eq which-side 'right) 0 2)) (if (eq which-side 'right) 0 2))
edges (window-edges) edges (window-edges window)
left (nth 0 edges) left (nth 0 edges)
right (nth 2 edges)) right (nth 2 edges))
;; scale back a move that would make the ;; scale back a move that would make the
...@@ -609,19 +610,10 @@ resized by dragging their header-line." ...@@ -609,19 +610,10 @@ resized by dragging their header-line."
(if (< (- x left -1) window-min-width) (if (< (- x left -1) window-min-width)
(setq x (+ left window-min-width -1))) (setq x (+ left window-min-width -1)))
;; compute size change needed ;; compute size change needed
(setq growth (- x right -1) (setq growth (- x right -1))
wconfig (current-window-configuration)) (condition-case nil
(enlarge-window growth t) (adjust-window-trailing-edge window growth t)
;; if this window's growth caused another (error nil))))))))))
;; 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))))))))))
(defun mouse-set-point (event) (defun mouse-set-point (event)
"Move point to the position clicked on with the mouse. "Move point to the position clicked on with the mouse.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment