From unknown Fri Jun 20 07:21:48 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#18195 <18195@debbugs.gnu.org> To: bug#18195 <18195@debbugs.gnu.org> Subject: Status: 24.3.92; window-screen-lines is not accurate Reply-To: bug#18195 <18195@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:21:48 +0000 retitle 18195 24.3.92; window-screen-lines is not accurate reassign 18195 emacs submitter 18195 Dmitry severity 18195 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 04 22:00:54 2014 Received: (at submit) by debbugs.gnu.org; 5 Aug 2014 02:00:54 +0000 Received: from localhost ([127.0.0.1]:58048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEU3a-000649-0S for submit@debbugs.gnu.org; Mon, 04 Aug 2014 22:00:54 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51392) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEU3X-00063w-IF for submit@debbugs.gnu.org; Mon, 04 Aug 2014 22:00:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEU3N-0008My-DO for submit@debbugs.gnu.org; Mon, 04 Aug 2014 22:00:46 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEU3N-0008Mr-3D for submit@debbugs.gnu.org; Mon, 04 Aug 2014 22:00:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEU3I-00030s-1Q for bug-gnu-emacs@gnu.org; Mon, 04 Aug 2014 22:00:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEU3D-0008JS-5J for bug-gnu-emacs@gnu.org; Mon, 04 Aug 2014 22:00:35 -0400 Received: from mail-lb0-x22d.google.com ([2a00:1450:4010:c04::22d]:37458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEU3C-0008JI-T1 for bug-gnu-emacs@gnu.org; Mon, 04 Aug 2014 22:00:31 -0400 Received: by mail-lb0-f173.google.com with SMTP id p9so193606lbv.18 for ; Mon, 04 Aug 2014 19:00:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=9KCxNeyJqb/hpku5tMU4eA8zf3oIetEAY6PK/Azv9jk=; b=MqhXWbzTrznCa/RjO+rTUreYmJSfbp6HW3PyEisY0xdY3Bww9mMxiDwbMSyxMMGAj4 WF4tSmcA5Z3cCjvmfk+yT9BBF4K99kMykiTvk7ecunxgG213zvj6jUWV0P+MKJaEg35K +qGItW9sU/EuxLuwevLfi55HzsVAkIxplgxCM45gxXFo6Soj0z8iigON3OrRRMkAA8ct L3RK1J+tCEBnOy7yqcgOGHTFJ/cDE8ZxEZ54J23X2b/7nPtlCGammFaZgOnOLho8jcZA gB8DtAgoW2SXOe751PViacMGxV8RGg3XtzUOpOXDZFfF46Lo//ePN6N+MHjQNdKnswUh SB7g== X-Received: by 10.152.2.3 with SMTP id 3mr646183laq.8.1407204029664; Mon, 04 Aug 2014 19:00:29 -0700 (PDT) Received: from axl (v-2-eu19-d3962-07.webazilla.com. [78.140.151.7]) by mx.google.com with ESMTPSA id t7sm140119lat.16.2014.08.04.19.00.28 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 04 Aug 2014 19:00:29 -0700 (PDT) From: Dmitry To: bug-gnu-emacs@gnu.org Subject: 24.3.92; window-screen-lines is not accurate Date: Tue, 05 Aug 2014 06:00:24 +0400 Message-ID: <86tx5r7l1j.fsf@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) If I have line-spacing set, the value the above function returns is smaller than the actuall number of screen lines the window can contain. For example, when I have the current Emacs frame maximized and line-spacing set to 0.2, (window-screen-lines) returns 46.66(6), whereas there are 48 fully-visible lines in the given window and one partially-visible one. Here's my default font: (set-face-attribute 'default nil :height 105 :family "Fira Mono") Related: http://lists.gnu.org/archive/html/help-gnu-emacs/2014-08/msg00026.html In GNU Emacs 24.3.92.3 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2014-07-24 on axl Repository revision: 117398 stephen.berman@gmx.net-20140722213204-51v7bp0chfei6wbx Windowing system distributor `The X.Org Foundation', version 11.0.11501000 System Description: Ubuntu 14.04.1 LTS From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 04:38:33 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 08:38:34 +0000 Received: from localhost ([127.0.0.1]:58234 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEaGP-0007rR-5h for submit@debbugs.gnu.org; Tue, 05 Aug 2014 04:38:33 -0400 Received: from mout.gmx.net ([212.227.15.15]:60203) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEaGJ-0007r8-Sq for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 04:38:29 -0400 Received: from [93.82.78.228] ([93.82.78.228]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MPDeK-1XIxyO1KW8-004PDs; Tue, 05 Aug 2014 10:38:20 +0200 Message-ID: <53E097F7.5050407@gmx.at> Date: Tue, 05 Aug 2014 10:38:15 +0200 From: martin rudalics MIME-Version: 1.0 To: Dmitry , 18195@debbugs.gnu.org Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate References: <86tx5r7l1j.fsf@yandex.ru> In-Reply-To: <86tx5r7l1j.fsf@yandex.ru> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:vtzrEPF2LuH8OJk/pyzw5mz8N7WeqMj7Uam+EzR+acnuM0OUPR4 Ga4j8O2VxVWha0qrJU/WNuxbGiSx6V7zsSZlXIFCBenfCe1EhOuUUJHQveS1/x2+m4CUbip gidQmA9594sJ55Cw+N6rluuugYEaC3ONv+6TRmLHUs+OaGATAzqW+BfaSijLlV5KA1/gyFw E+v48FUL3jW44AvGvYcEg== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > If I have line-spacing set, the value the above function returns is > smaller than the actuall number of screen lines the window can contain. > > For example, when I have the current Emacs frame maximized and > line-spacing set to 0.2, (window-screen-lines) returns 46.66(6), whereas > there are 48 fully-visible lines in the given window and one > partially-visible one. > > Here's my default font: > > (set-face-attribute 'default nil :height 105 :family "Fira Mono") > > Related: > http://lists.gnu.org/archive/html/help-gnu-emacs/2014-08/msg00026.html IIUC https://github.com/company-mode/company-mode/issues/160#issuecomment-51022508 mentioned in that thread, all you want is to display all lines of a completion buffer. Is that correct? If so, then why can't/don't you use `fit-window-to-buffer'? martin From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 06:03:52 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 10:03:52 +0000 Received: from localhost ([127.0.0.1]:58289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEbax-0002sC-JJ for submit@debbugs.gnu.org; Tue, 05 Aug 2014 06:03:52 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:37281) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEbau-0002rs-Is for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 06:03:49 -0400 Received: by mail-lb0-f173.google.com with SMTP id p9so527704lbv.32 for <18195@debbugs.gnu.org>; Tue, 05 Aug 2014 03:03:42 -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=L7IW1Hh+QLjEieU7/J8CFyZfODbNfvlzSwHEFTzAN6I=; b=RtM9W3xpeR2g3aZaoEcHWmrSrlMEA1kv7gJGwaVHaVcfDyUG/KMROfkRVAx5g9uJpc 7CPldz8S7OyvM+9ODbsrNHTzzSuV9rQJraPvZf6NNXEAA95hFMb/3n8UB318CPgvCOR2 rTW7sHCq21gs2aVYcJmAPonLS1UrsGgpw9Xwnnvbe7ebjwj18ChO2oNegtWsO7CoYD0j 4niBhwXJ2VUnRUUC5KD03ieiqR5YKjWIPn35vF3oYZIcPBmViphqG2pf2+CFIaKVaL0J /WbbCe1pXZzGYZ3mSd9HgmkoTF4US19S4S8g2sbKanknqJK9vOTQ+KYOvp4b9eEZdIZt kkAA== X-Received: by 10.152.180.36 with SMTP id dl4mr2956080lac.26.1407233022451; Tue, 05 Aug 2014 03:03:42 -0700 (PDT) Received: from [10.8.0.26] (v-2-eu19-d3962-07.webazilla.com. [78.140.151.7]) by mx.google.com with ESMTPSA id f2sm2010385lbo.2.2014.08.05.03.03.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Aug 2014 03:03:41 -0700 (PDT) Message-ID: <53E0ABF9.7070506@yandex.ru> Date: Tue, 05 Aug 2014 14:03:37 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: martin rudalics , 18195@debbugs.gnu.org Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> In-Reply-To: <53E097F7.5050407@gmx.at> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18195 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 08/05/2014 12:38 PM, martin rudalics wrote: > IIUC > > https://github.com/company-mode/company-mode/issues/160#issuecomment-51022508 > > mentioned in that thread, all you want is to display all lines of a > completion buffer. Is that correct? Not at all. Have you tried Company? 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. 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 06:16:58 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 10:16:58 +0000 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 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 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 Message-ID: <53E0AF08.50300@gmx.at> Date: Tue, 05 Aug 2014 12:16:40 +0200 From: martin rudalics MIME-Version: 1.0 To: Dmitry Gutov , 18195@debbugs.gnu.org Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> In-Reply-To: <53E0ABF9.7070506@yandex.ru> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:6eTW3piXC7o8a19rFkCzeOj08+CB1ILefrpsc4TfW2N0YmdpinV GNT4PFcwnXdqqpGL2JfXiUzCvQ6jLRknrjGYaQo7JfLHi95YHhoDFCPeHadbWbUOv/EuCni 1SILehTfwdRY0iSXvqLJTM3pArxx6r6dYVoG0U+8qhEEZ9BAF6FM5ns8W6nKpvfE0fBUfmt uLbVxiXydfYTuQDm4lDPg== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 06:25:15 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 10:25:15 +0000 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 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 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) 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) Message-ID: <53E0B0FB.3080203@yandex.ru> Date: Tue, 05 Aug 2014 14:24:59 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: martin rudalics , 18195@debbugs.gnu.org Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> In-Reply-To: <53E0AF08.50300@gmx.at> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18195 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 08:21:16 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 12:21:16 +0000 Received: from localhost ([127.0.0.1]:58328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEdjv-0007dt-3n for submit@debbugs.gnu.org; Tue, 05 Aug 2014 08:21:15 -0400 Received: from mout.gmx.net ([212.227.17.22]:64760) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEdjs-0007dc-0L for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 08:21:12 -0400 Received: from [93.82.13.132] ([93.82.13.132]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0Ldcv0-1WX5m12Q5K-00ihBH; Tue, 05 Aug 2014 14:21:03 +0200 Message-ID: <53E0CC2A.7040801@gmx.at> Date: Tue, 05 Aug 2014 14:20:58 +0200 From: martin rudalics MIME-Version: 1.0 To: Dmitry Gutov , 18195@debbugs.gnu.org Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> <53E0B0FB.3080203@yandex.ru> In-Reply-To: <53E0B0FB.3080203@yandex.ru> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:MRU77MKZqzP+nJQDO/6ncBR01rupJ1QSm7lfMi19FNPfMPyzDiv qZj9ErLrMT7150yfpcgAIWFWTx98SDmSfboVssvznoxaXpzUT1zWMieIJZUfl+n3zR3hsYb PmALRmMKhCZUbRhUS2ZwKRjT32QPHFQDKStMeZ9CkQgr+1ktu/AWYsLDzB21xk+nI0PyYKJ h8xjZW7LZD6SMJQl/vu+A== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > 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? You have to calculate the height of the text from window start till the end of the buffer and subtract the result from the window's text height. > > `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. `count-screen-lines' doesn't return a pixel value. How do you get that with lines of different heights and line spacing? > 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. It again just returns a line value. IIRC someone has set the font size to 1 pixel to make this return something reasonable. But why do all these acrobatics? `window-text-pixel-size' should give you everything you need in a uniform way. And if something's missing we can easily add it. martin From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 09:05:35 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 13:05:36 +0000 Received: from localhost ([127.0.0.1]:58336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEeQp-0000OR-5C for submit@debbugs.gnu.org; Tue, 05 Aug 2014 09:05:35 -0400 Received: from mail-la0-f45.google.com ([209.85.215.45]:48576) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEeQl-0000O6-C6 for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 09:05:32 -0400 Received: by mail-la0-f45.google.com with SMTP id ty20so691042lab.18 for <18195@debbugs.gnu.org>; Tue, 05 Aug 2014 06:05:25 -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=ck+o7rtax3RWxQsclscIfVwepD18jVbzXgkHJ/eAcc8=; b=Yaisz9cQKm5Hy6Lh1PEIKmjkIH7GW5qpBXiSnOUgseP8CFpEt5GrXJRCDnW+xcIUbV KX1XVEv5rK6Oro6MCqWshXDFAEvQglVs5oA67uYER64PzvwsHwbGs7czFcbawmvOVuaF kPLfQuZhxLUZtun8c+VGfQuEuoGcBmgD/WJGCYvVbmlK00ud7kvJQMFtwVLcb+qeoqWC vZ80OCfVaRFgPblEZ9as4G826Nn9Fht4qSv4GDUFcm2oFIYHII4ot0egnEpOSb9EZwLA lxAQ1Buo2X501z6B0s+VVNmKhe8xyX/6mDSlrc9AoJbPoGH5XRTRmGdFe9jHgWE5PqL9 NxWQ== X-Received: by 10.152.42.175 with SMTP id p15mr3874841lal.73.1407243925183; Tue, 05 Aug 2014 06:05:25 -0700 (PDT) Received: from [10.8.0.26] (v-2-eu19-d3962-07.webazilla.com. [78.140.151.7]) by mx.google.com with ESMTPSA id u12sm893070laz.47.2014.08.05.06.05.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Aug 2014 06:05:24 -0700 (PDT) Message-ID: <53E0D690.1030208@yandex.ru> Date: Tue, 05 Aug 2014 17:05:20 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: martin rudalics , 18195@debbugs.gnu.org Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> <53E0B0FB.3080203@yandex.ru> <53E0CC2A.7040801@gmx.at> In-Reply-To: <53E0CC2A.7040801@gmx.at> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18195 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 08/05/2014 04:20 PM, martin rudalics wrote: > > 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? > > You have to calculate the height of the text from window start till the > end of the buffer and subtract the result from the window's text height. Suppose I do that. When do I convert any of the resulting values to number of lines? Please remember, we're using an overlay for popup rendering. Overlays work with lines of text. > `count-screen-lines' doesn't return a pixel value. How do you get that > with lines of different heights and line spacing? As above, we really don't need a pixel value in the end result. If the overlay is made to span over lines with different heights and lines spacing, we can either make it follow all those dimensions, or override them to the same values. But while we can do that, ignoring the global value of line-spacing wouldn't be comfortable for users that have it set. > It again just returns a line value. IIRC someone has set the font size > to 1 pixel to make this return something reasonable. But why do all > these acrobatics? `window-text-pixel-size' should give you everything > you need in a uniform way. And if something's missing we can easily add > it. See above. By the way, `window-screen-lines' not being accurate doesn't seem to be directly caused by pixel-perfect positioning. If I copy the necessary definitions (the 3 new function) to Emacs 24.3, it exhibits the same problem. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 09:35:48 2014 Received: (at 18195-done) by debbugs.gnu.org; 5 Aug 2014 13:35:48 +0000 Received: from localhost ([127.0.0.1]:58344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEeu3-0001AN-40 for submit@debbugs.gnu.org; Tue, 05 Aug 2014 09:35:47 -0400 Received: from mtaout29.012.net.il ([80.179.55.185]:44312) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEety-0001A1-5c for 18195-done@debbugs.gnu.org; Tue, 05 Aug 2014 09:35:43 -0400 Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0N9U00O005RAJ600@mtaout29.012.net.il> for 18195-done@debbugs.gnu.org; Tue, 05 Aug 2014 16:35:37 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9U00NT25RDS600@mtaout29.012.net.il>; Tue, 05 Aug 2014 16:35:37 +0300 (IDT) Date: Tue, 05 Aug 2014 16:35:45 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <86tx5r7l1j.fsf@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Message-id: <834mxrqcsu.fsf@gnu.org> References: <86tx5r7l1j.fsf@yandex.ru> X-Spam-Score: 3.7 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > From: Dmitry > Date: Tue, 05 Aug 2014 06:00:24 +0400 > > If I have line-spacing set, the value the above function returns is > smaller than the actuall number of screen lines the window can contain. > > For example, when I have the current Emacs frame maximized and > line-spacing set to 0.2, (window-screen-lines) returns 46.66(6), whereas > there are 48 fully-visible lines in the given window and one > partially-visible one. [...] Content analysis details: (3.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.7 RCVD_IN_PSBL RBL: Received via a relay in PSBL [80.179.55.185 listed in psbl.surriel.com] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Debbugs-Envelope-To: 18195-done Cc: 18195-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 3.7 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > From: Dmitry > Date: Tue, 05 Aug 2014 06:00:24 +0400 > > If I have line-spacing set, the value the above function returns is > smaller than the actuall number of screen lines the window can contain. > > For example, when I have the current Emacs frame maximized and > line-spacing set to 0.2, (window-screen-lines) returns 46.66(6), whereas > there are 48 fully-visible lines in the given window and one > partially-visible one. [...] Content analysis details: (3.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.7 RCVD_IN_PSBL RBL: Received via a relay in PSBL [80.179.55.185 listed in psbl.surriel.com] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) > From: Dmitry > Date: Tue, 05 Aug 2014 06:00:24 +0400 > > If I have line-spacing set, the value the above function returns is > smaller than the actuall number of screen lines the window can contain. > > For example, when I have the current Emacs frame maximized and > line-spacing set to 0.2, (window-screen-lines) returns 46.66(6), whereas > there are 48 fully-visible lines in the given window and one > partially-visible one. Fixed in revision 117425 on the emacs-24 branch. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 09:46:45 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 13:46:45 +0000 Received: from localhost ([127.0.0.1]:58351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEf4f-0001Rq-0Z for submit@debbugs.gnu.org; Tue, 05 Aug 2014 09:46:45 -0400 Received: from mtaout25.012.net.il ([80.179.55.181]:49824) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEf4c-0001RZ-45 for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 09:46:43 -0400 Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0N9U005005Z3TR00@mtaout25.012.net.il> for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 16:41:45 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9U00NPS61LJX70@mtaout25.012.net.il>; Tue, 05 Aug 2014 16:41:45 +0300 (IDT) Date: Tue, 05 Aug 2014 16:46:45 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E0ABF9.7070506@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <8338dbqcai.fsf@gnu.org> References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Tue, 05 Aug 2014 14:03:37 +0400 > From: Dmitry Gutov > > On 08/05/2014 12:38 PM, martin rudalics wrote: > > IIUC > > > > https://github.com/company-mode/company-mode/issues/160#issuecomment-51022508 > > > > mentioned in that thread, all you want is to display all lines of a > > completion buffer. Is that correct? > > Not at all. Have you tried Company? > > 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. I fixed window-screen-lines. However, please note that you are on a slippery slope doing this. Emacs currently doesn't provide Lisp interfaces that would allow to perform such layout tasks from Lisp with reliable results. Overlays and text properties were never supposed to be used for layout purposes. For example, AFAIU, your code currently assumes that the font used for popup is the same as the one used for the underlying buffer text. But since you provide faces for the popup, a user could legitimately customize those faces to use a different font, and thus invalidate your calculations, because window-screen-lines uses the metrics of the default face's font. And that is just an example of what could go wrong when you try to do what in Emacs can only be done reliably by the display engine. IMO, instead of overloading existing display features with jobs they were never designed to do, and then live forever with the situation where development breaks the resulting applications (like the pixel-wise resizing of windows did with this one), it would be a much better investment of energy to come up with requirements for Lisp APIs that could be used by applications for laying out text. These requirements, when implemented, would then benefit everybody, and allow solid dependable applications that don't break that often. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 09:50:53 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 13:50:53 +0000 Received: from localhost ([127.0.0.1]:58355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEf8f-0001Xz-68 for submit@debbugs.gnu.org; Tue, 05 Aug 2014 09:50:53 -0400 Received: from mout.gmx.net ([212.227.15.18]:64461) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEf8c-0001Xj-Mz for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 09:50:51 -0400 Received: from [93.82.13.132] ([93.82.13.132]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MWT8s-1WvL3l0rqE-00Xawt; Tue, 05 Aug 2014 15:50:39 +0200 Message-ID: <53E0E12A.3050204@gmx.at> Date: Tue, 05 Aug 2014 15:50:34 +0200 From: martin rudalics MIME-Version: 1.0 To: Dmitry Gutov , 18195@debbugs.gnu.org Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> <53E0B0FB.3080203@yandex.ru> <53E0CC2A.7040801@gmx.at> <53E0D690.1030208@yandex.ru> In-Reply-To: <53E0D690.1030208@yandex.ru> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:wtf/N5zPaPUjihoPofrF5ekQlJxVhqiinaB0TX0iuc0J/p7QsGf GiM0NKZoVH85gtRCKmnb1mcnvbCueT+b+Rw4DBOZZPpCQhzL1GWnO//nyAXqodF5GMfl4s8 qhH9kwtAKeVkpm9K7ADsip6Sai9Dv8PEhvwxCfGHpF0mNdLpdQsPgII9NzbjCMEnIXQ9vPr BeR+lDSKy5E4CZ0iwlX6Q== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >> > 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? >> >> You have to calculate the height of the text from window start till the >> end of the buffer and subtract the result from the window's text height. > > Suppose I do that. When do I convert any of the resulting values to number of lines? IIUC you want to check whether some text of pixel height O would fit into the rest of a window with pixel height W when the upper part of that window is occupied by text with pixel height T. So if O <= W - T holds, you can put the overlay below the current line, and do something else otherwise. Why would you ever want to convert a resulting value to a number of lines? > Please remember, we're using an overlay for popup rendering. Overlays work with lines of text. Overlays don't know about newlines. I suppose the overlay starts at the beginning of some line after text T and has as many characters as there are in the text with height O. If you want to cover any text with the overlay do that. >> `count-screen-lines' doesn't return a pixel value. How do you get that >> with lines of different heights and line spacing? > > As above, we really don't need a pixel value in the end result. If the overlay is made to span over lines with different heights and lines spacing, we can either make it follow all those dimensions, or override them to the same values. > > But while we can do that, ignoring the global value of line-spacing wouldn't be comfortable for users that have it set. IIUC you neither need pixels nor lines in the end result. You just want to know whether a given overlay fits into a given window at a given position. martin From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 09:51:02 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 13:51:02 +0000 Received: from localhost ([127.0.0.1]:58358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEf8n-0001YS-Ne for submit@debbugs.gnu.org; Tue, 05 Aug 2014 09:51:02 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:38676) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEf8m-0001Y7-Dz for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 09:51:01 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0N9U00E006CMWY00@a-mtaout20.012.net.il> for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 16:50:54 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9U00EBZ6GTFY70@a-mtaout20.012.net.il>; Tue, 05 Aug 2014 16:50:54 +0300 (IDT) Date: Tue, 05 Aug 2014 16:51:03 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E0AF08.50300@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics Message-id: <831tsvqc3c.fsf@gnu.org> References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Tue, 05 Aug 2014 12:16:40 +0200 > From: martin rudalics > > If things like line spacing are involved you really should calculate > pixelwise. He can't: we currently don't expose enough information for Lisp programs to perform layout. E.g., the metrics of glyphs and lines that use arbitrary fonts and display images are not easily available on the Lisp level, and neither are dimensions and line counts of arbitrary regions of the screen (although you could write some clunky Lisp to do the latter). Likewise with dimensions of text in overlays and display properties, and with images. This was never supposed to be needed, and thus was never designed and implemented. If we want to allow such jobs from Lisp, we need to close these gaps. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 09:57:21 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 13:57:21 +0000 Received: from localhost ([127.0.0.1]:58757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfEu-0001mm-Ql for submit@debbugs.gnu.org; Tue, 05 Aug 2014 09:57:21 -0400 Received: from mtaout24.012.net.il ([80.179.55.180]:39292) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfEr-0001mY-E4 for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 09:57:18 -0400 Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0N9U00C0065W2N00@mtaout24.012.net.il> for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 16:53:02 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9U0032M6KEA2B0@mtaout24.012.net.il>; Tue, 05 Aug 2014 16:53:02 +0300 (IDT) Date: Tue, 05 Aug 2014 16:57:21 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E0B0FB.3080203@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83zjfjox8e.fsf@gnu.org> References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> <53E0B0FB.3080203@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Tue, 05 Aug 2014 14:24:59 +0400 > From: Dmitry Gutov > > `count-screen-lines' already helps with "space above the current line", > and we can find out the total height of the window in pixels. How do you convert the line count returned by count-screen-lines into pixels, if the lines are of non-constant height. Also note the caveats in the doc string of that function: the value is not 100% reliable. > 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. Line of what font? > 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. It is accurate now. But, as I wrote elsewhere in this thread, that will only solve some of your problems. In general, we don't support layout of arbitrary text from Lisp. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 09:58:12 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 13:58:12 +0000 Received: from localhost ([127.0.0.1]:58762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfFj-0001oM-UL for submit@debbugs.gnu.org; Tue, 05 Aug 2014 09:58:12 -0400 Received: from mout.gmx.net ([212.227.15.19]:57106) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfFh-0001o6-Ew for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 09:58:10 -0400 Received: from [93.82.13.132] ([93.82.13.132]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0Ln897-1WnKml1pvB-00hJoR; Tue, 05 Aug 2014 15:58:02 +0200 Message-ID: <53E0E2E5.7050306@gmx.at> Date: Tue, 05 Aug 2014 15:57:57 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> <831tsvqc3c.fsf@gnu.org> In-Reply-To: <831tsvqc3c.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:9H3wRumIpIjbtiVe05cfc54RHcOl9o+8mOtDOhnRsSy1Xhv/Uz/ LAvuj8fgUNyffI6ctsAPJ4tWzxqanbfeip8WxjnzBQs7HvMKuUQXzsa1Z3KGP0/fMongDZ5 LS3PbvmSyh2sP2QvUmYYkPPhytEkinNDbvSHxxg6mukTweWHRnyGh3PYEKgKuqwevmaLE6k wRIOaoRFffW4aRVGsBBXQ== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > He can't: we currently don't expose enough information for Lisp > programs to perform layout. E.g., the metrics of glyphs and lines > that use arbitrary fonts and display images are not easily available > on the Lisp level, and neither are dimensions and line counts of > arbitrary regions of the screen (although you could write some clunky > Lisp to do the latter). Likewise with dimensions of text in overlays > and display properties, and with images. > > This was never supposed to be needed, and thus was never designed and > implemented. If we want to allow such jobs from Lisp, we need to > close these gaps. Why would `window-text-pixel-size' fail to provide that? It might be a bit clumsy to work with because you have to temporarily show another buffer in its window but apart from that I see no problems ... martin From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 09:58:35 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 13:58:35 +0000 Received: from localhost ([127.0.0.1]:58765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfG7-0001p4-Fi for submit@debbugs.gnu.org; Tue, 05 Aug 2014 09:58:35 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:38348) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfG5-0001ol-TQ for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 09:58:34 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0N9U00E006EY0700@a-mtaout22.012.net.il> for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 16:58:27 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9U00DFP6TFZW20@a-mtaout22.012.net.il>; Tue, 05 Aug 2014 16:58:27 +0300 (IDT) Date: Tue, 05 Aug 2014 16:58:37 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E0CC2A.7040801@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics Message-id: <83y4v3ox6a.fsf@gnu.org> References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> <53E0B0FB.3080203@yandex.ru> <53E0CC2A.7040801@gmx.at> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Tue, 05 Aug 2014 14:20:58 +0200 > From: martin rudalics > > > 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. > > It again just returns a line value. But that value is a floating-point number, so accuracy is not lost. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 10:01:40 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 14:01:40 +0000 Received: from localhost ([127.0.0.1]:58771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfJ6-0001vL-1m for submit@debbugs.gnu.org; Tue, 05 Aug 2014 10:01:40 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:40704) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfJ3-0001v5-Tx for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 10:01:39 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0N9U00E006XFYW00@a-mtaout20.012.net.il> for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 17:01:31 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9U00EFL6YJFY90@a-mtaout20.012.net.il>; Tue, 05 Aug 2014 17:01:31 +0300 (IDT) Date: Tue, 05 Aug 2014 17:01:41 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E0D690.1030208@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83wqanox16.fsf@gnu.org> References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> <53E0B0FB.3080203@yandex.ru> <53E0CC2A.7040801@gmx.at> <53E0D690.1030208@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Tue, 05 Aug 2014 17:05:20 +0400 > From: Dmitry Gutov > > If the overlay is made to span over lines with different heights and > lines spacing, we can either make it follow all those dimensions, or > override them to the same values. No, you can't do that. Unless an overlay entirely obscures a screen line, it can never make the line height smaller, only larger. Besides, even if you could do what you hint here, that would cause unpleasant effects on display, whereby the text would jump up and down when the overlay is popped up/down. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 10:06:26 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 14:06:26 +0000 Received: from localhost ([127.0.0.1]:58830 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfNh-00024V-F3 for submit@debbugs.gnu.org; Tue, 05 Aug 2014 10:06:25 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:39797) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfNe-00023n-88 for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 10:06:23 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0N9U00E0075X7600@a-mtaout22.012.net.il> for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 17:06:16 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9U00DCF76FYP40@a-mtaout22.012.net.il>; Tue, 05 Aug 2014 17:06:16 +0300 (IDT) Date: Tue, 05 Aug 2014 17:06:25 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E0E12A.3050204@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics Message-id: <83vbq7owta.fsf@gnu.org> References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> <53E0B0FB.3080203@yandex.ru> <53E0CC2A.7040801@gmx.at> <53E0D690.1030208@yandex.ru> <53E0E12A.3050204@gmx.at> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Tue, 05 Aug 2014 15:50:34 +0200 > From: martin rudalics > > IIUC you want to check whether some text of pixel height O would fit > into the rest of a window with pixel height W when the upper part of > that window is occupied by text with pixel height T. There's currently no way to determine the pixel height of arbitrary text string from Lisp, without actually displaying it in some window. So there's no way to know the value of O, except in some simple scenarios. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 10:09:10 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 14:09:10 +0000 Received: from localhost ([127.0.0.1]:58843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfQL-00029Z-OB for submit@debbugs.gnu.org; Tue, 05 Aug 2014 10:09:10 -0400 Received: from mtaout23.012.net.il ([80.179.55.175]:57390) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfQJ-00028q-2A for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 10:09:08 -0400 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0N9U009007AAX100@a-mtaout23.012.net.il> for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 17:09:00 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9U009HP7B0W120@a-mtaout23.012.net.il>; Tue, 05 Aug 2014 17:09:00 +0300 (IDT) Date: Tue, 05 Aug 2014 17:09:10 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E0E2E5.7050306@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics Message-id: <83tx5rowop.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> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Tue, 05 Aug 2014 15:57:57 +0200 > From: martin rudalics > CC: dgutov@yandex.ru, 18195@debbugs.gnu.org > > > He can't: we currently don't expose enough information for Lisp > > programs to perform layout. E.g., the metrics of glyphs and lines > > that use arbitrary fonts and display images are not easily available > > on the Lisp level, and neither are dimensions and line counts of > > arbitrary regions of the screen (although you could write some clunky > > Lisp to do the latter). Likewise with dimensions of text in overlays > > and display properties, and with images. > > > > This was never supposed to be needed, and thus was never designed and > > implemented. If we want to allow such jobs from Lisp, we need to > > close these gaps. > > Why would `window-text-pixel-size' fail to provide that? Because there's no way of calculating the pixel size of arbitrary text (in this case: the list of completion candidates to be popped up overlaid on the buffer text), except if that text is displayed in some window. > It might be a bit clumsy to work with because you have to > temporarily show another buffer in its window That _is_ the problem. Momentarily flashing some text in some window is not my idea of a good application. It simply looks like a bug. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 10:09:15 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 14:09:15 +0000 Received: from localhost ([127.0.0.1]:58846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfQQ-00029t-JH for submit@debbugs.gnu.org; Tue, 05 Aug 2014 10:09:14 -0400 Received: from mout.gmx.net ([212.227.17.21]:55095) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfQN-00029E-Vs for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 10:09:12 -0400 Received: from [93.82.13.132] ([93.82.13.132]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MQ6oB-1XJuTl3Kip-005Hfp; Tue, 05 Aug 2014 16:09:02 +0200 Message-ID: <53E0E578.7010802@gmx.at> Date: Tue, 05 Aug 2014 16:08:56 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> <53E0B0FB.3080203@yandex.ru> <53E0CC2A.7040801@gmx.at> <83y4v3ox6a.fsf@gnu.org> In-Reply-To: <83y4v3ox6a.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:3/17Oo8bzZVjhDiwO6BbaYy1cvC3CSexn9NFGaCIdWFb3omMGSH chX5ZR7gsP/aQ57DI/JpaASm3wdOONviry68ktTzNDfEJRMxCeFkB+2ziTnu3ZwCMzJSTlz McOHoxgDwSSttmFfGO08GjDW19OmQ2yCH8db/ntYLkZ7RFeJEhO4kZfyxpTzWqd3CEIHCog IMvZ66ivxWmiPjidM/dmg== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > But that value is a floating-point number, so accuracy is not lost. Text displayed may be of completely different height. martin From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 10:13:09 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 14:13:09 +0000 Received: from localhost ([127.0.0.1]:58855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfUD-0002GE-3V for submit@debbugs.gnu.org; Tue, 05 Aug 2014 10:13:09 -0400 Received: from mout.gmx.net ([212.227.17.21]:53271) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfUB-0002Fx-8i for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 10:13:07 -0400 Received: from [93.82.13.132] ([93.82.13.132]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0Mg0IT-1X2myN3AHd-00NRpO; Tue, 05 Aug 2014 16:12:58 +0200 Message-ID: <53E0E665.1000206@gmx.at> Date: Tue, 05 Aug 2014 16:12:53 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate 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> In-Reply-To: <83tx5rowop.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:2qEX3n3it8hreRsTasAbTcIFbn4oFfMlym09z2a/y6giC5ti2Ap oeiZRz5w0Hs80K4T1d4T6vaxerldGxZardGtfeG2CxvcFsWgtMXsFmIJ4Z+YOZNmPJzHCO4 kdir45D9f6JYiOZh/ak7EEuGuH3D/xuCSITEvyuOEvZMCvhE3ktNRdk8rEbvtDtgvhdnXsv BEogDd0DTwVsioyHiyI1A== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >> It might be a bit clumsy to work with because you have to >> temporarily show another buffer in its window > > That _is_ the problem. Momentarily flashing some text in some window > is not my idea of a good application. It simply looks like a bug. Well, nobody asked for such a feature so far. Can you fix it so it simply works on the current buffer instead of the window's buffer? martin From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 10:13:18 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 14:13:18 +0000 Received: from localhost ([127.0.0.1]:58858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfUL-0002GZ-Nm for submit@debbugs.gnu.org; Tue, 05 Aug 2014 10:13:18 -0400 Received: from mtaout28.012.net.il ([80.179.55.184]:46594) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfUI-0002GB-FT for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 10:13:15 -0400 Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0N9U009007G0UD00@mtaout28.012.net.il> for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 17:12:40 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9U004ZZ7H41H50@mtaout28.012.net.il>; Tue, 05 Aug 2014 17:12:40 +0300 (IDT) Date: Tue, 05 Aug 2014 17:13:18 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E0E578.7010802@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics Message-id: <83silbowht.fsf@gnu.org> References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> <53E0B0FB.3080203@yandex.ru> <53E0CC2A.7040801@gmx.at> <83y4v3ox6a.fsf@gnu.org> <53E0E578.7010802@gmx.at> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Tue, 05 Aug 2014 16:08:56 +0200 > From: martin rudalics > CC: dgutov@yandex.ru, 18195@debbugs.gnu.org > > > But that value is a floating-point number, so accuracy is not lost. > > Text displayed may be of completely different height. Of course. But that's of no importance for window-screen-lines, because its contract is to count lines in units of the height of the font used by the default face. The fact that the metrics of the default face is used is the reason why I wrote that this is a slippery slope, see my other message. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 10:23:32 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 14:23:32 +0000 Received: from localhost ([127.0.0.1]:58869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfeG-0002Wr-8e for submit@debbugs.gnu.org; Tue, 05 Aug 2014 10:23:32 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:44986) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEfeE-0002Wd-2F for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 10:23:31 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0N9U00E006XFYW00@a-mtaout20.012.net.il> for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 17:23:24 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9U00EQI7YZSX80@a-mtaout20.012.net.il>; Tue, 05 Aug 2014 17:23:24 +0300 (IDT) Date: Tue, 05 Aug 2014 17:23:34 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E0E665.1000206@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics Message-id: <83ppgfow0p.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> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Tue, 05 Aug 2014 16:12:53 +0200 > From: martin rudalics > CC: dgutov@yandex.ru, 18195@debbugs.gnu.org > > >> It might be a bit clumsy to work with because you have to > >> temporarily show another buffer in its window > > > > That _is_ the problem. Momentarily flashing some text in some window > > is not my idea of a good application. It simply looks like a bug. > > Well, nobody asked for such a feature so far. Can you fix it so it > simply works on the current buffer instead of the window's buffer? Fix what exactly? What is "it" in this context? From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 10:38:56 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 14:38:57 +0000 Received: from localhost ([127.0.0.1]:58879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEft9-0002vz-At for submit@debbugs.gnu.org; Tue, 05 Aug 2014 10:38:56 -0400 Received: from mout.gmx.net ([212.227.17.22]:59108) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEft1-0002vf-SB for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 10:38:48 -0400 Received: from [93.82.13.132] ([93.82.13.132]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LfC4q-1Wd78L3C2a-00opQE; Tue, 05 Aug 2014 16:38:41 +0200 Message-ID: <53E0EC6C.7020504@gmx.at> Date: Tue, 05 Aug 2014 16:38:36 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate 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> In-Reply-To: <83ppgfow0p.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:1alOCchxbZRE9VbHdCoPvFctiyuFMEOPfMGzVEDtce1LeQwLuHC b8hhNk0r/E3pzHSxvN+ToP6uqBbP7nm5ou45qzPSycDq2fdFcIE/y02djqxgqugXUKJLaew R7i8GTfhZhvOwg++QR9hhX+6x6617q9kNLxtz/AdQKAaO/XwgTXN0o/m5EZ14wjwAL0P1Rp yHrT4/pPV3NmTD8OojhEg== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >> >> It might be a bit clumsy to work with because you have to >> >> temporarily show another buffer in its window >> > >> > That _is_ the problem. Momentarily flashing some text in some window >> > is not my idea of a good application. It simply looks like a bug. >> >> Well, nobody asked for such a feature so far. Can you fix it so it >> simply works on the current buffer instead of the window's buffer? > > Fix what exactly? What is "it" in this context? `window-text-pixel-size'. Never mind. I'll find a fix. martin From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 11:08:25 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 15:08:25 +0000 Received: from localhost ([127.0.0.1]:58885 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEgLh-0003eh-2W for submit@debbugs.gnu.org; Tue, 05 Aug 2014 11:08:25 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:51406) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEgLc-0003eR-Uv for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 11:08:23 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0N9U00E009QUXG00@a-mtaout22.012.net.il> for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 18:08:14 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9U00EWXA1PY000@a-mtaout22.012.net.il>; Tue, 05 Aug 2014 18:08:14 +0300 (IDT) Date: Tue, 05 Aug 2014 18:08:24 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E0EC6C.7020504@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics Message-id: <83oavzotxz.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> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Tue, 05 Aug 2014 16:38:36 +0200 > From: martin rudalics > CC: dgutov@yandex.ru, 18195@debbugs.gnu.org > > >> Can you fix it so it simply works on the current buffer instead > >> of the window's buffer? > > > > Fix what exactly? What is "it" in this context? > > `window-text-pixel-size'. Never mind. I'll find a fix. You'll need to designate a window anyway, since layout is impossible without knowing in which window it will be done. There's also the issue of the buffer text on which the text will be overlaid: the dimensions of the screen lines to be (partially) overlaid affect the pixel dimensions of the overlaying text. So if the buffer text uses different fonts, the text overlaid on it will have different dimensions than the same text when displayed in its own buffer. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 11:45:48 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 15:45:48 +0000 Received: from localhost ([127.0.0.1]:58946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEgvr-0004dr-6N for submit@debbugs.gnu.org; Tue, 05 Aug 2014 11:45:47 -0400 Received: from mout.gmx.net ([212.227.17.20]:51485) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEgvk-0004dV-CI for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 11:45:46 -0400 Received: from [93.82.13.132] ([93.82.13.132]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0Lfolq-1WdeHw44WA-00pIk2; Tue, 05 Aug 2014 17:45:31 +0200 Message-ID: <53E0FC15.4060502@gmx.at> Date: Tue, 05 Aug 2014 17:45:25 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate 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> In-Reply-To: <83oavzotxz.fsf@gnu.org> Content-Type: multipart/mixed; boundary="------------020000080101000500000500" X-Provags-ID: V03:K0:mKbxWiAi8owmW4WrCtA6ep6bKGCi31O/LufMSFGuq95mA2tnm27 MTvdomiAWjorlSs32GOszKhF/vMLNtfBzR6LubxgdbzTFyKsRpK8WBCJWQ2hu3+VeLL+zJI vVSptIY1KRcsj6y2DbDJZDWncrITm3Gjn1K6vyOYL9LF2F1L911B+sPHy/tHK2teuUG1Mdo RFHMRRQwNZICqHlNNYRsg== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) This is a multi-part message in MIME format. --------------020000080101000500000500 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit > You'll need to designate a window anyway, since layout is impossible > without knowing in which window it will be done. `window-text-pixel-size' works on any life window, by default the selected. > There's also the issue of the buffer text on which the text will be > overlaid: the dimensions of the screen lines to be (partially) > overlaid affect the pixel dimensions of the overlaying text. So if > the buffer text uses different fonts, the text overlaid on it will > have different dimensions than the same text when displayed in its own > buffer. This would have to be done on the Lisp level by selecting some font before calculating the size of the overlay. But I have problems with the attached patch. If I invoke `window-text-pixel-size' with a different buffer than that displayed in the window I get an arguments out of range error. Any ideas? martin A backtrace goes as follows: #0 args_out_of_range (a1=..., a2=...) at data.c:217 #1 0x011eadda in validate_interval_range (object=..., begin=0x82b310, end=0x82b310, force=false) at textprop.c:182 #2 0x011ec8a4 in Ftext_properties_at (position=..., object=...) at textprop.c:601 #3 0x011ec931 in Fget_text_property (position=..., prop=..., object=...) at textprop.c:621 #4 0x010f5806 in face_at_buffer_position (w=0x17b8bf8, pos=82, endptr=0x82b438, limit=182, mouse=0, base_face_id=0) at xfaces.c:5976 #5 0x0102eb20 in handle_face_prop (it=0x82e180) at xdisp.c:3923 #6 0x0102db70 in handle_stop (it=0x82e180) at xdisp.c:3427 #7 0x0103a40c in next_element_from_buffer (it=0x82e180) at xdisp.c:8242 #8 0x01036f16 in get_next_display_element (it=0x82e180) at xdisp.c:6874 #9 0x0103aec6 in move_it_in_display_line_to (it=0x82e180, to_charpos=311, to_x=-1, op=MOVE_TO_POS) at xdisp.c:8582 #10 0x0103d080 in move_it_to (it=0x82e180, to_charpos=311, to_x=-1, to_y=-1, to_vpos=-1, op=10) at xdisp.c:9149 #11 0x0103ec0d in Fwindow_text_pixel_size (window=..., from=..., to=..., x_limit=..., y_limit=..., mode_and_header_line=..., buffer=...) at xdisp.c:9833 #12 0x0118d7f5 in eval_sub (form=...) at eval.c:2202 #13 0x0118cf36 in Feval (form=..., lexical=...) at eval.c:1996 #14 0x0118e9e6 in Ffuncall (nargs=3, args=0x82ebdc) at eval.c:2811 #15 0x011d01d6 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=1, args=0x82ef10) at bytecode.c:918 #16 0x0118f18c in funcall_lambda (fun=..., nargs=1, arg_vector=0x82ef0c) at eval.c:2976 #17 0x0118ebde in Ffuncall (nargs=2, args=0x82ef08) at eval.c:2857 #18 0x011d01d6 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=1, args=0x82f33c) at bytecode.c:918 #19 0x0118f18c in funcall_lambda (fun=..., nargs=1, arg_vector=0x82f338) at eval.c:2976 #20 0x0118ebde in Ffuncall (nargs=2, args=0x82f334) at eval.c:2857 #21 0x01186548 in Ffuncall_interactively (nargs=2, args=0x82f334) at callint.c:270 #22 0x0118e8ac in Ffuncall (nargs=3, args=0x82f330) at eval.c:2789 #23 0x01188170 in Fcall_interactively (function=..., record_flag=..., keys=...) at callint.c:872 #24 0x0118ea15 in Ffuncall (nargs=4, args=0x82f54c) at eval.c:2815 #25 0x011d01d6 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=1, args=0x82f894) at bytecode.c:918 #26 0x0118f18c in funcall_lambda (fun=..., nargs=1, arg_vector=0x82f890) at eval.c:2976 #27 0x0118ebde in Ffuncall (nargs=2, args=0x82f88c) at eval.c:2857 #28 0x0118e4a5 in call1 (fn=..., arg1=...) at eval.c:2607 #29 0x010ffcee in command_loop_1 () at keyboard.c:1545 #30 0x0118b92a in internal_condition_case (bfun=0x10ff67c , handlers=..., hfun=0x10feee7 ) at eval.c:1347 #31 0x010ff332 in command_loop_2 (ignore=...) at keyboard.c:1169 #32 0x0118aede in internal_catch (tag=..., func=0x10ff30e , arg=...) at eval.c:1111 #33 0x010ff2ec in command_loop () at keyboard.c:1148 #34 0x010fea83 in recursive_edit_1 () at keyboard.c:769 #35 0x010fec40 in Frecursive_edit () at keyboard.c:840 #36 0x010fcdaf in main (argc=1, argv=0xa327e8) at emacs.c:1650 Lisp Backtrace: "window-text-pixel-size" (0x82ea80) "eval" (0x82ebe0) "eval-last-sexp-1" (0x82ef0c) "eval-last-sexp" (0x82f338) "funcall-interactively" (0x82f334) "call-interactively" (0x82f550) "command-execute" (0x82f890) --------------020000080101000500000500 Content-Type: text/plain; charset=windows-1252; name="window-text-pixel-size.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="window-text-pixel-size.diff" === modified file 'src/xdisp.c' --- src/xdisp.c 2014-08-01 13:10:07 +0000 +++ src/xdisp.c 2014-08-05 15:28:23 +0000 @@ -9713,7 +9713,7 @@ && it->dpvec + it->current.dpvec_index != it->dpend); } -DEFUN ("window-text-pixel-size", Fwindow_text_pixel_size, Swindow_text_pixel_size, 0, 6, 0, +DEFUN ("window-text-pixel-size", Fwindow_text_pixel_size, Swindow_text_pixel_size, 0, 7, 0, doc: /* Return the size of the text of WINDOW's buffer in pixels. WINDOW must be a live window and defaults to the selected one. The return value is a cons of the maximum pixel-width of any text line and @@ -9746,9 +9746,13 @@ include the height of the mode- or header-line of WINDOW in the return value. If it is either the symbol `mode-line' or `header-line', include only the height of that line, if present, in the return value. If t, -include the height of both, if present, in the return value. */) +include the height of both, if present, in the return value. + +Optional argument BUFFER, if non-nil, means to work on another buffer +than that displayed in WINDOW. If BUFFER denotes a live buffer, use +that buffer. If BUFFER equals t, use the current buffer. */) (Lisp_Object window, Lisp_Object from, Lisp_Object to, Lisp_Object x_limit, Lisp_Object y_limit, - Lisp_Object mode_and_header_line) + Lisp_Object mode_and_header_line, Lisp_Object buffer) { struct window *w = decode_live_window (window); Lisp_Object buf; @@ -9760,14 +9764,25 @@ void *itdata = NULL; int c, max_y = -1, x = 0, y = 0; - buf = w->contents; - CHECK_BUFFER (buf); - b = XBUFFER (buf); - - if (b != current_buffer) + if (!EQ (buffer, Qt)) { - old_buffer = current_buffer; - set_buffer_internal (b); + if (NILP (buffer)) + { + buf = w->contents; + CHECK_BUFFER (buf); + b = XBUFFER (buf); + } + else + { + CHECK_BUFFER (buffer); + b = XBUFFER (buffer); + } + + if (b != current_buffer) + { + old_buffer = current_buffer; + set_buffer_internal (b); + } } if (NILP (from)) @@ -15814,6 +15829,17 @@ left. */ whole = max (whole, w->hscroll + box_width); whole = max (whole, end - start); + if (it.bidi_p) + { + Lisp_Object pdir; + + pdir = Fcurrent_bidi_paragraph_direction (Qnil); + if (EQ (pdir, Qright_to_left)) + { + end = whole - w->hscroll * FRAME_COLUMN_WIDTH (WINDOW_XFRAME (w)); + start = end - box_width; + } + } if (old_buffer) set_buffer_internal (old_buffer); --------------020000080101000500000500-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 13:57:58 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 17:57:58 +0000 Received: from localhost ([127.0.0.1]:59134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEizm-0008C2-63 for submit@debbugs.gnu.org; Tue, 05 Aug 2014 13:57:58 -0400 Received: from mtaout25.012.net.il ([80.179.55.181]:42832) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEizi-0008Bj-S5 for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 13:57:56 -0400 Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0N9U00A00HGLPJ00@mtaout25.012.net.il> for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 20:52:57 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9U004XAHO9ML60@mtaout25.012.net.il>; Tue, 05 Aug 2014 20:52:57 +0300 (IDT) Date: Tue, 05 Aug 2014 20:57:58 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E0FC15.4060502@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics Message-id: <83lhr2q0nt.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> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Tue, 05 Aug 2014 17:45:25 +0200 > From: martin rudalics > CC: dgutov@yandex.ru, 18195@debbugs.gnu.org > > > There's also the issue of the buffer text on which the text will be > > overlaid: the dimensions of the screen lines to be (partially) > > overlaid affect the pixel dimensions of the overlaying text. So if > > the buffer text uses different fonts, the text overlaid on it will > > have different dimensions than the same text when displayed in its own > > buffer. > > 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? 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. > But I have problems with the attached patch. If I invoke > `window-text-pixel-size' with a different buffer than that displayed > in the window I get an arguments out of range error. Any ideas? You switched the current buffer, but not the buffer pointed to by w->contents. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 17:22:17 2014 Received: (at 18195) by debbugs.gnu.org; 5 Aug 2014 21:22:17 +0000 Received: from localhost ([127.0.0.1]:59304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEmBU-0004yo-Do for submit@debbugs.gnu.org; Tue, 05 Aug 2014 17:22:16 -0400 Received: from mail-lb0-f171.google.com ([209.85.217.171]:33030) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEmBR-0004yU-C4 for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 17:22:14 -0400 Received: by mail-lb0-f171.google.com with SMTP id l4so1230341lbv.30 for <18195@debbugs.gnu.org>; Tue, 05 Aug 2014 14:22:07 -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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=wvWA0YmQC+cOsoDXQHnYa8wriL5JNV8N9ymgjs1Lpeo=; b=yxDqPTXqbe+KtB1q7anvbD3UlfEkVnIgUzR3iQrZrWODs/172/qH6tsixBFjBMJwlP ZHYaAtk4BLq3CPgWXqf9utgUPijqBBwtERLnHBI9SJNB3160ou4Cw3OmqN5gD21shyzH 5qvWajpDVR9OjFfs+gQxVjJssuS2R4Ih9CgvFcrKnjBVWNNbzkbLq3phyKVHpCIptAho MdY1MqQtTjDlltehLc2McVg9Q2m3+amfJNaUngfXpsnlHA0AKez3tkhqKAgwghDXvHmy scCQMbYHd07OnctV68Ddaj7np1wK1pj7EizgRFqYpe+RHotAeFT2hwbZjOZ+uNymfqvz oDhw== X-Received: by 10.112.98.198 with SMTP id ek6mr6845093lbb.22.1407273727331; Tue, 05 Aug 2014 14:22:07 -0700 (PDT) Received: from [10.8.0.26] (v-2-eu19-d3962-07.webazilla.com. [78.140.151.7]) by mx.google.com with ESMTPSA id c9sm1473579laa.32.2014.08.05.14.22.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Aug 2014 14:22:06 -0700 (PDT) Message-ID: <53E14AF4.6050804@yandex.ru> Date: Wed, 06 Aug 2014 01:21:56 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <8338dbqcai.fsf@gnu.org> In-Reply-To: <8338dbqcai.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 08/05/2014 05:46 PM, Eli Zaretskii wrote: > I fixed window-screen-lines. Thanks! > For example, AFAIU, your code currently assumes that the font used for > popup is the same as the one used for the underlying buffer text. But > since you provide faces for the popup, a user could legitimately > customize those faces to use a different font, and thus invalidate > your calculations, because window-screen-lines uses the metrics of the > default face's font. Sure. This doesn't add any constraints over what we've been living with for years. > IMO, instead of overloading existing display features with jobs they > were never designed to do, and then live forever with the situation > where development breaks the resulting applications (like the > pixel-wise resizing of windows did with this one) pixel-wise resizing wasn't actually the culprit: I've just never tested the code with non-zero line-spacing. Even with it, the bug wasn't too easy to notice. > it would be a much > better investment of energy to come up with requirements for Lisp APIs > that could be used by applications for laying out text. That sounds great, but I don't even know where to start. What we're trying to emulate, though, is multi-layered display. That sounds somewhat different from a "text layout API" to me. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 22:52:10 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 02:52:11 +0000 Received: from localhost ([127.0.0.1]:59671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XErKk-0004pD-18 for submit@debbugs.gnu.org; Tue, 05 Aug 2014 22:52:10 -0400 Received: from mtaout28.012.net.il ([80.179.55.184]:50637) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XErKg-0004of-UF for 18195@debbugs.gnu.org; Tue, 05 Aug 2014 22:52:08 -0400 Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0N9V000006L08S00@mtaout28.012.net.il> for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 05:51:31 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9V00P626LV6K00@mtaout28.012.net.il>; Wed, 06 Aug 2014 05:51:31 +0300 (IDT) Date: Wed, 06 Aug 2014 05:52:11 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E14AF4.6050804@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83k36mpbxg.fsf@gnu.org> References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <8338dbqcai.fsf@gnu.org> <53E14AF4.6050804@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Wed, 06 Aug 2014 01:21:56 +0400 > From: Dmitry Gutov > CC: rudalics@gmx.at, 18195@debbugs.gnu.org > > > For example, AFAIU, your code currently assumes that the font used for > > popup is the same as the one used for the underlying buffer text. But > > since you provide faces for the popup, a user could legitimately > > customize those faces to use a different font, and thus invalidate > > your calculations, because window-screen-lines uses the metrics of the > > default face's font. > > Sure. This doesn't add any constraints over what we've been living with > for years. Until some user would ask to lift them. But if you never want to lift them, why not define colors instead of full-fledged faces? Then those restrictions are really carved in stone and clear for all. > > IMO, instead of overloading existing display features with jobs they > > were never designed to do, and then live forever with the situation > > where development breaks the resulting applications (like the > > pixel-wise resizing of windows did with this one) > > pixel-wise resizing wasn't actually the culprit: I've just never tested > the code with non-zero line-spacing. The bug had two parts; one of them _was_ due to pixel-wise resizing. > > it would be a much > > better investment of energy to come up with requirements for Lisp APIs > > that could be used by applications for laying out text. > > That sounds great, but I don't even know where to start. What we're > trying to emulate, though, is multi-layered display. That sounds > somewhat different from a "text layout API" to me. I don't mind how it is called and what is the correct abstraction. I do know that we need some abstraction and APIs to support it. If you already know what the correct abstraction is, then you are in a good position to formulate the requirements. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 05:41:43 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 09:41:43 +0000 Received: from localhost ([127.0.0.1]:59932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XExj5-0006Yw-4B for submit@debbugs.gnu.org; Wed, 06 Aug 2014 05:41:43 -0400 Received: from mout.gmx.net ([212.227.17.22]:60461) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XExj3-0006Yj-IY for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 05:41:42 -0400 Received: from [188.22.35.183] ([188.22.35.183]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0MPIvU-1XJLRd2TVg-004Oud; Wed, 06 Aug 2014 11:41:33 +0200 Message-ID: <53E1F846.2040105@gmx.at> Date: Wed, 06 Aug 2014 11:41:26 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate 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> In-Reply-To: <83lhr2q0nt.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:KOp/295Bib1/rNs34xcAdihzCjiwaRyADMI9WsCMqEY6pYr4bDN tDkVIiDDhMX+ixh1E5vbgoVPQ3jN+6C40gKwpx9Zr3RkC2VVBEUA3NNZiKfwOFWnHX9D1vY r+z0D2ud8hog6C5aqCoWXE5sBiD4PiFaX/tlxRl5McnXbXH0YgJW85w/XJnYDaGaiNXKPTr +ms5J3ZpEkTrxE5lfZpuw== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >> 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? 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. >> But I have problems with the attached patch. If I invoke >> `window-text-pixel-size' with a different buffer than that displayed >> in the window I get an arguments out of range error. Any ideas? > > You switched the current buffer, but not the buffer pointed to by > w->contents. That was the problem, indeed. Thanks, martin From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 07:55:19 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 11:55:19 +0000 Received: from localhost ([127.0.0.1]:59985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEzoN-0002gl-0g for submit@debbugs.gnu.org; Wed, 06 Aug 2014 07:55:19 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]:56372) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEzoJ-0002gU-AT for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 07:55:16 -0400 Received: by mail-lb0-f179.google.com with SMTP id v6so1797652lbi.10 for <18195@debbugs.gnu.org>; Wed, 06 Aug 2014 04:55:08 -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=FIc8t4uiAJx6BWYdkhfjZfMO0/U5I3TwPG5ochB5wHM=; b=Bzr+D+7Ua1kvnE/QFJxwYacSA/ZAPxFdY675PBYFCkAdBVd/LDbrpjvCBi8BvR60ca GhLwkZVHx68gsbdjDtJ61zTwGueqAJg/J2DvweBPSyC7UzKSX38SQ0cMqZjMqcAiMZZI NXIILNYUmGw4CUrbWDxU2oPZS0g+Pg1YXTqfp2Ff3EjfMl6cttjA7H0iFg7U0yIT5cRU AcYA8oWCESMIPhs+PqxaphVDa2n9V7WWuqma0j9azDHS/9t8x2U9Zk4wKBI6jTcyUi4h rF2EVQMKK67Lr/elo5WYKSbLuv5x3t/A+DoLJAvBbqEcwA88mokVs9gyeevwU7r/FONs NGjA== X-Received: by 10.112.25.104 with SMTP id b8mr10171049lbg.95.1407326108784; Wed, 06 Aug 2014 04:55:08 -0700 (PDT) Received: from [10.8.0.26] (v-2-eu19-d3962-07.webazilla.com. [78.140.151.7]) by mx.google.com with ESMTPSA id a5sm1133481lbw.21.2014.08.06.04.55.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Aug 2014 04:55:07 -0700 (PDT) Message-ID: <53E21796.4040505@yandex.ru> Date: Wed, 06 Aug 2014 15:55:02 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: martin rudalics , 18195@debbugs.gnu.org Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> <53E0B0FB.3080203@yandex.ru> <53E0CC2A.7040801@gmx.at> <53E0D690.1030208@yandex.ru> <53E0E12A.3050204@gmx.at> In-Reply-To: <53E0E12A.3050204@gmx.at> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18195 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 08/05/2014 05:50 PM, martin rudalics wrote: > Overlays don't know about newlines. We're using a multiline overlay: it both spans several lines, and its `before-string' property contains a multiline string when it's "on". > I suppose the overlay starts at the > beginning of some line after text T and has as many characters as there > are in the text with height O. If you want to cover any text with the > overlay do that. Sorry, I don't understand. > IIUC you neither need pixels nor lines in the end result. You just want > to know whether a given overlay fits into a given window at a given > position. We don't have the overlay at that point in time yet: when it's created, it's constructed using the underlying buffer text, too. Being able to just show a rectangle would require some dedicated API, like Eli mentioned. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 08:09:56 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 12:09:56 +0000 Received: from localhost ([127.0.0.1]:60002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF02W-00033h-2V for submit@debbugs.gnu.org; Wed, 06 Aug 2014 08:09:56 -0400 Received: from mail-lb0-f177.google.com ([209.85.217.177]:49672) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF02T-00033R-SI for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 08:09:54 -0400 Received: by mail-lb0-f177.google.com with SMTP id s7so1818036lbd.22 for <18195@debbugs.gnu.org>; Wed, 06 Aug 2014 05:09:47 -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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=sT9A+hdBbSaJxFmUvFlpDMt04DU1Avviisa9tJKmEWo=; b=irEXaoKUqPf7CGkvzT2FaW/O2XGFQ//Ao6ec90r/2BtRnfwSv/zHFPn0C7AsGcDhYU yV5Ikx2fwxzmHvMTKi2XMLlLifzE1HL9ELEE0xXL4f0CyvvPDyeMARyoEIJhHX7M59jP PU2v3OBfqPzeDdXG3TLesL1MgzzrGkHlka+nJ4kw8gC1SffwSx570HhrJeGnT8u+J8P4 RZkboN2ABoI23ibOdorQDRlJ3KAKobhdkR1NEBMSA360AkP7VAusCcZu4BRz+YUgfMxL SgaC9GjB7piRB/qinEa3NDC/kYIiybt42c/KCUhv5cE1okkz5XpQ0qY6phzputNN6rGt oUaQ== X-Received: by 10.112.53.199 with SMTP id d7mr2468483lbp.106.1407326987865; Wed, 06 Aug 2014 05:09:47 -0700 (PDT) Received: from [10.8.0.26] (v-2-eu19-d3962-07.webazilla.com. [78.140.151.7]) by mx.google.com with ESMTPSA id pz3sm1194945lbb.1.2014.08.06.05.09.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Aug 2014 05:09:47 -0700 (PDT) Message-ID: <53E21B05.9000504@yandex.ru> Date: Wed, 06 Aug 2014 16:09:41 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <8338dbqcai.fsf@gnu.org> <53E14AF4.6050804@yandex.ru> <83k36mpbxg.fsf@gnu.org> In-Reply-To: <83k36mpbxg.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 08/06/2014 06:52 AM, Eli Zaretskii wrote: > Until some user would ask to lift them. Apparently, every user that tried to change the font understood that any resulting problems stemmed from their actions, and so we've never had any bug reports about that. > But if you never want to lift them, why not define colors instead of > full-fledged faces? Then those restrictions are really carved in > stone and clear for all. Well, there are also text decorations, and users should be able to add (most of) them without running into problems. Faces seem to be a natural fit for themes, and they're supported by quite of a few of existing themes out there. Making the backward-incompatible change you're suggesting will break that. Finally, who's to say the current limitations will stay with us forever? If Emacs defines a suitable API, the current faces should be able to transition seamlessly, while users will also gain the ability to change the fonts. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 10:39:19 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 14:39:19 +0000 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 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 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) 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) Date: Wed, 06 Aug 2014 17:39:18 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E1F846.2040105@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics 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> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > 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. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 10:41:37 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 14:41:37 +0000 Received: from localhost ([127.0.0.1]:60441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF2PJ-0000zG-1F for submit@debbugs.gnu.org; Wed, 06 Aug 2014 10:41:37 -0400 Received: from mail-la0-f45.google.com ([209.85.215.45]:48917) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF2PH-0000z1-5u for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 10:41:35 -0400 Received: by mail-la0-f45.google.com with SMTP id ty20so2105904lab.4 for <18195@debbugs.gnu.org>; Wed, 06 Aug 2014 07:41:28 -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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=iW6G2fM0reRP5GAflC6JJfC+rKzUNBv1B2Kwv0D124M=; b=ObdVOPP5sTtp1c9sEv/tYaA0zvPrX+78KfaybNUKYsW5FGrmfzeImiPnQUftW2o395 85IcxJZ9gRPgRk4dfGAF694Btmkns7ZU/Pjgcvmiy6E82oAV1I7PyJwJiWo/S2gWMHt1 gU7kL2ZN2k3gBQCTMvK8TGm5pM+jOVu5ZnEC/vFB9vPyILe1DWC2D8kFKlNG/icMoiZU Z5Cki9JTtdSx5y0LdKUqoTJ535yQuLysqmFQg7kQ0YTsJwSIb8CU5bbSkuJjqICBAhkg JiC6Gm1mrWfhgGZ9eHF7+hkS+GGcL/hAsAztcbKsbM3eV4fK5zrvYOsgN2WxQb39vyLz w6aA== X-Received: by 10.152.180.36 with SMTP id dl4mr11743502lac.26.1407336088778; Wed, 06 Aug 2014 07:41:28 -0700 (PDT) Received: from [10.8.0.26] (v-2-eu19-d3962-07.webazilla.com. [78.140.151.7]) by mx.google.com with ESMTPSA id o15sm583086laa.44.2014.08.06.07.41.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Aug 2014 07:41:27 -0700 (PDT) Message-ID: <53E23E91.5070802@yandex.ru> Date: Wed, 06 Aug 2014 18:41:21 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Eli Zaretskii , martin rudalics Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate 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> In-Reply-To: <83ha1pptrd.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 08/06/2014 06:39 PM, Eli Zaretskii wrote: > That's because the > candidates are displayed by Company by putting overlays on consecutive > lines of text, each overlay showing one candidate. Not really. We have a pull request that changes the code to do what you're describing, but for the moment we only use one overlay at a time. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 10:45:08 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 14:45:08 +0000 Received: from localhost ([127.0.0.1]:60445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF2Sh-00014y-0x for submit@debbugs.gnu.org; Wed, 06 Aug 2014 10:45:07 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:40020) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF2Sd-00014B-Sn for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 10:45:04 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0N9W005003GXLX00@a-mtaout20.012.net.il> for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 17:44:57 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9W0057W3MWEQ40@a-mtaout20.012.net.il>; Wed, 06 Aug 2014 17:44:57 +0300 (IDT) Date: Wed, 06 Aug 2014 17:45:09 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E21B05.9000504@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83fvh9pthm.fsf@gnu.org> References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <8338dbqcai.fsf@gnu.org> <53E14AF4.6050804@yandex.ru> <83k36mpbxg.fsf@gnu.org> <53E21B05.9000504@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Wed, 06 Aug 2014 16:09:41 +0400 > From: Dmitry Gutov > CC: rudalics@gmx.at, 18195@debbugs.gnu.org > > On 08/06/2014 06:52 AM, Eli Zaretskii wrote: > > > Until some user would ask to lift them. > > Apparently, every user that tried to change the font understood that any > resulting problems stemmed from their actions, and so we've never had > any bug reports about that. AFAIU, you are developing infrastructure. It is generally expected from infrastructure, at least that in Emacs core, to support everything that wasn't explicitly documented as forbidden or unsupported. OTOH, perhaps next time someone complains about some weird combination of display features that happen not to work, I should respond "restriction" and see what happens. > > But if you never want to lift them, why not define colors instead of > > full-fledged faces? Then those restrictions are really carved in > > stone and clear for all. > > Well, there are also text decorations, and users should be able to add > (most of) them without running into problems. Which decorations are those? > Finally, who's to say the current limitations will stay with us forever? > If Emacs defines a suitable API, the current faces should be able to > transition seamlessly, while users will also gain the ability to change > the fonts. Nothing like that will happen in Emacs without motivated individuals driving the development. IMO, we should either push development in the direction I suggested (or similar), or explicitly forbid using different fonts in Company completion, at least in the documentation, if not by error messages. Anything else is unwise, IMO. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 11:07:49 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 15:07:49 +0000 Received: from localhost ([127.0.0.1]:60459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF2oe-0001dK-8n for submit@debbugs.gnu.org; Wed, 06 Aug 2014 11:07:48 -0400 Received: from mail-la0-f52.google.com ([209.85.215.52]:58315) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF2ob-0001d6-Ok for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 11:07:46 -0400 Received: by mail-la0-f52.google.com with SMTP id b17so1129319lan.11 for <18195@debbugs.gnu.org>; Wed, 06 Aug 2014 08:07:39 -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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=IYbWaLaKY+MQAa+Xbs9BazhMj+NO7Los1krTOrW08q8=; b=fth3VWCyh6nZRbhSPNr/xnXBIXG/G7OH/tVipvrCFXo4oFSN7zERBATXoq+B6griKI Pfs5LOOWvPKSp9riYgBm7Z6TP0v4RrAHi8OYMh8sdJf6TWKXOIP4VpafdSOPcYLorsbx k2zI3EoMtkl19fnlcZibQ06NcpRUJW3Ayd8DroxKSYfpA/El2++A3qWEu0GFmXydgtUR huPtyPUEkAK4qIYfVtHxvP2NDp+dMIlurzGsqtf9FomrMxG8itTFGXitrJjVKKns2h4c KFuFrLCBUXHoW6rMux1or2gSBPuBIZzqg8hhbDucBv+TOE6auhQfbq5Vy6JfA36hT4Xb hB1g== X-Received: by 10.152.22.65 with SMTP id b1mr11721524laf.86.1407337659782; Wed, 06 Aug 2014 08:07:39 -0700 (PDT) Received: from [10.8.0.26] (v-2-eu19-d3962-07.webazilla.com. [78.140.151.7]) by mx.google.com with ESMTPSA id cq7sm623607lad.1.2014.08.06.08.07.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Aug 2014 08:07:38 -0700 (PDT) Message-ID: <53E244B4.1000305@yandex.ru> Date: Wed, 06 Aug 2014 19:07:32 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <8338dbqcai.fsf@gnu.org> <53E14AF4.6050804@yandex.ru> <83k36mpbxg.fsf@gnu.org> <53E21B05.9000504@yandex.ru> <83fvh9pthm.fsf@gnu.org> In-Reply-To: <83fvh9pthm.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 08/06/2014 06:45 PM, Eli Zaretskii wrote: > AFAIU, you are developing infrastructure. It is generally expected > from infrastructure, at least that in Emacs core, to support > everything that wasn't explicitly documented as forbidden or > unsupported. I'm inclined to consider this a missing feature, of which Emacs display engine has plenty. But documenting using different fonts in faces as prohibited sounds fine to me as well. Anyway, I've written to emacs-devel about features which would make my life easier. >> Well, there are also text decorations, and users should be able to add >> (most of) them without running into problems. > > Which decorations are those? Underline, bold, italic..? From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 12:13:59 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 16:13:59 +0000 Received: from localhost ([127.0.0.1]:60498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF3qg-0003HV-V2 for submit@debbugs.gnu.org; Wed, 06 Aug 2014 12:13:59 -0400 Received: from mout.gmx.net ([212.227.15.18]:50960) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF3qe-0003HG-4N for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 12:13:57 -0400 Received: from [88.117.49.190] ([88.117.49.190]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MAPoQ-1X7xMP42DS-00BcUd; Wed, 06 Aug 2014 18:13:48 +0200 Message-ID: <53E25435.7010209@gmx.at> Date: Wed, 06 Aug 2014 18:13:41 +0200 From: martin rudalics MIME-Version: 1.0 To: Dmitry Gutov , 18195@debbugs.gnu.org Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <53E0AF08.50300@gmx.at> <53E0B0FB.3080203@yandex.ru> <53E0CC2A.7040801@gmx.at> <53E0D690.1030208@yandex.ru> <53E0E12A.3050204@gmx.at> <53E21796.4040505@yandex.ru> In-Reply-To: <53E21796.4040505@yandex.ru> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:mieM4vgu9azoO0G+j7ykMU4pQ6MaEqdRCySR+DiTbhQPO1Pz7m/ ayzixvTLzUSqcxv63KF9U/mJMTgDKIj3Nf9HU9ws3bwZhm3BnzdPpBx1AboCiBqFgeswZa6 akRjPc7gMwFR3Ve8RCM+9+nOpKbl9G+J8x2QBaYpK8wL+yvMggNjvD2KKNQ12afQDW4m0Nr fTW3JLtmv3FCFC7XB9ttQ== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >> Overlays don't know about newlines. > > We're using a multiline overlay: it both spans several lines, and its `before-string' property contains a multiline string when it's "on". Still, an Emacs overlay is a display object that replaces a possibly empty buffer string with a possibly empty string. Any of these strings can contain newlines but the overlay is specified only by the buffer positions and the replacement string. >> IIUC you neither need pixels nor lines in the end result. You just want >> to know whether a given overlay fits into a given window at a given >> position. > > We don't have the overlay at that point in time yet: when it's created, it's constructed using the underlying buffer text, too. But you have the underlying buffer text at the time you create the overlay I suppose. So what hinders you to get the size of the overlay by using a temporary buffer, inserting the underlying buffer text, put the overlay there, and calculate the resulting height? martin From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 12:15:16 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 16:15:16 +0000 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 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 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 Message-ID: <53E25484.8050909@gmx.at> Date: Wed, 06 Aug 2014 18:15:00 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate 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> In-Reply-To: <83ha1pptrd.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:a7IipGQMGRAy7ZOn8yjHDg2FpachnV6Xe/qE7+t6k9GZNClcFcF psyhKSbHiKK+/TJe/EHqprpycIw0XFh0SnU4EDdutpFLzrhHiLpEwBL/MkhaocSnRq55sqz 9oQ7pjaEG0h7w5BS7DU7Q4cPkvFn2sQdAabekwiDG6piaDDw6tt3ZMpPq3LnxzDj6S/R6M1 osldDBHQleUtbLhkTt4yA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >>>> 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 12:23:48 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 16:23:48 +0000 Received: from localhost ([127.0.0.1]:60524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF40C-0003Yd-5r for submit@debbugs.gnu.org; Wed, 06 Aug 2014 12:23:48 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:57594) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF409-0003YL-7N for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 12:23:46 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0N9W006007Y5DQ00@a-mtaout20.012.net.il> for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 19:23:38 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9W005WY87EWX80@a-mtaout20.012.net.il>; Wed, 06 Aug 2014 19:23:38 +0300 (IDT) Date: Wed, 06 Aug 2014 19:23:51 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E23E91.5070802@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83d2cdpox4.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> <83ha1pptrd.fsf@gnu.org> <53E23E91.5070802@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Wed, 06 Aug 2014 18:41:21 +0400 > From: Dmitry Gutov > CC: 18195@debbugs.gnu.org > > On 08/06/2014 06:39 PM, Eli Zaretskii wrote: > > > That's because the > > candidates are displayed by Company by putting overlays on consecutive > > lines of text, each overlay showing one candidate. > > Not really. We have a pull request that changes the code to do what > you're describing, but for the moment we only use one overlay at a time. I'm talking about a kind of menu of candidates, which definitely takes more than one line. That cannot be done with a single overlay, unless you copy the buffer text into the overlay string, and completely cover the buffer text itself. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 12:24:57 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 16:24:57 +0000 Received: from localhost ([127.0.0.1]:60528 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF41I-0003ab-R3 for submit@debbugs.gnu.org; Wed, 06 Aug 2014 12:24:57 -0400 Received: from mtaout27.012.net.il ([80.179.55.183]:45854) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF41G-0003aJ-Jk for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 12:24:55 -0400 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0N9W00F007UAIH00@mtaout27.012.net.il> for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 19:19:58 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9W009J381AKJ60@mtaout27.012.net.il>; Wed, 06 Aug 2014 19:19:58 +0300 (IDT) Date: Wed, 06 Aug 2014 19:25:00 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E244B4.1000305@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83bnrxpov7.fsf@gnu.org> References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <8338dbqcai.fsf@gnu.org> <53E14AF4.6050804@yandex.ru> <83k36mpbxg.fsf@gnu.org> <53E21B05.9000504@yandex.ru> <83fvh9pthm.fsf@gnu.org> <53E244B4.1000305@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Wed, 06 Aug 2014 19:07:32 +0400 > From: Dmitry Gutov > CC: rudalics@gmx.at, 18195@debbugs.gnu.org > > >> Well, there are also text decorations, and users should be able to add > >> (most of) them without running into problems. > > > > Which decorations are those? > > Underline, bold, italic..? They all use fonts that are different from the default one, and thus change the height of the screen lines, if only by a few pixels. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 12:27:01 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 16:27:01 +0000 Received: from localhost ([127.0.0.1]:60532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF43I-0003e3-Ih for submit@debbugs.gnu.org; Wed, 06 Aug 2014 12:27:00 -0400 Received: from mail-la0-f49.google.com ([209.85.215.49]:36006) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF43F-0003dh-WF for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 12:26:58 -0400 Received: by mail-la0-f49.google.com with SMTP id hz20so2346034lab.22 for <18195@debbugs.gnu.org>; Wed, 06 Aug 2014 09:26:51 -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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=T4tAPEjr78QavpX62E3pHN+rymPo5rbYuSmeoM9eWTk=; b=NAZ9RW23IkyidRGPON31M2V7hDx7BjJA2U792mhLkXlKjl0XLCEacN/EU3ZK9xlr5n ixu4hRSZ8x4uiDhxjWATdK7QCXaMHoBcBRmrvHGOZfkhFRO9rO3CT1bwXgLzxEXp7hIB yvjqpxYCMSnrrN5RlW4gLPR4atNLdIcHKenZlOTred6cM9o1pxCqtkUYysABtv6zXarp nvbXL8pk2LEqttEFLPooqywnE3H80AqfW1+mbe/6KZQOPQJ1GjN6Yeg/le6fXM2Qopt6 3UOr/kuRTP9uPw8ptCz7zLCX5+UXOAm9s5AZjI6y+31OPP95WPQ6feEmPZoB0VDGospx JPRg== X-Received: by 10.152.163.33 with SMTP id yf1mr12211216lab.6.1407342411801; Wed, 06 Aug 2014 09:26:51 -0700 (PDT) Received: from [10.8.0.26] (v-2-eu19-d3962-07.webazilla.com. [78.140.151.7]) by mx.google.com with ESMTPSA id f9sm2003572lbd.46.2014.08.06.09.26.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Aug 2014 09:26:50 -0700 (PDT) Message-ID: <53E25744.7090603@yandex.ru> Date: Wed, 06 Aug 2014 20:26:44 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate 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> <53E23E91.5070802@yandex.ru> <83d2cdpox4.fsf@gnu.org> In-Reply-To: <83d2cdpox4.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 08/06/2014 08:23 PM, Eli Zaretskii wrote: >> Not really. We have a pull request that changes the code to do what >> you're describing, but for the moment we only use one overlay at a time. > > I'm talking about a kind of menu of candidates, which definitely takes > more than one line. That cannot be done with a single overlay, unless > you copy the buffer text into the overlay string, and completely cover > the buffer text itself. Indeed, that's what we do currently. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 12:30:12 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 16:30:12 +0000 Received: from localhost ([127.0.0.1]:60538 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF46M-0003kU-AC for submit@debbugs.gnu.org; Wed, 06 Aug 2014 12:30:12 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:34111) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF46G-0003ii-AB for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 12:30:05 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0N9W006008HHMW00@a-mtaout22.012.net.il> for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 19:29:57 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9W006Z18HWDI20@a-mtaout22.012.net.il>; Wed, 06 Aug 2014 19:29:57 +0300 (IDT) Date: Wed, 06 Aug 2014 19:30:09 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E25484.8050909@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics Message-id: <83a97hpomm.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> <83ha1pptrd.fsf@gnu.org> <53E25484.8050909@gmx.at> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Wed, 06 Aug 2014 18:15:00 +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 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 the popped up text overlays existing buffer display, it should ideally use the same fonts as the overlaid text uses. But if that overlaid text uses several different fonts, shadowing that in the overlay is all but trivial. > 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 "fonts", plural. When the buffer text uses several different fonts, selection of font for the overlay is complicated at best. > >> 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? You are talking about things that are possible only on the C level, not from Lisp. My point was that we don't expose enough APIs to Lisp to allow such applications, and you now agreed with me. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 12:37:20 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 16:37:20 +0000 Received: from localhost ([127.0.0.1]:60549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF4DH-0003wn-Hq for submit@debbugs.gnu.org; Wed, 06 Aug 2014 12:37:20 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:47611) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF4DD-0003wT-Qs for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 12:37:17 -0400 Received: by mail-la0-f46.google.com with SMTP id b8so2358587lan.5 for <18195@debbugs.gnu.org>; Wed, 06 Aug 2014 09:37:09 -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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=6W0izoEeKQk+ZgQpPg+ItaZ3GCT4jXfqt6RB2XfBlh8=; b=xCD5Eb5O/tDE/78KYXsPkFJsMTllwF/sf9PLDYlpCHZmXn7dn36vAsE+DGJCyVvRyY 3UtcrFAtMkX0hR+C9Bwiqi+XJvNNUl5Oizm1+u1LvqzwmD2f1nEI1MzJn5pTItLBcABz rHbjAq8SqttuBxtv3hKvpS6F1ll63lSJ+4KgCeZarB5dvCS5vM9kAUGgJqnKdWtjUXTa yEXwRKMhY9WLjorQZVKzd+X3GDRCYO/PXOq/SuMZJsglWwH/9n4nM7gXQci5tz4tPMDu cpasEGORp+jhW/jQGjiikpptxBjXTo43HAq/+zr1reNhEzEroQphiWkBofN0tMRKr98h pkNw== X-Received: by 10.112.159.200 with SMTP id xe8mr11784976lbb.55.1407343029605; Wed, 06 Aug 2014 09:37:09 -0700 (PDT) Received: from [10.8.0.26] (v-2-eu19-d3962-07.webazilla.com. [78.140.151.7]) by mx.google.com with ESMTPSA id g8sm718456lam.23.2014.08.06.09.37.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Aug 2014 09:37:08 -0700 (PDT) Message-ID: <53E259AE.6020307@yandex.ru> Date: Wed, 06 Aug 2014 20:37:02 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <8338dbqcai.fsf@gnu.org> <53E14AF4.6050804@yandex.ru> <83k36mpbxg.fsf@gnu.org> <53E21B05.9000504@yandex.ru> <83fvh9pthm.fsf@gnu.org> <53E244B4.1000305@yandex.ru> <83bnrxpov7.fsf@gnu.org> In-Reply-To: <83bnrxpov7.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 08/06/2014 08:25 PM, Eli Zaretskii wrote: >> Underline, bold, italic..? > > They all use fonts that are different from the default one, and thus > change the height of the screen lines, if only by a few pixels. Not necessarily. At least, I can change my default face's :bold and :underline properties to t, and the line height doesn't change. This probably depends on whether you have bold, underline, etc, variants of the same font installed in the system. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 13:24:26 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 17:24:26 +0000 Received: from localhost ([127.0.0.1]:60601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF4wr-0005Aa-Em for submit@debbugs.gnu.org; Wed, 06 Aug 2014 13:24:25 -0400 Received: from mtaout28.012.net.il ([80.179.55.184]:48742) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF4wo-0005AK-TM for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 13:24:24 -0400 Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0N9W00B00AZIO900@mtaout28.012.net.il> for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 20:23:47 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9W001K8AZNHL90@mtaout28.012.net.il>; Wed, 06 Aug 2014 20:23:47 +0300 (IDT) Date: Wed, 06 Aug 2014 20:24:29 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E25744.7090603@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <834mxppm42.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> <83ha1pptrd.fsf@gnu.org> <53E23E91.5070802@yandex.ru> <83d2cdpox4.fsf@gnu.org> <53E25744.7090603@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Wed, 06 Aug 2014 20:26:44 +0400 > From: Dmitry Gutov > CC: rudalics@gmx.at, 18195@debbugs.gnu.org > > On 08/06/2014 08:23 PM, Eli Zaretskii wrote: > > >> Not really. We have a pull request that changes the code to do what > >> you're describing, but for the moment we only use one overlay at a time. > > > > I'm talking about a kind of menu of candidates, which definitely takes > > more than one line. That cannot be done with a single overlay, unless > > you copy the buffer text into the overlay string, and completely cover > > the buffer text itself. > > Indeed, that's what we do currently. But that will break if the buffer text has other display properties, because Emacs doesn't support display strings on display strings. IOW, this solution only works for relatively simple text in the buffer. And what do you do with line-prefix and wrap-prefix? That's really crazy design (no offense)! From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 13:26:04 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 17:26:05 +0000 Received: from localhost ([127.0.0.1]:60605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF4yS-0005DY-ET for submit@debbugs.gnu.org; Wed, 06 Aug 2014 13:26:04 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:35305) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF4yP-0005Ct-VK for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 13:26:03 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0N9W00600ATUV800@a-mtaout20.012.net.il> for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 20:25:55 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9W00604B37M970@a-mtaout20.012.net.il>; Wed, 06 Aug 2014 20:25:55 +0300 (IDT) Date: Wed, 06 Aug 2014 20:26:08 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E259AE.6020307@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <8338d9pm1b.fsf@gnu.org> References: <86tx5r7l1j.fsf@yandex.ru> <53E097F7.5050407@gmx.at> <53E0ABF9.7070506@yandex.ru> <8338dbqcai.fsf@gnu.org> <53E14AF4.6050804@yandex.ru> <83k36mpbxg.fsf@gnu.org> <53E21B05.9000504@yandex.ru> <83fvh9pthm.fsf@gnu.org> <53E244B4.1000305@yandex.ru> <83bnrxpov7.fsf@gnu.org> <53E259AE.6020307@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Wed, 06 Aug 2014 20:37:02 +0400 > From: Dmitry Gutov > CC: rudalics@gmx.at, 18195@debbugs.gnu.org > > On 08/06/2014 08:25 PM, Eli Zaretskii wrote: > > >> Underline, bold, italic..? > > > > They all use fonts that are different from the default one, and thus > > change the height of the screen lines, if only by a few pixels. > > Not necessarily. At least, I can change my default face's :bold and > :underline properties to t, and the line height doesn't change. Sheer luck. > This probably depends on whether you have bold, underline, etc, variants > of the same font installed in the system. No, it depends on the font design AFAIK. In general, you cannot expect the bold, underline, and italics variants to have the same metrics, IME. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 13:46:38 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 17:46:38 +0000 Received: from localhost ([127.0.0.1]:60656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF5IL-0006xd-Fh for submit@debbugs.gnu.org; Wed, 06 Aug 2014 13:46:38 -0400 Received: from mout.gmx.net ([212.227.17.20]:60811) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF5II-0006xM-M8 for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 13:46:35 -0400 Received: from [88.117.49.190] ([88.117.49.190]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0Lyi0B-1WKlja1tPL-0169i1; Wed, 06 Aug 2014 19:46:25 +0200 Message-ID: <53E269E9.6020004@gmx.at> Date: Wed, 06 Aug 2014 19:46:17 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate 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> <53E25484.8050909@gmx.at> <83a97hpomm.fsf@gnu.org> In-Reply-To: <83a97hpomm.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:asVhwFu0j0YbjqDV67j3UIXteRNd5kwyU8qx2+xUrcYxSKU0uzv mIqWVmO2B/rYtgoSTt1lB+druP5JmFClcSU9A4dCn9ZDhRPRuPYor7I1NN3oOTasMmXr5mz 1NMb1hw9cTflPJjbDw5lmhwSsn42S2P4TSoMbg0VQLyWZVTThWJwhmSskJCv4p6uGQwfAnV KrltXGtrDcqJ7mHzhpqPA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > You are talking about things that are possible only on the C level, > not from Lisp. My point was that we don't expose enough APIs to Lisp > to allow such applications, and you now agreed with me. I was over-complicating things. The solution is much simpler and all tools are already on board. Dmitry just has to insert his overlays where he wants them and run `window-text-pixel-size' over that window. If the text including the overlays fits he's done. Otherwise, he has to remove the overlays and proceed with whatever alternate solution he has. No hands needed. martin From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 14:03:08 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 18:03:08 +0000 Received: from localhost ([127.0.0.1]:60677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF5YJ-0007Ou-AV for submit@debbugs.gnu.org; Wed, 06 Aug 2014 14:03:08 -0400 Received: from mail-la0-f47.google.com ([209.85.215.47]:55856) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF5YG-0007OQ-Dc for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 14:03:05 -0400 Received: by mail-la0-f47.google.com with SMTP id mc6so2520424lab.20 for <18195@debbugs.gnu.org>; Wed, 06 Aug 2014 11:02:58 -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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=4b2VC2K4SE6rZs3jWlBJii3eZ6E5+Y1U3sQ/f9cN1cY=; b=gvLJKewBBti7dDmn1eIxpXVmy3TwHyciSE88FYiVrTg4BasbKPvxDVe6hrJJPj6FTO X1Y034OhB0V4dPFwpy0bVQjvcaQGNFi6gIU0KM4tpiQ/BSePay+L+FGgEAbd+23GdvKS 0bnQU6SLTyA/pirlruUcu0h8v77hyF54uM+MiS4kPGlIm0MMGgBdj5BDUYe6fhib4aev FpNWxfpPvNu1NBf5NNcGZkrvibugLATIK9ZBUo5BUvyphLgPxsDcvsUuEPlZ2mHFzwjq hnySuqwPJN3NW+Ot7LIYDiyaTjI5zmectlEVtF5TOZvEnGcfez1emIuUlhntu6SsiUAe kKnw== X-Received: by 10.112.255.36 with SMTP id an4mr12027977lbd.31.1407348178372; Wed, 06 Aug 2014 11:02:58 -0700 (PDT) Received: from [10.8.0.26] (v-2-eu19-d3962-07.webazilla.com. [78.140.151.7]) by mx.google.com with ESMTPSA id go8sm2343718lbc.8.2014.08.06.11.02.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Aug 2014 11:02:57 -0700 (PDT) Message-ID: <53E26DCB.5070904@yandex.ru> Date: Wed, 06 Aug 2014 22:02:51 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate 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> <53E23E91.5070802@yandex.ru> <83d2cdpox4.fsf@gnu.org> <53E25744.7090603@yandex.ru> <834mxppm42.fsf@gnu.org> In-Reply-To: <834mxppm42.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 08/06/2014 09:24 PM, Eli Zaretskii wrote: > But that will break if the buffer text has other display properties, > because Emacs doesn't support display strings on display strings. > IOW, this solution only works for relatively simple text in the > buffer. Multiple overlays aren't much easier to work with: you can't position them in the middle of a piece of text that's on `display' property, can't position them after the end of the buffer or overlapping the `line-prefix' value. And if the desired column is in the middle of a multiple-width character like \t, you're forced to do unnatural things with it anyway. > And what do you do with line-prefix and wrap-prefix? The former is incorporated into the "replaced" text and set to "" on the overlay; the latter, so far, has been ignored. > That's really crazy design (no offense)! I didn't design it personally, just fixed some corner cases. But it has its advantages, see above. For example, otherwise I'm having hard time imagining what to do if the target column is inside the line-prefix. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 14:03:51 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 18:03:51 +0000 Received: from localhost ([127.0.0.1]:60680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF5Yx-0007Pv-GS for submit@debbugs.gnu.org; Wed, 06 Aug 2014 14:03:51 -0400 Received: from mtaout24.012.net.il ([80.179.55.180]:51051) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF5Yu-0007Pj-Sh for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 14:03:45 -0400 Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0N9W00300CKF0X00@mtaout24.012.net.il> for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 20:59:28 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9W00O3GCN43M40@mtaout24.012.net.il>; Wed, 06 Aug 2014 20:59:28 +0300 (IDT) Date: Wed, 06 Aug 2014 21:03:51 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E269E9.6020004@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics Message-id: <83wqalo5q0.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> <83ha1pptrd.fsf@gnu.org> <53E25484.8050909@gmx.at> <83a97hpomm.fsf@gnu.org> <53E269E9.6020004@gmx.at> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Wed, 06 Aug 2014 19:46:17 +0200 > From: martin rudalics > CC: dgutov@yandex.ru, 18195@debbugs.gnu.org > > > You are talking about things that are possible only on the C level, > > not from Lisp. My point was that we don't expose enough APIs to Lisp > > to allow such applications, and you now agreed with me. > > I was over-complicating things. The solution is much simpler and all > tools are already on board. Dmitry just has to insert his overlays > where he wants them and run `window-text-pixel-size' over that window. I obviously fail to explain to you why this will not work in general. Never mind. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 14:36:23 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 18:36:23 +0000 Received: from localhost ([127.0.0.1]:60731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF64U-0008JL-5f for submit@debbugs.gnu.org; Wed, 06 Aug 2014 14:36:22 -0400 Received: from mtaout29.012.net.il ([80.179.55.185]:48780) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF64Q-0008J4-On for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 14:36:20 -0400 Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0N9W00M00E21LE00@mtaout29.012.net.il> for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 21:36:14 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9W00JONECERW30@mtaout29.012.net.il>; Wed, 06 Aug 2014 21:36:14 +0300 (IDT) Date: Wed, 06 Aug 2014 21:36:25 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E26DCB.5070904@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83sil9o47q.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> <83ha1pptrd.fsf@gnu.org> <53E23E91.5070802@yandex.ru> <83d2cdpox4.fsf@gnu.org> <53E25744.7090603@yandex.ru> <834mxppm42.fsf@gnu.org> <53E26DCB.5070904@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Wed, 06 Aug 2014 22:02:51 +0400 > From: Dmitry Gutov > CC: rudalics@gmx.at, 18195@debbugs.gnu.org > > On 08/06/2014 09:24 PM, Eli Zaretskii wrote: > > > But that will break if the buffer text has other display properties, > > because Emacs doesn't support display strings on display strings. > > IOW, this solution only works for relatively simple text in the > > buffer. > > Multiple overlays aren't much easier to work with: you can't position > them in the middle of a piece of text that's on `display' property, But you could copy the display string into the overlay. > can't position them after the end of the buffer Yes, you can: you can include newlines in the overlay string. > or overlapping the `line-prefix' value. Why do you need that? No buffer text will ever appear in the prefix, so your drop-down list doesn't need to invade the prefix area, because it is aligned with some buffer text. > And if the desired column is in the middle of a multiple-width > character like \t, you're forced to do unnatural things with it > anyway. Yes, which is why I asked why not use tooltips and text-mode menus instead. AFAICT, they solve all those problems seamlessly. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 17:09:28 2014 Received: (at 18195) by debbugs.gnu.org; 6 Aug 2014 21:09:28 +0000 Received: from localhost ([127.0.0.1]:60819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF8Se-0003oN-4k for submit@debbugs.gnu.org; Wed, 06 Aug 2014 17:09:28 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]:33490) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF8Sb-0003o5-It for 18195@debbugs.gnu.org; Wed, 06 Aug 2014 17:09:26 -0400 Received: by mail-lb0-f172.google.com with SMTP id z11so2008582lbi.17 for <18195@debbugs.gnu.org>; Wed, 06 Aug 2014 14:09:19 -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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=VtaRMKAb96d4hlRzStEJeF5HXzhTIR16m6ZG3zwECYQ=; b=KpTKJMZe4lQk0w54sSUDADH+tEk6oxjlz+sC4E4ObHFLlGxKqBs2oxcd2zvtMiMICv Yd9A7fOdN1+CRTQzIrky6nuGIbxQEFIbwU7392/X5WjwA4/ulEX/qnLdJ/shDjzdCVIt +T5fGFAt2Wfytf5PpsiSRPPW2pk/Mrc5vb47Kd6xh3LERH0amzvBygR7HKlM5A/F9w8e t2WKcVVSlnaBHROCxp6qAw3+yIdhRgjI441/FcqvpC5+Oi/Ca3DmJAv2GCSOvdobrFHv MOOrj9JjwAmUt4LIslqGO26R5DFMMIKrZb/6ICJ6Os9Qa8KghSQRIahjYB6zcdqMWkEd msmg== X-Received: by 10.112.74.200 with SMTP id w8mr12529983lbv.79.1407359359578; Wed, 06 Aug 2014 14:09:19 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id tj1sm2924004lbb.40.2014.08.06.14.09.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Aug 2014 14:09:18 -0700 (PDT) Message-ID: <53E2997D.50907@yandex.ru> Date: Thu, 07 Aug 2014 01:09:17 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate 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> <53E23E91.5070802@yandex.ru> <83d2cdpox4.fsf@gnu.org> <53E25744.7090603@yandex.ru> <834mxppm42.fsf@gnu.org> <53E26DCB.5070904@yandex.ru> <83sil9o47q.fsf@gnu.org> In-Reply-To: <83sil9o47q.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18195 Cc: rudalics@gmx.at, 18195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 08/06/2014 10:36 PM, Eli Zaretskii wrote: >> Multiple overlays aren't much easier to work with: you can't position >> them in the middle of a piece of text that's on `display' property, > > But you could copy the display string into the overlay. I don't see how this could work with overlays that don't spread over multiple visual lines if the aforementioned text on `display' property is multiline. Going back to one-overlay approach, this could work. But then, oh joy, instead of "go down 10 lines, collect them and add required pieces at between columns 5 and 20", I'll have to see if there's maybe a display property on line 3 that spans 15 lines, stop after it, include the display property in the text-to-be-replaced. Or, if the text with the `display' property starts before the supposed beginning of the overlay, I'll have to measure the place where to start replacing the lines from... somewhere. If there are multiple pieces of text with `display', all the merrier. All of the above really sounds like a job for a display engine. >> can't position them after the end of the buffer > > Yes, you can: you can include newlines in the overlay string. Guess so. If another package tries the same with its own overlays, it'll be a mess, but here I'm going over into fantasy territory. >> or overlapping the `line-prefix' value. > > Why do you need that? No buffer text will ever appear in the prefix, > so your drop-down list doesn't need to invade the prefix area, because > it is aligned with some buffer text. The prefixes can be different between lines. They also can be of different lengths. `org-indent-mode' is fairly popular, and it indents headings of different levels and their contents using `line-prefix'. This way, if the completion is initiated on the first column before the first header, the popup has to cover line-prefixes below. See https://github.com/company-mode/company-mode/issues/24. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 07 11:08:57 2014 Received: (at 18195) by debbugs.gnu.org; 7 Aug 2014 15:08:57 +0000 Received: from localhost ([127.0.0.1]:34127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XFPJI-0000Ev-Q7 for submit@debbugs.gnu.org; Thu, 07 Aug 2014 11:08:57 -0400 Received: from mout.gmx.net ([212.227.17.21]:52828) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XFPJF-0000Eh-U8 for 18195@debbugs.gnu.org; Thu, 07 Aug 2014 11:08:54 -0400 Received: from [91.113.6.105] ([91.113.6.105]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0Ld0E0-1WXJ770vNg-00iCR5; Thu, 07 Aug 2014 17:08:45 +0200 Message-ID: <53E39674.2040507@gmx.at> Date: Thu, 07 Aug 2014 17:08:36 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate 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> <53E25484.8050909@gmx.at> <83a97hpomm.fsf@gnu.org> <53E269E9.6020004@gmx.at> <83wqalo5q0.fsf@gnu.org> In-Reply-To: <83wqalo5q0.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:7bHt8rQY8Lt00NRiKA8uD7z8kL91KHTcNDk6u7qCLQXTkhJyJSb KIFKfxiLifpLdWwxezEvmA5DcZ8wEp9U9cP0BD0WhLWUy0aATlvFD5fiZyE3CNVaYnFDs0P aGAZVKjmenaYtTqO745oGcRy3eqFVTyyMLyn7jT3Vj8xMOEa3lWCM5pUN28HhkICoeABqwN CTK/GPMYVDpcKHLJD4YTA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > I obviously fail to explain to you why this will not work in general. > Never mind. If by "in general" you mean that he won't be able to align his overlays properly with varying font sizes, prefixes, line warping and the like if he continues to use the original text, I obviously agree. My point is that he can have a large overlay replace the original text with the same text minus any unwanted side-effects introduced by text properties, fonts, or other overlays. Within that overlay he can then additioanlly show whatever his original overlays were supposed to show. Whether this is nice is a different issue. But since he wants to draw some text arbitrarily over some other text anyway, this sounds like a neglible inconvenience to me. martin From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 07 11:35:15 2014 Received: (at 18195) by debbugs.gnu.org; 7 Aug 2014 15:35:15 +0000 Received: from localhost ([127.0.0.1]:34158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XFPik-0000wU-NM for submit@debbugs.gnu.org; Thu, 07 Aug 2014 11:35:15 -0400 Received: from mtaout29.012.net.il ([80.179.55.185]:45960) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XFPii-0000wC-Di for 18195@debbugs.gnu.org; Thu, 07 Aug 2014 11:35:13 -0400 Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0N9Y00F000E11V00@mtaout29.012.net.il> for 18195@debbugs.gnu.org; Thu, 07 Aug 2014 18:35:07 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9Y00DOL0MJBX20@mtaout29.012.net.il>; Thu, 07 Aug 2014 18:35:07 +0300 (IDT) Date: Thu, 07 Aug 2014 18:35:21 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E39674.2040507@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics Message-id: <83a97gnwhy.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> <83ha1pptrd.fsf@gnu.org> <53E25484.8050909@gmx.at> <83a97hpomm.fsf@gnu.org> <53E269E9.6020004@gmx.at> <83wqalo5q0.fsf@gnu.org> <53E39674.2040507@gmx.at> X-Spam-Score: 3.7 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > Date: Thu, 07 Aug 2014 17:08:36 +0200 > From: martin rudalics > CC: dgutov@yandex.ru, 18195@debbugs.gnu.org > > > I obviously fail to explain to you why this will not work in general. > > Never mind. > > If by "in general" you mean that he won't be able to align his overlays > properly with varying font sizes, prefixes, line warping and the like if > he continues to use the original text, I obviously agree. [...] Content analysis details: (3.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.7 RCVD_IN_PSBL RBL: Received via a relay in PSBL [80.179.55.185 listed in psbl.surriel.com] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 3.7 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > Date: Thu, 07 Aug 2014 17:08:36 +0200 > From: martin rudalics > CC: dgutov@yandex.ru, 18195@debbugs.gnu.org > > > I obviously fail to explain to you why this will not work in general. > > Never mind. > > If by "in general" you mean that he won't be able to align his overlays > properly with varying font sizes, prefixes, line warping and the like if > he continues to use the original text, I obviously agree. [...] Content analysis details: (3.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.7 RCVD_IN_PSBL RBL: Received via a relay in PSBL [80.179.55.185 listed in psbl.surriel.com] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) > Date: Thu, 07 Aug 2014 17:08:36 +0200 > From: martin rudalics > CC: dgutov@yandex.ru, 18195@debbugs.gnu.org > > > I obviously fail to explain to you why this will not work in general. > > Never mind. > > If by "in general" you mean that he won't be able to align his overlays > properly with varying font sizes, prefixes, line warping and the like if > he continues to use the original text, I obviously agree. No, I mean that it is generally unreliable to measure the pixel dimensions of some text in one buffer, then assume that the dimensions will be the same when displayed as overlay in another buffer. This is only true when both buffers use the same single font and the same line spacing; otherwise, it's simply false. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 07 11:39:44 2014 Received: (at 18195) by debbugs.gnu.org; 7 Aug 2014 15:39:44 +0000 Received: from localhost ([127.0.0.1]:34167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XFPn5-00013a-Bz for submit@debbugs.gnu.org; Thu, 07 Aug 2014 11:39:44 -0400 Received: from mout.gmx.net ([212.227.17.21]:52140) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XFPn2-00013K-Dm for 18195@debbugs.gnu.org; Thu, 07 Aug 2014 11:39:41 -0400 Received: from [91.113.6.105] ([91.113.6.105]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MdnN3-1X5HKB1ZO9-00Ph7a; Thu, 07 Aug 2014 17:39:30 +0200 Message-ID: <53E39DA6.80201@gmx.at> Date: Thu, 07 Aug 2014 17:39:18 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate 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> <53E25484.8050909@gmx.at> <83a97hpomm.fsf@gnu.org> <53E269E9.6020004@gmx.at> <83wqalo5q0.fsf@gnu.org> <53E39674.2040507@gmx.at> <83a97gnwhy.fsf@gnu.org> In-Reply-To: <83a97gnwhy.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:6YywT4rnqzBVjCjvHv8faYnxiNa1EfdjSMLFgAoQhPp0gO/e2UB NegWi+w/NEVQ0LTqNYMQzyDfIvAOxfEZuiKFyx8o7rUJGAzdY+8kUFuCwK7V5m3WC9wp992 gU/xdGQiNeXDr3uOS18l9yk3i0AWmHuoFJlEtA+/f69wBEKEOGN+0bRAucxL1+MTxT2eNqI 4qHT+1FZlPR0ifWq4yy8w== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > No, I mean that it is generally unreliable to measure the pixel > dimensions of some text in one buffer, then assume that the dimensions > will be the same when displayed as overlay in another buffer. This is > only true when both buffers use the same single font and the same line > spacing; otherwise, it's simply false. There is no other buffer. Everything is done in the buffer where the overlay is supposed to appear. martin From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 07 12:36:42 2014 Received: (at 18195) by debbugs.gnu.org; 7 Aug 2014 16:36:42 +0000 Received: from localhost ([127.0.0.1]:34180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XFQgD-0002We-9v for submit@debbugs.gnu.org; Thu, 07 Aug 2014 12:36:41 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:64691) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XFQgA-0002WM-Br for 18195@debbugs.gnu.org; Thu, 07 Aug 2014 12:36:39 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0N9Y00K0038XIU00@a-mtaout22.012.net.il> for 18195@debbugs.gnu.org; Thu, 07 Aug 2014 19:36:31 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9Y00KE13GUIR10@a-mtaout22.012.net.il>; Thu, 07 Aug 2014 19:36:31 +0300 (IDT) Date: Thu, 07 Aug 2014 19:36:46 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E39DA6.80201@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics Message-id: <83y4v0mf35.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> <83ha1pptrd.fsf@gnu.org> <53E25484.8050909@gmx.at> <83a97hpomm.fsf@gnu.org> <53E269E9.6020004@gmx.at> <83wqalo5q0.fsf@gnu.org> <53E39674.2040507@gmx.at> <83a97gnwhy.fsf@gnu.org> <53E39DA6.80201@gmx.at> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Thu, 07 Aug 2014 17:39:18 +0200 > From: martin rudalics > CC: dgutov@yandex.ru, 18195@debbugs.gnu.org > > > No, I mean that it is generally unreliable to measure the pixel > > dimensions of some text in one buffer, then assume that the dimensions > > will be the same when displayed as overlay in another buffer. This is > > only true when both buffers use the same single font and the same line > > spacing; otherwise, it's simply false. > > There is no other buffer. Everything is done in the buffer where the > overlay is supposed to appear. How do you prevent the overlay from momentarily flashing in the window? From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 08 04:41:43 2014 Received: (at 18195) by debbugs.gnu.org; 8 Aug 2014 08:41:43 +0000 Received: from localhost ([127.0.0.1]:34598 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XFfk6-0004os-MN for submit@debbugs.gnu.org; Fri, 08 Aug 2014 04:41:42 -0400 Received: from mout.gmx.net ([212.227.15.15]:49793) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XFfk2-0004oc-Ut for 18195@debbugs.gnu.org; Fri, 08 Aug 2014 04:41:40 -0400 Received: from [88.117.86.84] ([88.117.86.84]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0LjZEm-1WiWqP3P0y-00bdkF; Fri, 08 Aug 2014 10:41:29 +0200 Message-ID: <53E48D29.1010501@gmx.at> Date: Fri, 08 Aug 2014 10:41:13 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate 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> <53E25484.8050909@gmx.at> <83a97hpomm.fsf@gnu.org> <53E269E9.6020004@gmx.at> <83wqalo5q0.fsf@gnu.org> <53E39674.2040507@gmx.at> <83a97gnwhy.fsf@gnu.org> <53E39DA6.80201@gmx.at> <83y4v0mf35.fsf@gnu.org> In-Reply-To: <83y4v0mf35.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:ivMwycS9Ife5dU7gyrab6wKy3T6OWj6DoPpr5zOOH5XzLKct5qU LMXHkK37P6EMxTQlsmY3o5a+YFrt0MPEphN4EarsV8y9psA60RXpOH/t5laPRi0ZGkAEdMW Z66b1zazbhw2mu5EFd/uDHeQ4cUHzenyE5PoAIOuLTosp8ARigaDh3b2b70c4Uo6tfhaeXl t3tZ76h0QkJZKsCDgMd4w== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >> There is no other buffer. Everything is done in the buffer where the >> overlay is supposed to appear. > > How do you prevent the overlay from momentarily flashing in the > window? I'd instantaneously file a bug report. Seriously, why should (let ((overlay (make-overlay (point-min) (point-max)))) (overlay-put overlay 'display "???????") (prog1 (window-text-pixel-size) (delete-overlay overlay))) cause a "momentarily flashing in the window"? martin From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 08 05:16:46 2014 Received: (at 18195) by debbugs.gnu.org; 8 Aug 2014 09:16:46 +0000 Received: from localhost ([127.0.0.1]:34615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XFgI1-0005fz-Ve for submit@debbugs.gnu.org; Fri, 08 Aug 2014 05:16:46 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:49560) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XFgHy-0005fk-K5 for 18195@debbugs.gnu.org; Fri, 08 Aug 2014 05:16:44 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0N9Z00400DRJF500@a-mtaout20.012.net.il> for 18195@debbugs.gnu.org; Fri, 08 Aug 2014 12:16:36 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9Z0046SDRN5J70@a-mtaout20.012.net.il>; Fri, 08 Aug 2014 12:16:36 +0300 (IDT) Date: Fri, 08 Aug 2014 12:16:33 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E48D29.1010501@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics Message-id: <83iom3mjda.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> <83ha1pptrd.fsf@gnu.org> <53E25484.8050909@gmx.at> <83a97hpomm.fsf@gnu.org> <53E269E9.6020004@gmx.at> <83wqalo5q0.fsf@gnu.org> <53E39674.2040507@gmx.at> <83a97gnwhy.fsf@gnu.org> <53E39DA6.80201@gmx.at> <83y4v0mf35.fsf@gnu.org> <53E48D29.1010501@gmx.at> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Fri, 08 Aug 2014 10:41:13 +0200 > From: martin rudalics > CC: dgutov@yandex.ru, 18195@debbugs.gnu.org > > Seriously, why should > > (let ((overlay (make-overlay (point-min) (point-max)))) > (overlay-put overlay 'display "???????") > (prog1 > (window-text-pixel-size) > (delete-overlay overlay))) > > cause a "momentarily flashing in the window"? It shouldn't. But AFAIU, this is not what is wanted here, because the problem is where in the buffer to put the overlay. In the above example, you put it at point-min, but that position needs to be _computed_ based on the pixel-size of the text to be put in the overlay. IOW, your suggested solution is incomplete, unless you intend the application to do some iterative process, each time changing the position where it puts the overlay and adjusting it in the next iteration based on the results of window-text-pixel-size. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 08 06:11:05 2014 Received: (at 18195) by debbugs.gnu.org; 8 Aug 2014 10:11:05 +0000 Received: from localhost ([127.0.0.1]:34656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XFh8a-0006xs-K6 for submit@debbugs.gnu.org; Fri, 08 Aug 2014 06:11:05 -0400 Received: from mout.gmx.net ([212.227.15.19]:62688) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XFh8Y-0006x4-5d for 18195@debbugs.gnu.org; Fri, 08 Aug 2014 06:11:02 -0400 Received: from [88.117.86.84] ([88.117.86.84]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MTSKd-1Wp3jF11pH-00SRHs; Fri, 08 Aug 2014 12:10:54 +0200 Message-ID: <53E4A224.6010000@gmx.at> Date: Fri, 08 Aug 2014 12:10:44 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate 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> <53E25484.8050909@gmx.at> <83a97hpomm.fsf@gnu.org> <53E269E9.6020004@gmx.at> <83wqalo5q0.fsf@gnu.org> <53E39674.2040507@gmx.at> <83a97gnwhy.fsf@gnu.org> <53E39DA6.80201@gmx.at> <83y4v0mf35.fsf@gnu.org> <53E48D29.1010501@gmx.at> <83iom3mjda.fsf@gnu.org> In-Reply-To: <83iom3mjda.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:hAJci9IxwmpyvhdV/tZq92k1OEe8CKYP3BlnblA9uQGNoyPBRbb YbwJe+5x1hC5MOBO/zeWOmS9kSO1qnOvlHg34sQoHcV9Jr22P00yK+feNb6QRdBy+raorPz FtR32yZ7Qz8YmiWR1Dw1G0N6FU+pjxfDyJFkEAxf4Scy3oqY1VhuaSstjXMkg4huJTbcJ9q 8JAf8SjQWt1aQwU/UspDQ== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > It shouldn't. But AFAIU, this is not what is wanted here, because the > problem is where in the buffer to put the overlay. In the above > example, you put it at point-min, but that position needs to be > _computed_ based on the pixel-size of the text to be put in the > overlay. I'd put the overlay at the desired position right away and check whether it fits (usually it should). If it doesn't, I'd have to remove it and put it somewhere else. I can't imagine a solution where multiple attempts could be avoided. After all, one prior aim seems to be that a certain line of the original text must not be covered by the overlay. Hence, neither aligning the overlay at the bottom or top line of a window seem to work always. > IOW, your suggested solution is incomplete, unless you intend the > application to do some iterative process, each time changing the > position where it puts the overlay and adjusting it in the next > iteration based on the results of window-text-pixel-size. This precisley formulates what the application should do and cannot be avoided IMHO. After all, tooltips and menus seem to face exactly the same problem when the frame is at the bottom of the display. Otherwise, these are better off since they can are not constrained by the edges of the window. martin From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 08 06:25:31 2014 Received: (at 18195) by debbugs.gnu.org; 8 Aug 2014 10:25:31 +0000 Received: from localhost ([127.0.0.1]:34667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XFhMX-0007Lw-Uy for submit@debbugs.gnu.org; Fri, 08 Aug 2014 06:25:30 -0400 Received: from mtaout27.012.net.il ([80.179.55.183]:34054) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XFhMT-0007Lb-Sb for 18195@debbugs.gnu.org; Fri, 08 Aug 2014 06:25:27 -0400 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0N9Z00F00FZV1I00@mtaout27.012.net.il> for 18195@debbugs.gnu.org; Fri, 08 Aug 2014 13:20:27 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9Z00DODGQ2W630@mtaout27.012.net.il>; Fri, 08 Aug 2014 13:20:27 +0300 (IDT) Date: Fri, 08 Aug 2014 13:25:16 +0300 From: Eli Zaretskii Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate In-reply-to: <53E4A224.6010000@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics Message-id: <83fvh7mg6r.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> <83ha1pptrd.fsf@gnu.org> <53E25484.8050909@gmx.at> <83a97hpomm.fsf@gnu.org> <53E269E9.6020004@gmx.at> <83wqalo5q0.fsf@gnu.org> <53E39674.2040507@gmx.at> <83a97gnwhy.fsf@gnu.org> <53E39DA6.80201@gmx.at> <83y4v0mf35.fsf@gnu.org> <53E48D29.1010501@gmx.at> <83iom3mjda.fsf@gnu.org> <53E4A224.6010000@gmx.at> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18195 Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Fri, 08 Aug 2014 12:10:44 +0200 > From: martin rudalics > CC: dgutov@yandex.ru, 18195@debbugs.gnu.org > > > IOW, your suggested solution is incomplete, unless you intend the > > application to do some iterative process, each time changing the > > position where it puts the overlay and adjusting it in the next > > iteration based on the results of window-text-pixel-size. > > This precisley formulates what the application should do and cannot be > avoided IMHO. We should provide an API that allows applications to avoid that. > After all, tooltips and menus seem to face exactly the same problem > when the frame is at the bottom of the display. No, we never do any iterations or multiple trials when displaying menus and tooltips. We compute the required space and then compare it with what is available to make the decision. From unknown Fri Jun 20 07:21:48 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 05 Sep 2014 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator