aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1998-01-16 19:11:33 +0000
committerRichard M. Stallman1998-01-16 19:11:33 +0000
commita1d4421658d037c49d4fcfe5e52c921eacacef57 (patch)
tree2a05848b1270ab642bde842380f658407b616a46 /lisp
parent1354debd3fb91420cee66c7c6d2865ee9e673a6a (diff)
downloademacs-a1d4421658d037c49d4fcfe5e52c921eacacef57.tar.gz
emacs-a1d4421658d037c49d4fcfe5e52c921eacacef57.zip
(mldrag-drag-vertical-line): Handle left-side scroll bars.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mldrag.el39
1 files changed, 26 insertions, 13 deletions
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'
153prefix. Holding down a mouse button and moving the mouse left and 153prefix. Holding down a mouse button and moving the mouse left and
154right will make the clicked-on window thinner or wider." 154right will make the clicked-on window thinner or wider."
155 (interactive "e") 155 (interactive "e")
156 (let ((done nil) 156 (let* ((done nil)
157 (echo-keystrokes 0) 157 (echo-keystrokes 0)
158 (start-event-frame (window-frame (car (car (cdr start-event))))) 158 (start-event-frame (window-frame (car (car (cdr start-event)))))
159 (start-event-window (car (car (cdr start-event)))) 159 (scroll-bar-left
160 (start-nwindows (count-windows t)) 160 (eq (cdr (assq 'vertical-scroll-bars (frame-parameters))) 'left))
161 (old-selected-window (selected-window)) 161 (start-event-window (car (car (cdr start-event))))
162 event mouse x left right edges wconfig growth) 162 (start-nwindows (count-windows t))
163 (old-selected-window (selected-window))
164 event mouse x left right edges wconfig growth)
163 (if (one-window-p t) 165 (if (one-window-p t)
164 (error "Attempt to resize sole ordinary window")) 166 (error "Attempt to resize sole ordinary window"))
165 (if (= (nth 2 (window-edges start-event-window)) 167 (if (if scroll-bar-left
166 (frame-width start-event-frame)) 168 (= (nth 2 (window-edges start-event-window))
169 (frame-width start-event-frame))
170 (= (nth 0 (window-edges start-event-window)) 0))
167 (error "Attempt to drag rightmost scrollbar")) 171 (error "Attempt to drag rightmost scrollbar"))
168 (unwind-protect 172 (unwind-protect
169 (track-mouse 173 (track-mouse
@@ -204,13 +208,20 @@ right will make the clicked-on window thinner or wider."
204 edges (window-edges) 208 edges (window-edges)
205 left (nth 0 edges) 209 left (nth 0 edges)
206 right (nth 2 edges)) 210 right (nth 2 edges))
211 (setq foo (cons (list x left) foo))
207 ;; scale back a move that would make the 212 ;; scale back a move that would make the
208 ;; window too thin. 213 ;; window too thin.
209 (cond ((< (- x left -1) window-min-width) 214 (if scroll-bar-left
210 (setq x (+ left window-min-width -1)))) 215 (cond ((< (- right x) window-min-width)
216 (setq x (- right window-min-width))))
217 (cond ((< (- x left -1) window-min-width)
218 (setq x (+ left window-min-width -1)))))
211 ;; compute size change needed 219 ;; compute size change needed
212 (setq growth (- x right -1) 220 (setq growth (if scroll-bar-left
221 (- left x)
222 (- x right -1))
213 wconfig (current-window-configuration)) 223 wconfig (current-window-configuration))
224 (message "%s" growth)
214 (enlarge-window growth t) 225 (enlarge-window growth t)
215 ;; if this window's growth caused another 226 ;; if this window's growth caused another
216 ;; window to be deleted because it was too 227 ;; window to be deleted because it was too
@@ -220,7 +231,9 @@ right will make the clicked-on window thinner or wider."
220 ;; from a window to the left of this one, 231 ;; from a window to the left of this one,
221 ;; rescind the change. 232 ;; rescind the change.
222 (if (or (/= start-nwindows (count-windows t)) 233 (if (or (/= start-nwindows (count-windows t))
223 (/= left (nth 0 (window-edges)))) 234 (if scroll-bar-left
235 (/= right (nth 2 (window-edges)))
236 (/= left (nth 0 (window-edges)))))
224 (set-window-configuration wconfig))))))) 237 (set-window-configuration wconfig)))))))
225 ;; restore the old selected window 238 ;; restore the old selected window
226 (select-window old-selected-window)))) 239 (select-window old-selected-window))))