]> git.eshelyaron.com Git - emacs.git/commitdiff
* mouse.el (mouse-drag-vertical-line): Use window-inside-edges
authorChong Yidong <cyd@stupidchicken.com>
Thu, 16 Mar 2006 15:14:57 +0000 (15:14 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Thu, 16 Mar 2006 15:14:57 +0000 (15:14 +0000)
when checking for attempt to drag leftmost or rightmost scrollbar.

lisp/ChangeLog
lisp/mouse.el

index bdc6a497a148262494259dbe9fe91d0cd284d6e2..07a3e4488ab35717eac3699df3edb205ae08142f 100644 (file)
@@ -1,3 +1,8 @@
+2006-03-16  Martin Rudalics  <rudalics@gmx.at>
+
+       * mouse.el (mouse-drag-vertical-line): Use window-inside-edges
+       when checking for attempt to drag leftmost or rightmost scrollbar.
+
 2006-03-16  Nick Roberts  <nickrob@snap.net.nz>
 
        * progmodes/gdb-ui.el (gdb-inferior-status): New variable.
index 3a22fb49b045c837d157e7c8e427861d132d9db2..c399515a3d2f46a5484236b796936a90475e5338 100644 (file)
@@ -538,19 +538,20 @@ resized by dragging their header-line."
         (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))
         event mouse x left right edges wconfig growth
         (which-side
          (or (cdr (assq 'vertical-scroll-bars (frame-parameters start-event-frame)))
              'right)))
-    (if (one-window-p t)
-       (error "Attempt to resize sole ordinary window"))
-    (if (eq which-side 'right)
-       (if (= (nth 2 (window-edges start-event-window))
-              (frame-width start-event-frame))
-           (error "Attempt to drag rightmost scrollbar"))
-      (if (= (nth 0 (window-edges start-event-window)) 0)
-         (error "Attempt to drag leftmost scrollbar")))
+    (cond
+     ((one-window-p t)
+      (error "Attempt to resize sole ordinary window"))
+     ((and (eq which-side 'right)
+          (>= (nth 2 (window-inside-edges start-event-window))
+              (frame-width start-event-frame)))
+      (error "Attempt to drag rightmost scrollbar"))
+     ((and (eq which-side 'left)
+          (= (nth 0 (window-inside-edges start-event-window)) 0))
+      (error "Attempt to drag leftmost scrollbar")))
     (track-mouse
       (progn
        ;; enlarge-window only works on the selected window, so