comparison lisp/mouse.el @ 67524:9014ad13a926

(mouse-drag-vertical-line): Use adjust-window-trailing-edge.
author Richard M. Stallman <rms@gnu.org>
date Mon, 12 Dec 2005 05:21:33 +0000
parents 2c91c2e7af3a
children 01ba52243e5f
comparison
equal deleted inserted replaced
67523:81c5a29b3800 67524:9014ad13a926
592 ((not (eq (car mouse) start-event-frame)) 592 ((not (eq (car mouse) start-event-frame))
593 nil) 593 nil)
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
608 ;; window too thin. 609 ;; window too thin.
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.
628 This should be bound to a mouse click event type." 620 This should be bound to a mouse click event type."
629 (interactive "e") 621 (interactive "e")