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 12:16:40 +0200 Message-ID: <53E0AF08.50300@gmx.at> References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@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 1407233850 29506 80.91.229.3 (5 Aug 2014 10:17:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Aug 2014 10:17:30 +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 12:17:21 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 1XEbo1-00030k-1Y for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Aug 2014 12:17:21 +0200 Original-Received: from localhost ([::1]:58434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEbo0-0006cI-Hl for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Aug 2014 06:17:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEbnq-0006as-Ez for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 06:17:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEbni-0006my-SX for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 06:17:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEbni-0006mu-PS for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 06:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XEbnh-0003Dv-P9 for bug-gnu-emacs@gnu.org; Tue, 05 Aug 2014 06:17:01 -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 10:17: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.140723381812378 (code B ref 18195); Tue, 05 Aug 2014 10:17:01 +0000 Original-Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 10:16:58 +0000 Original-Received: from localhost ([127.0.0.1]:58304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEbnd-0003DZ-E7 for submit@debbugs.gnu.org; Tue, 05 Aug 2014 06:16:57 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:56326) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEbnZ-0003DL-LU for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 06:16:55 -0400 Original-Received: from [93.82.78.228] ([93.82.78.228]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MXUmw-1WuJ0F3XfS-00WXmX; Tue, 05 Aug 2014 12:16:45 +0200 In-Reply-To: <53E0ABF9.7070506@yandex.ru> X-Provags-ID: V03:K0:6eTW3piXC7o8a19rFkCzeOj08+CB1ILefrpsc4TfW2N0YmdpinV GNT4PFcwnXdqqpGL2JfXiUzCvQ6jLRknrjGYaQo7JfLHi95YHhoDFCPeHadbWbUOv/EuCni 1SILehTfwdRY0iSXvqLJTM3pArxx6r6dYVoG0U+8qhEEZ9BAF6FM5ns8W6nKpvfE0fBUfmt uLbVxiXydfYTuQDm4lDPg== 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:92127 Archived-At: > Have you tried Company? No. > This issue is about completion popup, which displays completions in the current buffer and window, in a rectangle rendered using an overlay. There are screenshots in that issue thread. > > Before the popup is rendered, we need to determine how much of it would fit below the current line, and if there's not enough space, we render it above the current line. Aha... Could you try whether `window-text-pixel-size' could be used for that? IIUC you'd have to call it twice: Once for calculating how much space you need and once for how much space is left below the current line. `window-text-height' with PIXELWISE t should give you the overall height of the window. > Even if the buffer is shorter than the window, we can temporarily pad it, so when calculating the height of the window, we need to take the whole of it into account. That's why `count-screen-line' doesn't seem like a good approach either. If things like line spacing are involved you really should calculate pixelwise. martin