changeset 20652:9bdfab6be02f

(mldrag-drag-vertical-line): Handle left-side scroll bars.
author Richard M. Stallman <rms@gnu.org>
date Fri, 16 Jan 1998 19:11:33 +0000
parents 0de9f45a1db6
children 19ba67f153d5
files lisp/mldrag.el
diffstat 1 files changed, 26 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mldrag.el	Fri Jan 16 18:14:58 1998 +0000
+++ b/lisp/mldrag.el	Fri Jan 16 19:11:33 1998 +0000
@@ -153,17 +153,21 @@
 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 @@
 			   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 @@
 		     ;; 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))))