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: Wed, 06 Aug 2014 18:15:00 +0200 Message-ID: <53E25484.8050909@gmx.at> 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> <83ha1pptrd.fsf@gnu.org> 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 1407342111 14652 80.91.229.3 (6 Aug 2014 16:21:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Aug 2014 16:21:51 +0000 (UTC) Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 06 18:21:44 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 1XF3y4-0007L5-1n for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Aug 2014 18:21:36 +0200 Original-Received: from localhost ([::1]:40004 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF3y3-000761-HI for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Aug 2014 12:21:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF3so-0007YY-NF for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 12:16:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF3sg-000716-RV for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 12:16:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF3sg-000711-PO for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 12:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XF3sg-0003LO-Ef for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 12:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Aug 2014 16:16: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.140734171612794 (code B ref 18195); Wed, 06 Aug 2014 16:16:02 +0000 Original-Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 16:15:16 +0000 Original-Received: from localhost ([127.0.0.1]:60502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF3rv-0003KF-Gj for submit@debbugs.gnu.org; Wed, 06 Aug 2014 12:15:16 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:58711) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF3rt-0003Jx-30 for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 12:15:14 -0400 Original-Received: from [88.117.49.190] ([88.117.49.190]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MRWzQ-1WqpzH0B9E-00SbFf; Wed, 06 Aug 2014 18:15:07 +0200 In-Reply-To: <83ha1pptrd.fsf@gnu.org> X-Provags-ID: V03:K0:a7IipGQMGRAy7ZOn8yjHDg2FpachnV6Xe/qE7+t6k9GZNClcFcF psyhKSbHiKK+/TJe/EHqprpycIw0XFh0SnU4EDdutpFLzrhHiLpEwBL/MkhaocSnRq55sqz 9oQ7pjaEG0h7w5BS7DU7Q4cPkvFn2sQdAabekwiDG6piaDDw6tt3ZMpPq3LnxzDj6S/R6M1 osldDBHQleUtbLhkTt4yA== X-UI-Out-Filterresults: notjunk:1; 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:92184 Archived-At: >>>> 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 probably did no understand it. I do not want to select any font. The application has to know which font the overlay should appear in. If its the font of the buffer where the overlay finally appears, it should take this. If it wants to use any other font, it should take that. >>> 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. But as I explained in my mail to Dmitry this is the problem of the application. Whatever it wants to do in the target window it has to emulate in the temporary buffer: Put the original text there, apply any font or property settings from the original buffer to that buffer, put any overlays there, apply any font or property settings for the overlays there, and have move_it_to get the overall height. What am I missing? martin