From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Newsgroups: gmane.emacs.help Subject: Re: How do I get the window height in lines, taking in account line-spacing? Date: Mon, 04 Aug 2014 22:31:46 +0400 Message-ID: <86d2cg3y3x.fsf@yandex.ru> References: <53DF7885.8000907@yandex.ru> <87oaw08hlj.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1407177160 11070 80.91.229.3 (4 Aug 2014 18:32:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Aug 2014 18:32:40 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 04 20:32:33 2014 Return-path: Envelope-to: geh-help-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 1XEN3Z-0004ZZ-J3 for geh-help-gnu-emacs@m.gmane.org; Mon, 04 Aug 2014 20:32:25 +0200 Original-Received: from localhost ([::1]:54113 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEN3Z-0008Fl-0z for geh-help-gnu-emacs@m.gmane.org; Mon, 04 Aug 2014 14:32:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEN3B-0007zI-Mn for help-gnu-emacs@gnu.org; Mon, 04 Aug 2014 14:32:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEN32-0004WK-N2 for help-gnu-emacs@gnu.org; Mon, 04 Aug 2014 14:32:01 -0400 Original-Received: from mail-la0-x231.google.com ([2a00:1450:4010:c03::231]:58350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEN32-0004WC-EQ for help-gnu-emacs@gnu.org; Mon, 04 Aug 2014 14:31:52 -0400 Original-Received: by mail-la0-f49.google.com with SMTP id hz20so5615912lab.8 for ; Mon, 04 Aug 2014 11:31:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=jTU/k4ghkJjIRE+dgFSUoaEnAO8rSbUtaYjoY8vW5iI=; b=blnL5WJqgsLTlnUpSx05h/vu0KG+9+Il5DsqezWmCNCir+I4poaWwRLL8sy308p5Um QMXdP5KjeiFmngtdQ4H3PYPw/JlxBRKoqnEjJM4t47+ddPxtcPmKZuVXfocVlFExcE+s TgNqVk01adl6TWrHsji+yGa6qsw8t3IztTnNdYrs4+N85vqEzqlMtW9Uxtt3TAf7kGA3 v8jy84mtSEabH4SR4O04HVaKjYe2LJ8BFtWW7v/WGqsm3Fp3h0FmYqpkDr3HWdafAw1a oIgP7MMjNYok96jr8wCO00bARIuuLf871tHMW5BIz+M8zIcVPOoR7OBg6jCqdX5BfPtQ uuQQ== X-Received: by 10.152.234.71 with SMTP id uc7mr25404525lac.22.1407177111356; Mon, 04 Aug 2014 11:31:51 -0700 (PDT) Original-Received: from axl (v-2-eu19-d3962-07.webazilla.com. [78.140.151.7]) by mx.google.com with ESMTPSA id e4sm1633704lbc.29.2014.08.04.11.31.49 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 04 Aug 2014 11:31:50 -0700 (PDT) In-Reply-To: <87oaw08hlj.fsf@web.de> (Michael Heerdegen's message of "Mon, 04 Aug 2014 16:17:12 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::231 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99078 Archived-At: Michael Heerdegen writes: > There's `window-screen-lines', but it's also not reliable when the > window displays different fonts or images etc. This would be fine, except even in the simple case it returns the same mistaken result as my alternative solution in the option 1. For example, with line-spacing 0.2 I see 48.5 text lines visible in my maximized window, but (window-screen-lines) evaluates to 46.66(6). > You maybe want to use `window-end' combined with > `pos-visible-in-window-p'. Yep, this seems to be the most accurate approach, although probably the slowest one. Thanks. > What's the problem you want to solve, btw? Count the screen lines in order to determine in which direction to render the completion popup (below or above the current line). I've linked to the related issue in the initial message.