From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#22009: PATCH: Use `window-total-width' in `window-splittable-p' Date: Thu, 26 Nov 2015 17:58:10 +0100 Message-ID: <56573A22.6070309@gmx.at> References: <87io4qgrcg.fsf@fastmail.fm> <5655F45F.4050406@gmx.at> <83vb8qvttj.fsf@gnu.org> <5655FAA2.80406@gmx.at> <83k2p5x54k.fsf@gnu.org> <5656C171.9050506@gmx.at> <83r3jcvk4l.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1448557166 20777 80.91.229.3 (26 Nov 2015 16:59:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Nov 2015 16:59:26 +0000 (UTC) Cc: joostkremers@fastmail.fm, 22009@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 26 17:59:14 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a1zsy-00081K-2M for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Nov 2015 17:59:08 +0100 Original-Received: from localhost ([::1]:52281 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1zt0-00054W-Eu for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Nov 2015 11:59:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1zsv-00051G-Oi for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2015 11:59:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1zss-0002cA-Gz for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2015 11:59:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1zss-0002bO-97 for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2015 11:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a1zsr-00006c-TE for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2015 11:59:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Nov 2015 16:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22009 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22009-submit@debbugs.gnu.org id=B22009.1448557105334 (code B ref 22009); Thu, 26 Nov 2015 16:59:01 +0000 Original-Received: (at 22009) by debbugs.gnu.org; 26 Nov 2015 16:58:25 +0000 Original-Received: from localhost ([127.0.0.1]:54527 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a1zsG-00005J-QY for submit@debbugs.gnu.org; Thu, 26 Nov 2015 11:58:25 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:52023) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a1zsE-00005B-K1 for 22009@debbugs.gnu.org; Thu, 26 Nov 2015 11:58:23 -0500 Original-Received: from [192.168.1.100] ([213.162.68.43]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0Lurin-1aSIHY418D-01083w; Thu, 26 Nov 2015 17:58:18 +0100 In-Reply-To: <83r3jcvk4l.fsf@gnu.org> X-Provags-ID: V03:K0:WKesVd+7O3L9FXKsImOmn+8hhB7c+Cq5CJptJ+fUFBMRtDyEjqq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ugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:109297 Archived-At: > I agree with the asymmetry observation, but I think that the width > check is the one that gets it right, while the height check is wrong > and should be corrected. When a window is split horizontally, the > part that gets split is the text area, not the margins -- those stay > at their original size. Note that =E2=80=98window-splittable-p=E2=80=99 is exclusively used by =E2= =80=98display-buffer=E2=80=99 and the probability is very high that the new window will not be used for displaying the buffer of the original window. The new window will very likely have its own margins and header line. > So when we decide whether to split > vertically, =2E.. horizontally ... > we should consider the text-area size, not the total size. > Otherwise, we can easily wind up in situations where, due to large > margins, a window is split horizontally and the width of its text area= > becomes ridiculously small. This is a problem that bites us much more with =E2=80=98split-window=E2=80= =99 than with =E2=80=98display-buffer=E2=80=99. As a matter of fact it has been alread= y addressed in one of the present threads discussing margins. My opinion is that modes that manage wide margins have to handle this in the hooks called when windows are split, deleted or resized. They also calculate the size of the margins based on the current window width when they get activated. > Therefore, I think we should document that split-width-threshold and > window-min-width refer to the width of the text area, and if there are= > functions in window.el that compare them with window-total-width, > those places need to be fixed, not this one. We should also fix the > height check in window-splittable-p. =E2=80=98window-min-width=E2=80=99 (and all related variables and functio= ns) refer to the total width of windows. Changing its semantics would constitute quite some effort. > The modes that triggered this are special in that they adapt their > margins to the split, but how would window-splittable-p know that? > Perhaps such modes should override that function, or maybe we should > provide a hook for them? This is not mode-triggered. =E2=80=98window-splittable-p=E2=80=99 is use= d by =E2=80=98display-buffer=E2=80=99 to find the place for displaying *help*,= *info*, *completions*, ... >> BTW: Bug#5944 is about a related issue. I never got around to resolv= e >> it for a similar reason. > > Did you really mean 5944? That's not an Emacs bug even. It's bug#17065, which talks about line 5944 of window.el. And I think you might agree with the poster ;-) martin