diff options
| author | Richard M. Stallman | 2005-12-12 05:21:33 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-12-12 05:21:33 +0000 |
| commit | 4199d5be3e91af4dbb1f1d4a665df6162e615a07 (patch) | |
| tree | 712a83814751bf80c5fe8261d9f7bd5f6df89361 | |
| parent | 658e7a9fc51aee12dd0035ea772178ae93118ca3 (diff) | |
| download | emacs-4199d5be3e91af4dbb1f1d4a665df6162e615a07.tar.gz emacs-4199d5be3e91af4dbb1f1d4a665df6162e615a07.zip | |
(mouse-drag-vertical-line): Use adjust-window-trailing-edge.
| -rw-r--r-- | lisp/mouse.el | 30 |
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." | |||
| 594 | ((null (car (cdr mouse))) | 594 | ((null (car (cdr mouse))) |
| 595 | nil) | 595 | nil) |
| 596 | (t | 596 | (t |
| 597 | (save-selected-window | 597 | (let ((window |
| 598 | ;; If the scroll bar is on the window's left, | 598 | ;; If the scroll bar is on the window's left, |
| 599 | ;; adjust the window on the left. | 599 | ;; adjust the window on the left. |
| 600 | (unless (eq which-side 'right) | 600 | (if (eq which-side 'right) |
| 601 | (select-window (previous-window))) | 601 | (selected-window) |
| 602 | (previous-window)))) | ||
| 602 | (setq x (- (car (cdr mouse)) | 603 | (setq x (- (car (cdr mouse)) |
| 603 | (if (eq which-side 'right) 0 2)) | 604 | (if (eq which-side 'right) 0 2)) |
| 604 | edges (window-edges) | 605 | edges (window-edges window) |
| 605 | left (nth 0 edges) | 606 | left (nth 0 edges) |
| 606 | right (nth 2 edges)) | 607 | right (nth 2 edges)) |
| 607 | ;; scale back a move that would make the | 608 | ;; scale back a move that would make the |
| @@ -609,19 +610,10 @@ resized by dragging their header-line." | |||
| 609 | (if (< (- x left -1) window-min-width) | 610 | (if (< (- x left -1) window-min-width) |
| 610 | (setq x (+ left window-min-width -1))) | 611 | (setq x (+ left window-min-width -1))) |
| 611 | ;; compute size change needed | 612 | ;; compute size change needed |
| 612 | (setq growth (- x right -1) | 613 | (setq growth (- x right -1)) |
| 613 | wconfig (current-window-configuration)) | 614 | (condition-case nil |
| 614 | (enlarge-window growth t) | 615 | (adjust-window-trailing-edge window growth t) |
| 615 | ;; if this window's growth caused another | 616 | (error nil)))))))))) |
| 616 | ;; window to be deleted because it was too | ||
| 617 | ;; thin, rescind the change. | ||
| 618 | ;; | ||
| 619 | ;; if size change caused space to be stolen | ||
| 620 | ;; from a window to the left of this one, | ||
| 621 | ;; rescind the change. | ||
| 622 | (if (or (/= start-nwindows (count-windows t)) | ||
| 623 | (/= left (nth 0 (window-edges)))) | ||
| 624 | (set-window-configuration wconfig)))))))))) | ||
| 625 | 617 | ||
| 626 | (defun mouse-set-point (event) | 618 | (defun mouse-set-point (event) |
| 627 | "Move point to the position clicked on with the mouse. | 619 | "Move point to the position clicked on with the mouse. |