unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22009: PATCH: Use `window-total-width' in `window-splittable-p'
@ 2015-11-25 13:07 Joost Kremers
  2015-11-25 17:48 ` martin rudalics
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Joost Kremers @ 2015-11-25 13:07 UTC (permalink / raw)
  To: 22009

[-- Attachment #1: Type: text/plain, Size: 554 bytes --]


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...



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-window.el-window-splittable-p-use-window-total-.patch --]
[-- Type: text/x-diff, Size: 992 bytes --]

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


[-- Attachment #3: Type: text/plain, Size: 40 bytes --]


-- 
Joost Kremers
Life has its moments

^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2020-09-08 10:05 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-25 13:07 bug#22009: PATCH: Use `window-total-width' in `window-splittable-p' Joost Kremers
2015-11-25 17:48 ` martin rudalics
2015-11-25 18:04   ` Eli Zaretskii
2015-11-25 18:14     ` martin rudalics
2015-11-25 19:15       ` Eli Zaretskii
2015-11-26  8:23         ` martin rudalics
2015-11-26 15:46           ` Eli Zaretskii
2015-11-26 16:58             ` martin rudalics
2015-11-26 17:25               ` Eli Zaretskii
2015-11-26 18:06                 ` martin rudalics
2015-11-26 18:36                   ` Eli Zaretskii
2015-11-27  8:27                     ` martin rudalics
2015-11-27 20:51                       ` Eli Zaretskii
2015-11-28 10:26                         ` martin rudalics
2015-11-28 14:49                           ` Eli Zaretskii
2015-11-28 15:49                             ` martin rudalics
2015-12-01 12:47                           ` Joost Kremers
2015-11-27  1:16 ` Joost Kremers
2015-11-27  8:28   ` martin rudalics
2015-12-01 14:11     ` Joost Kremers
2015-11-27 20:56   ` Eli Zaretskii
2015-12-01 12:59     ` Joost Kremers
2015-12-01 15:44       ` Eli Zaretskii
2015-12-01 17:31         ` Joost Kremers
2020-09-07 16:48 ` Lars Ingebrigtsen
2020-09-08  8:50   ` Joost Kremers
2020-09-08 10:05     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).