bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22009: PATCH: Use `window-total-width' in `window-splittable-p'


From: Joost Kremers
Subject: bug#22009: PATCH: Use `window-total-width' in `window-splittable-p'
Date: Wed, 25 Nov 2015 14:07:27 +0100
User-agent: mu4e 0.9.13; emacs 24.5.50.1

Following discussion on emacs-devel (thread "Window splitting issues
with margins"), this patch replaces the call to `window-width' in
`window-splittable-p' with `window-total-width'. This takes the window
margins into account when determining if a window can be split
horizontally.

Note: a similar change to `window-height' isn't necessary, because
`window-height' is an alias for `window-total-height'. (Whereas
`window-width' is an alias for `window-body-width'.)

BTW: this is my first patch. I have no idea if I got all the conventions
right...


>From 0fa1f344824530f9ee374cc0d84fa02b61b303bf Mon Sep 17 00:00:00 2001
From: Joost Kremers <joostkremers@fastmail.fm>
Date: Wed, 25 Nov 2015 13:36:06 +0100
Subject: [PATCH] * lisp/window.el (window-splittable-p): use
 `window-total-width'

Take the window margins into account when determining if a window can be
split horizontally.

Copyright-paperwork-exempt: yes
---
 lisp/window.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/window.el b/lisp/window.el
index 6d18905..bcd8922 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -6115,7 +6115,7 @@ window-splittable-p
               ;; sense nowadays.  This can be done more intuitively by
               ;; setting up `split-width-threshold' appropriately.
               (numberp split-width-threshold)
-              (>= (window-width window)
+              (>= (window-total-width window)
                   (max split-width-threshold
                        (* 2 (max window-min-width 2)))))
        ;; A window can be split vertically when its height is not
-- 
2.6.0.GIT

-- 
Joost Kremers
Life has its moments

reply via email to

[Prev in Thread] Current Thread [Next in Thread]