From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#18195: 24.3.92; window-screen-lines is not accurate Date: Tue, 05 Aug 2014 14:24:59 +0400 Message-ID: <53E0B0FB.3080203@yandex.ru> References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> 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 1407234388 4970 80.91.229.3 (5 Aug 2014 10:26:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Aug 2014 10:26:28 +0000 (UTC) To: martin rudalics , 18195@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 05 12:26:22 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 1XEbwj-0005zo-0q for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Aug 2014 12:26:21 +0200 Original-Received: from localhost ([::1]:58457 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEbwi-0008Kb-KK for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Aug 2014 06:26:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEbwX-0008J0-UG for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 06:26:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEbwQ-0000yO-EB for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 06:26:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEbwQ-0000yI-3t for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 06:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XEbwP-0003Uq-O4 for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 06:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Aug 2014 10:26:01 +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.140723431513286 (code B ref 18195); Tue, 05 Aug 2014 10:26:01 +0000 Original-Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 10:25:15 +0000 Original-Received: from localhost ([127.0.0.1]:58308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEbvd-0003S8-Vm for submit@debbugs.gnu.org; Tue, 05 Aug 2014 06:25:14 -0400 Original-Received: from mail-la0-f53.google.com ([209.85.215.53]:43549) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEbvb-0003RL-20 for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 06:25:11 -0400 Original-Received: by mail-la0-f53.google.com with SMTP id gl10so554988lab.12 for <18195@debbugs.gnu.org>; Tue, 05 Aug 2014 03:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=VEms6Y/uGKeO09vZ44Flga45eiQmXIq2DlhxqWdhdCM=; b=F/h4M8gL8xGq71T4MCK42M+fXqGD5QVlxj/Lh+Ss2KBfecfQVABjJisdpBwcuHZosd BQTIQIuhldVcO7aZ057B+UvsWg3dytdIaGGfa9LH5paDReFRiBfZgzSUM2Az94cypC3u D4BDTPlTVAWK58vDDhnFNSQOvxvUrCUVQn42hWge9dKq31ii+jtBqNxZrkY7YXip+2d2 894d/5Hoo4OnFtexKNayjR0P+16+Hy8XX1FjHNSNz/4JAeAgKrIXu3qatIZWgVY9ywlP A1EC0VsHUd+MvBdK67SioAiMHgVPh+X7nVQVf1jbtXXooPSp9MesUMhOiuZAaNp/Wiou anIw== X-Received: by 10.112.202.106 with SMTP id kh10mr2910988lbc.66.1407234304437; Tue, 05 Aug 2014 03:25:04 -0700 (PDT) Original-Received: from [10.8.0.26] (v-2-eu19-d3962-07.webazilla.com. [78.140.151.7]) by mx.google.com with ESMTPSA id er11sm2052546lbc.49.2014.08.05.03.25.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Aug 2014 03:25:03 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 In-Reply-To: <53E0AF08.50300@gmx.at> 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:92128 Archived-At: On 08/05/2014 02:16 PM, martin rudalics wrote: > Aha... Could you try whether `window-text-pixel-size' could be used for > that? 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? > `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. 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.