From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#14825: 24.3.50; split-window-below miscounts window lines Date: Fri, 12 Jul 2013 16:29:15 +0300 Message-ID: <837ggv6h5g.fsf@gnu.org> References: <83hag5vszy.fsf@gnu.org> <51DBD33D.4000307@gmx.at> <83bo6bww40.fsf@gnu.org> <51DD0B31.8000901@gmx.at> <83obaav2ug.fsf@gnu.org> <51DE504E.2010804@gmx.at> <834nc1uji4.fsf@gnu.org> <51DFBC95.5040207@gmx.at> <83ehb45eli.fsf@gnu.org> <51DFD6A1.4010904@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1373635870 26407 80.91.229.3 (12 Jul 2013 13:31:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Jul 2013 13:31:10 +0000 (UTC) Cc: 14825@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 12 15:31:10 2013 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 1UxdRG-0000yu-JD for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Jul 2013 15:31:10 +0200 Original-Received: from localhost ([::1]:40892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxdRG-0006Uk-7F for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Jul 2013 09:31:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxdRD-0006Ue-8T for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2013 09:31:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UxdRB-0002lO-J7 for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2013 09:31:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxdRB-0002lI-FB for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2013 09:31:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UxdRA-0000jQ-9j for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2013 09:31:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Jul 2013 13:31:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14825 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14825-submit@debbugs.gnu.org id=B14825.13736358062714 (code B ref 14825); Fri, 12 Jul 2013 13:31:03 +0000 Original-Received: (at 14825) by debbugs.gnu.org; 12 Jul 2013 13:30:06 +0000 Original-Received: from localhost ([127.0.0.1]:50035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UxdQB-0000hW-Sr for submit@debbugs.gnu.org; Fri, 12 Jul 2013 09:30:05 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:55277) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UxdQ6-0000gr-Rt for 14825@debbugs.gnu.org; Fri, 12 Jul 2013 09:30:00 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MPT00400RWINS00@a-mtaout23.012.net.il> for 14825@debbugs.gnu.org; Fri, 12 Jul 2013 16:29:20 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MPT004JVS4VHR80@a-mtaout23.012.net.il>; Fri, 12 Jul 2013 16:29:20 +0300 (IDT) In-reply-to: <51DFD6A1.4010904@gmx.at> X-012-Sender: halo1@inter.net.il 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: 140.186.70.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:76280 Archived-At: > Date: Fri, 12 Jul 2013 12:12:49 +0200 > From: martin rudalics > CC: 14825@debbugs.gnu.org > > > Yes, I know. But note that this extended explanation is also > > misleading, because it silently assumes that the default face was not > > remapped. If the default face _is_ remapped, then "the frame's > > default font" is ambiguous at best, since '(face-font 'default)' will > > return a font whose size is not the one meant by the above > > description. > > Much, much worse: The description implies that a frame and its windows > (and its scrollbars, fringes, toolbars) have to be resized when the > default face changes (no remapping involved). ??? How do you change the default face's font of a live frame without remapping it? > > Yes, but it's not only about the default face. Did you try setting > > line-spacing to something non-nil lately? Try it: it's a lot of fun > > looking at what window-text-height and its ilk return in that case. > > I'll do as soon as I'm able to build. On my present, old build I don't > see anything abnormal. Does window-text-height still reports the actual number of text lines in a window? > >> Now if the window is the only one on its frame, you would have to change > >> the frame's nominal height as well > > > > The number of lines in the frame does not necessarily need to change, > > because a frame has other elements, even if it has only one window -- > > the mode line, > > ... the mode line belongs to the window (albeit in some different font) > ... Not just font: it's an entirely different face, which has a box attribute, and therefore different dimensions even if the same font is being used as in the text area. > > the menu bar, the tool bar, etc. What matters is the > > root window, not the frame. So we can still measure a frame in > > canonical units. > > This means that you no more have sensible means to compare the > sizes and positions of windows with those of their frames. Why do you need to? Isn't the root window enough? > >> If OTOH the frame contains more than one window, we would have a > >> hard time to relate the height of these windows to that of the > >> frame. > > > > The only reliable way of doing that is in pixels anyway. > > Currently it's done in lines and columns. Which is why we don't need to bother that it will become unreliable, as it is already there. > >> Lifting the present relationship without providing a viable alternative > >> would be a misconception IMO. > > > > That's why I suggested to introduce a separate set of APIs. > > What would their specification look like? Similar to the ones we have now, except they will take the font and line-spacing into account. > > . Say in the doc strings of all these functions that their return > > values should NOT be used to count lines or columns of text in a > > window; > > In the doc-strings of `split-height-threshold' or `window-min-height'? As long as we leave them as they are, yes. > > . Add a separate set of APIs for counting the number of default-face > > text lines and characters in a window. > > I don't understand: Would `window-text-height' be part of this set? Or > would I have to write `window-default-text-height'? We would have one that counts in canonical lines, the other that counts in lines of the current default face. > Maybe you could enumerate two or three existing functions You already did above. > and tell me what they currently do wrong and what they or their > counterparts in the new API would have to do instead. I was doing that since the beginning of this bug report. I obviously completely failed.