From: Richard M. Stallman Date: Fri, 16 Jan 1998 19:11:33 +0000 (+0000) Subject: (mldrag-drag-vertical-line): Handle left-side scroll bars. X-Git-Tag: emacs-20.3~2422 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a1d4421658d037c49d4fcfe5e52c921eacacef57;p=emacs.git (mldrag-drag-vertical-line): Handle left-side scroll bars. --- diff --git a/lisp/mldrag.el b/lisp/mldrag.el index 45a10c2e18c..d7090623767 100644 --- a/lisp/mldrag.el +++ b/lisp/mldrag.el @@ -153,17 +153,21 @@ usefully bound with the `vertical-line' or the `vertical-scroll-bar' prefix. Holding down a mouse button and moving the mouse left and right will make the clicked-on window thinner or wider." (interactive "e") - (let ((done nil) - (echo-keystrokes 0) - (start-event-frame (window-frame (car (car (cdr start-event))))) - (start-event-window (car (car (cdr start-event)))) - (start-nwindows (count-windows t)) - (old-selected-window (selected-window)) - event mouse x left right edges wconfig growth) + (let* ((done nil) + (echo-keystrokes 0) + (start-event-frame (window-frame (car (car (cdr start-event))))) + (scroll-bar-left + (eq (cdr (assq 'vertical-scroll-bars (frame-parameters))) 'left)) + (start-event-window (car (car (cdr start-event)))) + (start-nwindows (count-windows t)) + (old-selected-window (selected-window)) + event mouse x left right edges wconfig growth) (if (one-window-p t) (error "Attempt to resize sole ordinary window")) - (if (= (nth 2 (window-edges start-event-window)) - (frame-width start-event-frame)) + (if (if scroll-bar-left + (= (nth 2 (window-edges start-event-window)) + (frame-width start-event-frame)) + (= (nth 0 (window-edges start-event-window)) 0)) (error "Attempt to drag rightmost scrollbar")) (unwind-protect (track-mouse @@ -204,13 +208,20 @@ right will make the clicked-on window thinner or wider." edges (window-edges) left (nth 0 edges) right (nth 2 edges)) + (setq foo (cons (list x left) foo)) ;; scale back a move that would make the ;; window too thin. - (cond ((< (- x left -1) window-min-width) - (setq x (+ left window-min-width -1)))) + (if scroll-bar-left + (cond ((< (- right x) window-min-width) + (setq x (- right window-min-width)))) + (cond ((< (- x left -1) window-min-width) + (setq x (+ left window-min-width -1))))) ;; compute size change needed - (setq growth (- x right -1) + (setq growth (if scroll-bar-left + (- left x) + (- x right -1)) wconfig (current-window-configuration)) + (message "%s" growth) (enlarge-window growth t) ;; if this window's growth caused another ;; window to be deleted because it was too @@ -220,7 +231,9 @@ right will make the clicked-on window thinner or wider." ;; from a window to the left of this one, ;; rescind the change. (if (or (/= start-nwindows (count-windows t)) - (/= left (nth 0 (window-edges)))) + (if scroll-bar-left + (/= right (nth 2 (window-edges))) + (/= left (nth 0 (window-edges))))) (set-window-configuration wconfig))))))) ;; restore the old selected window (select-window old-selected-window))))