aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman2006-06-19 21:47:23 +0000
committerRichard M. Stallman2006-06-19 21:47:23 +0000
commit73c8f64c94e2fbac653615eaade01028c2d7bce7 (patch)
tree00a508539d4ead0718f5018acb12978495004fa3 /lisp
parent161c71277e2a6d894989fd72e6381c76f46d9760 (diff)
downloademacs-73c8f64c94e2fbac653615eaade01028c2d7bce7.tar.gz
emacs-73c8f64c94e2fbac653615eaade01028c2d7bce7.zip
(mouse-drag-vertical-line-rightward-window): New function.
(mouse-drag-vertical-line): Call it.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mouse.el21
1 files changed, 20 insertions, 1 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index c399515a3d2..145eb76446f 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -529,6 +529,24 @@ resized by dragging their header-line."
529 (mouse-drag-mode-line-1 start-event nil)))) 529 (mouse-drag-mode-line-1 start-event nil))))
530 530
531 531
532(defun mouse-drag-vertical-line-rightward-window (window)
533 "Return a window that is immediately to the right of WINDOW, or nil."
534 (let ((bottom (nth 3 (window-inside-edges window)))
535 (left (nth 0 (window-inside-edges window)))
536 best best-right
537 (try (previous-window window)))
538 (while (not (eq try window))
539 (let ((try-top (nth 1 (window-inside-edges try)))
540 (try-bottom (nth 3 (window-inside-edges try)))
541 (try-right (nth 2 (window-inside-edges try))))
542 (if (and (< try-top bottom)
543 (>= try-bottom bottom)
544 (< try-right left)
545 (or (null best-right) (> try-right best-right)))
546 (setq best-right try-right best try)))
547 (setq try (previous-window try)))
548 best))
549
532(defun mouse-drag-vertical-line (start-event) 550(defun mouse-drag-vertical-line (start-event)
533 "Change the width of a window by dragging on the vertical line." 551 "Change the width of a window by dragging on the vertical line."
534 (interactive "e") 552 (interactive "e")
@@ -594,7 +612,8 @@ resized by dragging their header-line."
594 ;; adjust the window on the left. 612 ;; adjust the window on the left.
595 (if (eq which-side 'right) 613 (if (eq which-side 'right)
596 (selected-window) 614 (selected-window)
597 (previous-window)))) 615 (mouse-drag-vertical-line-rightward-window
616 (selected-window)))))
598 (setq x (- (car (cdr mouse)) 617 (setq x (- (car (cdr mouse))
599 (if (eq which-side 'right) 0 2)) 618 (if (eq which-side 'right) 0 2))
600 edges (window-edges window) 619 edges (window-edges window)