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#18195: 24.3.92; window-screen-lines is not accurate Date: Tue, 05 Aug 2014 14:20:58 +0200 Message-ID: <53E0CC2A.7040801@gmx.at> References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> <53E0B0FB.3080203@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1407241419 26823 80.91.229.3 (5 Aug 2014 12:23:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Aug 2014 12:23:39 +0000 (UTC) To: Dmitry Gutov , 18195@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 05 14:23:33 2014 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 1XEdm2-0007kt-Ch for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Aug 2014 14:23:26 +0200 Original-Received: from localhost ([::1]:59141 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEdm1-0002pX-Tu for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Aug 2014 08:23:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEdko-0001He-Ed for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 08:22:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEdkg-0003L6-W6 for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 08:22:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEdkg-0003L0-Tr for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 08:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XEdkg-0007f9-DY for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 08:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Aug 2014 12:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18195 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18195-submit@debbugs.gnu.org id=B18195.140724127629388 (code B ref 18195); Tue, 05 Aug 2014 12:22:02 +0000 Original-Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 12:21:16 +0000 Original-Received: from localhost ([127.0.0.1]:58328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEdjv-0007dt-3n for submit@debbugs.gnu.org; Tue, 05 Aug 2014 08:21:15 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:64760) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEdjs-0007dc-0L for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 08:21:12 -0400 Original-Received: from [93.82.13.132] ([93.82.13.132]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0Ldcv0-1WX5m12Q5K-00ihBH; Tue, 05 Aug 2014 14:21:03 +0200 In-Reply-To: <53E0B0FB.3080203@yandex.ru> X-Provags-ID: V03:K0:MRU77MKZqzP+nJQDO/6ncBR01rupJ1QSm7lfMi19FNPfMPyzDiv qZj9ErLrMT7150yfpcgAIWFWTx98SDmSfboVssvznoxaXpzUT1zWMieIJZUfl+n3zR3hsYb PmALRmMKhCZUbRhUS2ZwKRjT32QPHFQDKStMeZ9CkQgr+1ktu/AWYsLDzB21xk+nI0PyYKJ h8xjZW7LZD6SMJQl/vu+A== 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:92129 Archived-At: > It won't help to determine how much space is left below the current line if the current line is the last in the buffer but not in the window, right? You have to calculate the height of the text from window start till the end of the buffer and subtract the result from the window's text height. > > `window-text-height' with PIXELWISE t should give you the overall > > height of the window. > > `count-screen-lines' already helps with "space above the current line", and we can find out the total height of the window in pixels. So if I'm going to do the arithmetics myself, the one thing missing is the accurate value of the height of a line in the buffer. `count-screen-lines' doesn't return a pixel value. How do you get that with lines of different heights and line spacing? > How do I obtain it (let's consider it mostly-constant)? > >> If things like line spacing are involved you really should calculate >> pixelwise. > > The docstring of `window-screen-lines' seems to claim that it's suitable. The implementation looks kinda right, too, but the result it returns is not accurate. It again just returns a line value. IIRC someone has set the font size to 1 pixel to make this return something reasonable. But why do all these acrobatics? `window-text-pixel-size' should give you everything you need in a uniform way. And if something's missing we can easily add it. martin