GNU bug report logs - #22009
Inconsistent handling of window splitting with margins

Previous Next

Package: emacs;

Reported by: Joost Kremers <joostkremers <at> fastmail.fm>

Date: Wed, 25 Nov 2015 13:08:01 UTC

Severity: normal

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Joost Kremers <joostkremers <at> fastmail.fm>
To: bug-gnu-emacs <at> gnu.org
Subject: PATCH: Use `window-total-width' in `window-splittable-p'
Date: Wed, 25 Nov 2015 14:07:27 +0100
[Message part 1 (text/plain, inline)]
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...


[0001-lisp-window.el-window-splittable-p-use-window-total-.patch (text/x-diff, inline)]
From 0fa1f344824530f9ee374cc0d84fa02b61b303bf Mon Sep 17 00:00:00 2001
From: Joost Kremers <joostkremers <at> 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

[Message part 3 (text/plain, inline)]
-- 
Joost Kremers
Life has its moments

This bug report was last modified 4 years and 261 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.