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 19:06:07 +0100 Message-ID: <56574A0F.101@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> <56573A22.6070309@gmx.at> <8337vsvfj6.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 1448561247 21252 80.91.229.3 (26 Nov 2015 18:07:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Nov 2015 18:07:27 +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 19:07:12 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 1a20wl-0003qI-Oc for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Nov 2015 19:07:08 +0100 Original-Received: from localhost ([::1]:52669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a20wn-0001zZ-TT for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Nov 2015 13:07:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a20wk-0001zQ-49 for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2015 13:07:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a20wg-0002p3-Sp for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2015 13:07:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36708) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a20wg-0002oz-PI for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2015 13:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a20wg-0001r5-D7 for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2015 13:07:02 -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 18:07:02 +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.14485611817077 (code B ref 22009); Thu, 26 Nov 2015 18:07:02 +0000 Original-Received: (at 22009) by debbugs.gnu.org; 26 Nov 2015 18:06:21 +0000 Original-Received: from localhost ([127.0.0.1]:54649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a20w1-0001q5-38 for submit@debbugs.gnu.org; Thu, 26 Nov 2015 13:06:21 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:50647) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a20vz-0001pw-6b for 22009@debbugs.gnu.org; Thu, 26 Nov 2015 13:06:19 -0500 Original-Received: from [192.168.1.100] ([213.162.68.43]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0LwF9u-1aOg3c3GaU-0186HG; Thu, 26 Nov 2015 19:06:14 +0100 In-Reply-To: <8337vsvfj6.fsf@gnu.org> X-Provags-ID: V03:K0:stw+vTGVzW25i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rHJuSDvX X-BeenThere: debbugs-submit@debbugs.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:109306 Archived-At: >> Note that =E2=80=98window-splittable-p=E2=80=99 is exclusively used b= y =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 wil= l >> very likely have its own margins and header line. > > Is it forbidden to call that function from any other Lisp? If so, > disregard what I wrote. But if not, window-splittable-p should do a > correct job no matter who calls it, do you agree? Presently =E2=80=98window-splittable-p=E2=80=99 is misnamed and I think t= hat's the main cause of the confusion. But its doc-string clearly names =E2=80=98split-window-sensibly=E2=80=99 as the caller (which is misnamed = as well but all of these were written before =E2=80=98display-buffer=E2=80=99 was reorgan= ized). In any case both functions belong exclusively to =E2=80=98display-buffer=E2=80=99= and are not related to C-x 3. > My text that you quoted here talks about the "normal" case, where the > margins stay put upon splitting windows. I'm saying that in such a > situation a decision made using the total width could be terribly > wrong. But the "normal" case where this happens is C-x 3 and there the mode that created the large margins should adapt. >> =E2=80=98window-min-width=E2=80=99 (and all related variables and fun= ctions) refer to >> the total width of windows. Changing its semantics would constitute >> quite some effort. > > If it's complicated, let's do that on master. But do it we must, IMO.= Basically it would amount to =E2=80=98split-window-horizontally=E2=80=99 = telling us that it can't split the window. Which might not be the intention of the user who expects the margins (whose sole purpose is to center the text in the window) to shrink accordingly. But honestly I don't know which implications changing the semantics of =E2=80=98window-min-width=E2=80=99 could have. I could imagine adding a = new option say =E2=80=98window-min-text-width=E2=80=99 and have the resizing routines re= spect this as far as possible. But sanitizing window sizes when, for example, making a frame very small, would have to ignore such an option anyway. The text area is the only part I can freely shrink and enlarge down to one line and two columns. I cannot restore previous fringes, margins and scroll bars once I have shrunk them because I don't remember their previous size. And adding for every window a slot, say previous_left_fringe_width, remembering it in window configurations, setting it when a user sets =E2=80=98set-window-fringes=E2=80=99 in between is something I'm not incl= ined to do. >> > The modes that triggered this are special in that they adapt thei= r >> > margins to the split, but how would window-splittable-p know that= ? >> > Perhaps such modes should override that function, or maybe we sho= uld >> > provide a hook for them? >> >> This is not mode-triggered. > > In my text, "this" referred to this bug report. If you mean that a mode introducing large margins should override =E2=80=98split-window-sensibly=E2=80=99 then this is not TRT. =E2=80=98s= plit-window-sensibly=E2=80=99 is user territory and =E2=80=98window-splittable-p=E2=80=99 too. martin