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#18195: 24.3.92; window-screen-lines is not accurate Date: Tue, 05 Aug 2014 16:57:21 +0300 Message-ID: <83zjfjox8e.fsf@gnu.org> References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> <53E0B0FB.3080203@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1407247117 3627 80.91.229.3 (5 Aug 2014 13:58:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Aug 2014 13:58:37 +0000 (UTC) Cc: 18195@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 05 15:58:29 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 1XEfFp-0008Qk-On for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Aug 2014 15:58:17 +0200 Original-Received: from localhost ([::1]:59574 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEfFp-0006N1-Dg for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Aug 2014 09:58:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEfFh-0006M3-7K for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 09:58:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEfFa-0003MT-RO for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 09:58:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEfFa-0003MP-OM for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 09:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XEfFa-0001no-7h for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 09:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Aug 2014 13:58: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.14072470416875 (code B ref 18195); Tue, 05 Aug 2014 13:58:02 +0000 Original-Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 13:57:21 +0000 Original-Received: from localhost ([127.0.0.1]:58757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfEu-0001mm-Ql for submit@debbugs.gnu.org; Tue, 05 Aug 2014 09:57:21 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:39292) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfEr-0001mY-E4 for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 09:57:18 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0N9U00C0065W2N00@mtaout24.012.net.il> for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 16:53:02 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9U0032M6KEA2B0@mtaout24.012.net.il>; Tue, 05 Aug 2014 16:53:02 +0300 (IDT) In-reply-to: <53E0B0FB.3080203@yandex.ru> 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:92135 Archived-At: > Date: Tue, 05 Aug 2014 14:24:59 +0400 > From: Dmitry Gutov > > `count-screen-lines' already helps with "space above the current line", > and we can find out the total height of the window in pixels. How do you convert the line count returned by count-screen-lines into pixels, if the lines are of non-constant height. Also note the caveats in the doc string of that function: the value is not 100% reliable. > 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. Line of what font? > 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 is accurate now. But, as I wrote elsewhere in this thread, that will only solve some of your problems. In general, we don't support layout of arbitrary text from Lisp.