aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Ponce2004-10-18 09:29:59 +0000
committerDavid Ponce2004-10-18 09:29:59 +0000
commit7a892a8bff50e1156b008f8ca9e5cb4c9df47436 (patch)
treedacbb7a14c0d5e05742b5de4847c2a22f132d8f1
parente14105f6fa9ce465dd171f753abec2a7f5e4b61d (diff)
downloademacs-7a892a8bff50e1156b008f8ca9e5cb4c9df47436.tar.gz
emacs-7a892a8bff50e1156b008f8ca9e5cb4c9df47436.zip
(mouse-drag-move-window-top): New function.
(mouse-drag-mode-line-1): Use it.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/mouse.el15
2 files changed, 19 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a3fb778928c..eaa71c4abad 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12004-10-18 David Ponce <david@dponce.com>
2
3 * mouse.el (mouse-drag-move-window-top): New function.
4 (mouse-drag-mode-line-1): Use it.
5
12004-10-18 Thien-Thi Nguyen <ttn@gnu.org> 62004-10-18 Thien-Thi Nguyen <ttn@gnu.org>
2 7
3 * info.el (Info-fontify-node): For multiline refs, 8 * info.el (Info-fontify-node): For multiline refs,
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 0a6499e5c09..abf62a97836 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -338,6 +338,17 @@ shrink the window or windows above it to make room."
338 (select-window window) 338 (select-window window)
339 (enlarge-window growth nil (> growth 0)))) 339 (enlarge-window growth nil (> growth 0))))
340 340
341(defsubst mouse-drag-move-window-top (window growth)
342 "Move the top of WINDOW up or down by GROWTH lines.
343Move it down if GROWTH is positive, or up if GROWTH is negative.
344If this would make WINDOW too short, shrink the window or windows
345above it to make room."
346 ;; Moving the top of WINDOW is actually moving the bottom of the
347 ;; window above.
348 (let ((window-above (mouse-drag-window-above window)))
349 (and window-above
350 (mouse-drag-move-window-bottom window-above (- growth)))))
351
341(defun mouse-drag-mode-line-1 (start-event mode-line-p) 352(defun mouse-drag-mode-line-1 (start-event mode-line-p)
342 "Change the height of a window by dragging on the mode or header line. 353 "Change the height of a window by dragging on the mode or header line.
343START-EVENT is the starting mouse-event of the drag action. 354START-EVENT is the starting mouse-event of the drag action.
@@ -444,7 +455,9 @@ MODE-LINE-P non-nil means dragging a mode line; nil means a header line."
444 (select-window start-event-window)) 455 (select-window start-event-window))
445 ;; no. grow/shrink the selected window 456 ;; no. grow/shrink the selected window
446 ;(message "growth = %d" growth) 457 ;(message "growth = %d" growth)
447 (mouse-drag-move-window-bottom start-event-window growth)) 458 (if mode-line-p
459 (mouse-drag-move-window-bottom start-event-window growth)
460 (mouse-drag-move-window-top start-event-window growth)))
448 461
449 ;; if this window's growth caused another 462 ;; if this window's growth caused another
450 ;; window to be deleted because it was too 463 ;; window to be deleted because it was too