From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#27427: 26.0.50; Native line numbers lead to display error in company-mode popup Date: Tue, 27 Jun 2017 17:27:45 +0200 Message-ID: <59527971.5000205@gmx.at> References: <611468a0-3115-813a-7347-d0c06e155831@web.de> <83vanrx5uo.fsf@gnu.org> <362a7d18-7f05-2e99-f8b3-41c353cf234f@yandex.ru> <83h8zawvih.fsf@gnu.org> <00f59a24-2d80-ca47-b6f3-3d219aa5aa3f@yandex.ru> <8360fqvz9x.fsf@gnu.org> <6aa4616d-79f7-db1b-c048-076a9a48596f@yandex.ru> <83tw39urzq.fsf@gnu.org> <4c4b873b-2bec-1c12-82f5-325b558bea93@yandex.ru> <83o9tgul6h.fsf@gnu.org> <49b431fd-aaa4-e7ca-06fc-7146a0a5692c@yandex.ru> <83a84zul0d.fsf@gnu.org> <513eca6f-998a-a937-76c4-7cf2fb0ff787@yandex.ru> <83wp81u8rz.fsf@gnu.org> <8ec1b301-79dc-7d11-b3f9-85ae2e925785@yandex.ru> <594FDDC5.6040009@gmx.at> <83zicwrkmu.fsf@gnu.org> <5950C342.7010908@gmx.at> <83mv8ussb6.fsf@gnu.org> <595203DE.1040608@gmx.at> <837ezxsd02.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1498584342 11787 195.159.176.226 (27 Jun 2017 17:25:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Jun 2017 17:25:42 +0000 (UTC) Cc: alexanderm@web.de, 27427@debbugs.gnu.org, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 27 19:25:34 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPuF1-0002Vw-9G for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jun 2017 19:25:31 +0200 Original-Received: from localhost ([::1]:57291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPuF6-0002oQ-Ce for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jun 2017 13:25:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPtlr-0008WN-Sg for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2017 12:55:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dPsQI-0007HC-JQ for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2017 11:29:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38325) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dPsQI-0007FX-F2 for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2017 11:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dPsQH-0001CX-VU for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2017 11:29:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Jun 2017 15:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27427 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27427-submit@debbugs.gnu.org id=B27427.14985772844542 (code B ref 27427); Tue, 27 Jun 2017 15:29:01 +0000 Original-Received: (at 27427) by debbugs.gnu.org; 27 Jun 2017 15:28:04 +0000 Original-Received: from localhost ([127.0.0.1]:41002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPsPM-0001BC-0f for submit@debbugs.gnu.org; Tue, 27 Jun 2017 11:28:04 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:52857) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPsPK-0001Ah-9E for 27427@debbugs.gnu.org; Tue, 27 Jun 2017 11:28:03 -0400 Original-Received: from [192.168.1.100] ([213.162.68.23]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Lat5o-1eAAVO3iTA-00kNdw; Tue, 27 Jun 2017 17:27:55 +0200 In-Reply-To: <837ezxsd02.fsf@gnu.org> X-Provags-ID: V03:K0:HYkqe87D2SP73xfzabRkj0DpXFEjNdx7cphHnPc3gNOs7DbhjR8 DS/HekHxqA4h12w01LXQbrD3/af32J3j2bqFQdIWwtwburrys2UJvIoExSecVONeBFQEjMP +lyylSS8xSqlY9ypRdwxO0yVh8B8M2/FZITqTBUG/P5JHLaOKnRVBs5LkjC+KNPRuaS+UTO ndjuVfK6gvGZw/iEfeyCg== X-UI-Out-Filterresults: notjunk:1;V01:K0:yJn4QPkTf0s=:1aQY7hsz99trvXGmuzCfC5 Y67KW9b2+KbhTeB+W6nupWXoIF9gjf00rKU0yAtxb1ulDXv+dqjBjiYFKn3K2l0DutmLqCuyg pNZawVQ0d1Jmx0HDiAXe0v75pOA+V9zegLor+sBi3lv0wK8z824RkL+H2iEqpE7xYmC4TJ9zY pPvMSHdBXsRDCQwJRs8+GDyw65Et1uvijkfkMjTViAqi797uWMRf2ZV9SpaYpFJakFH0SEnBS Jr6a/RIkZGtxncFS2rQxvJHuFgfjoLA6dxohgSEvLY/czLZVBryMtasQWPjvvoOXi2jVms2ew 248b6lQyjJs5HsZfnpShQ5fCWBFG3RVV6R0S4X3WUsiWU+vMA52DIN43q+nGtdVQ8A1KQnlf4 fsDQtvohH0/OQxDa+D6vBICIO0Gi3nBcs5ct+OCALFRLH9KbJBYzTJZ3s76hDhnH3oZNTO8k1 v2Zti+tmjAg1w+BPBxxOqloRJtAQAw/ca6sqUwJM5vlBHmHK3a1irEjranJf90kkjyoCUs3NH RN81QoRRazuI4kSO+XhQHGJqhUPiEN/wuiE9SifKKDw2DYG+GvK5K+3W9ArPD6TBKCj05fTXt WzmZcMw+oNNC41yOwLp4Vf3UJhSChIkgdkn1Nl0Ry6MIJYq4KeuWpizwZ0wMwzSB/MaRmsWGd wBJaZmaa6dC9vQDAdETWLi4YDaznb5hDkMoFSyP2OLJdbowBj+wW5dr6zPg/MagdiT0NcBmYg LqX7NSaMdTw0UMhht92kKT/JiYvUVq8yl0s5JgMd5KawLlwNLhHj7kvrVnsxuBI12lIsFoPs X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:133963 Archived-At: > I think we are miscommunicating. I was describing what would happen > if we try to use the same method as used for TTY menus. There are no > overlays there, the glyphs are concocted out of thin air by C code and= > put into the glyph matrices, overwriting what the display engine > thinks should be there. > > By contrast, you are talking about using an overlay, Sorry for being unclear. I did mean overlaying text just as the menu bar code does and did not mean overlays as produced by =E2=80=98make-over= lay=E2=80=99. > which is what > company-mode is using already, and which is the source of the trouble > Dmitry would like to avoid. The basic problem here is that the > company-mode popup is multiline, and Emacs cannot display rectangular > regions, only lines. But here we talk about the terminal where Emacs can display rectangular regions because all elements displayed have the same size (the menu bar code proves it). So such a region can cover mode and header lines, span multiple (Emacs) windows---virtually everything that can be found within the frame edges. > So company-mode inserts newlines into the > overlay string, =2E.. which is evil because it has to calculate the beginning of the second overlay (in the sense of being made by =E2=80=98make-overlay=E2=80= =99) string which is hardly reliable with proportional fonts, text properties and all sorts of display artefacts including overlays strings produced by someone else. > and the result is that the popup covers parts of the > display which company-mode doesn't want to conceal. So it needs to > copy those parts to the overlay string, to make the impression they > weren't covered by the overlay. It also needs to make all kinds of > layout calculations and decisions. All that in order to make an > impression of displaying a rectangular region at certain screen > coordinates, something that we ideally should have provided in the > display engine. And I still think we can do that for terminals without any problems using the same approach you used for menus. All we need is the buffer position (whose character represents the preferred upper left corner of the virtual rectangle) and the text to be shown (with newlines). Any clipping or repositioning is up to the display engine as for menus. And the lifetime of the rectangular region on screen is that of the popup frame on a GUI. >> > I don't see how the echo area can fit the job, since the space th= ere >> > is very small and there's no way to let the user select an altern= ative >> > using menu-like interaction. >> >> The echo area can be resized and can emulate any menu-like interactio= n. > > Yes, but not conveniently. And if we are going to emulate, why use > the echo area at all? why not pop up a buffer, like Help mode does? Sure. The echo area is used by tooltip mode and simple questions on terminals, that's why I mentioned it at all. martin