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: Wed, 06 Aug 2014 17:39:18 +0300 Message-ID: <83ha1pptrd.fsf@gnu.org> References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> <831tsvqc3c.fsf@gnu.org> <53E0E2E5.7050306@gmx.at> <83tx5rowop.fsf@gnu.org> <53E0E665.1000206@gmx.at> <83ppgfow0p.fsf@gnu.org> <53E0EC6C.7020504@gmx.at> <83oavzotxz.fsf@gnu.org> <53E0FC15.4060502@gmx.at> <83lhr2q0nt.fsf@gnu.org> <53E1F846.2040105@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1407336041 27546 80.91.229.3 (6 Aug 2014 14:40:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Aug 2014 14:40:41 +0000 (UTC) Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 06 16:40: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 1XF2O3-0000TF-WC for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Aug 2014 16:40:20 +0200 Original-Received: from localhost ([::1]:39425 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF2O3-0007wK-LS for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Aug 2014 10:40:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF2Nv-0007vI-Tu for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 10:40:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF2Np-0004E6-Th for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 10:40:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF2Np-0004DW-Qx for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 10:40:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XF2Np-0000wX-4T for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 10:40:05 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Aug 2014 14:40:05 +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.14073359593509 (code B ref 18195); Wed, 06 Aug 2014 14:40:05 +0000 Original-Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 14:39:19 +0000 Original-Received: from localhost ([127.0.0.1]:60432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF2N4-0000uW-7Q for submit@debbugs.gnu.org; Wed, 06 Aug 2014 10:39:18 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:32963) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF2My-0000uC-A3 for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 10:39:13 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0N9W00E0036M6Z00@a-mtaout23.012.net.il> for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 17:39:06 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9W00EOR3D54L40@a-mtaout23.012.net.il>; Wed, 06 Aug 2014 17:39:06 +0300 (IDT) In-reply-to: <53E1F846.2040105@gmx.at> 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:92176 Archived-At: > Date: Wed, 06 Aug 2014 11:41:26 +0200 > From: martin rudalics > CC: dgutov@yandex.ru, 18195@debbugs.gnu.org > > >> This would have to be done on the Lisp level by selecting some font > >> before calculating the size of the overlay. > > > > Which font would you select? You didn't answer this question. The only trivial answer is the font of the default face, a choice which has the problems described below. > > I'm talking about a situation where the text over which the > > candidate list will be popped uses several different fonts, and so > > each line of the buffer text has a different height. > > I would pop up that list in a temporary buffer and run > `window-text-pixel-size' over it. And therein lies the problem. You will get the size of the text under the assumption that the text will be displayed using a single font, the one used by the frame's 'default' face. But if the text in the region over which you will pop the candidate list uses a different font, or shows images on some of the lines, the pixel height needed to display the popped list will be different. That's because the candidates are displayed by Company by putting overlays on consecutive lines of text, each overlay showing one candidate. However, displaying such overlays in the middle of a line of buffer text cannot decrease the height of the line, it can only increase it. Therefore, if the line of buffer text was taller than what is required for the default face's font, the displayed overlay string will take up more pixels than what you measured in the temporary buffer.