unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: alexanderm@web.de, 27427@debbugs.gnu.org, dgutov@yandex.ru
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	[thread overview]
Message-ID: <59527971.5000205@gmx.at> (raw)
In-Reply-To: <837ezxsd02.fsf@gnu.org>

 > 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 ‘make-overlay’.

 > 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,

... which is evil because it has to calculate the beginning of the
second overlay (in the sense of being made by ‘make-overlay’) 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 there
 >>   > is very small and there's no way to let the user select an alternative
 >>   > using menu-like interaction.
 >>
 >> The echo area can be resized and can emulate any menu-like interaction.
 >
 > 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






  reply	other threads:[~2017-06-27 15:27 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-19 16:50 bug#27427: 26.0.50; Native line numbers lead to display error in company-mode popup Alexander Miller
2017-06-19 17:08 ` Eli Zaretskii
     [not found]   ` <6b307502-53db-e92d-1050-3cf0132537cb@web.de>
2017-06-19 19:23     ` Eli Zaretskii
2017-06-19 19:53       ` Alexander Miller
2017-06-19 21:03   ` Dmitry Gutov
2017-06-20 15:04     ` Eli Zaretskii
2017-06-21  2:18       ` Dmitry Gutov
2017-06-21  2:40         ` Eli Zaretskii
2017-06-21 13:04           ` Dmitry Gutov
2017-06-21 15:51             ` Alexander Miller
2017-06-21 18:15             ` Eli Zaretskii
2017-06-21 22:41               ` Dmitry Gutov
2017-06-22 14:55                 ` Eli Zaretskii
2017-06-22 23:17                   ` Dmitry Gutov
2017-06-23  9:10                     ` Eli Zaretskii
2017-06-23 23:26                       ` Dmitry Gutov
2017-06-24  7:47                         ` Eli Zaretskii
2017-06-24 17:28                           ` Eli Zaretskii
2017-06-24 20:43                             ` Dmitry Gutov
2017-06-25 13:51                               ` Dmitry Gutov
2017-06-25 14:32                                 ` Eli Zaretskii
2017-06-25 14:36                                   ` Dmitry Gutov
2017-06-25 14:13                               ` Eli Zaretskii
2017-06-25 14:46                                 ` Dmitry Gutov
2017-06-25 15:05                                   ` Eli Zaretskii
2017-06-25 16:35                                     ` Eli Zaretskii
2017-06-25 17:57                                     ` Eli Zaretskii
2017-06-25 22:56                                       ` Dmitry Gutov
2017-06-26  8:23                                         ` martin rudalics
2017-06-26 15:07                                           ` Eli Zaretskii
2017-06-27  7:06                                             ` martin rudalics
2017-06-27 14:48                                               ` Eli Zaretskii
2017-06-26 15:22                                         ` Eli Zaretskii
2017-06-26 15:28                                           ` Dmitry Gutov
2017-06-26 15:50                                             ` Eli Zaretskii
2017-06-26 17:12                                               ` Dmitry Gutov
2017-06-26 21:30                                           ` Johan Bockgård
2017-06-27 16:47                                             ` Eli Zaretskii
2017-07-13 23:04                                         ` Dmitry Gutov
2017-07-14  6:11                                           ` Eli Zaretskii
2017-07-14  6:24                                             ` Dmitry Gutov
2017-07-14  7:04                                               ` Eli Zaretskii
2017-07-15 17:38                                                 ` Dmitry Gutov
2017-07-15 17:49                                                   ` Eli Zaretskii
2017-06-25 14:31                           ` Dmitry Gutov
2017-06-25 14:54                             ` Eli Zaretskii
2017-06-25 15:25                               ` Dmitry Gutov
2017-06-25 16:12                               ` martin rudalics
2017-06-25 18:21                                 ` Eli Zaretskii
2017-06-25 15:59                             ` martin rudalics
2017-06-25 16:24                               ` Dmitry Gutov
2017-06-25 17:10                                 ` martin rudalics
2017-06-25 18:36                                   ` Eli Zaretskii
2017-06-25 18:51                                     ` Eli Zaretskii
2017-06-26  8:21                                       ` martin rudalics
2017-06-26  8:18                                     ` martin rudalics
2017-06-25 18:24                                 ` Eli Zaretskii
2017-06-26  7:15                                   ` martin rudalics
2017-06-26  8:18                                   ` martin rudalics
2017-06-26 12:07                                     ` Dmitry Gutov
2017-06-26 15:05                                     ` Eli Zaretskii
2017-06-27  7:06                                       ` martin rudalics
2017-06-27 14:48                                         ` Eli Zaretskii
2017-06-27 15:27                                           ` martin rudalics [this message]
2017-06-27 16:27                                             ` Eli Zaretskii
2017-06-28  8:45                                               ` martin rudalics
2017-06-28 16:48                                                 ` Eli Zaretskii
2017-06-28 18:35                                                   ` martin rudalics
2017-06-28 18:56                                                     ` Eli Zaretskii
2017-06-29  7:17                                                       ` martin rudalics
2017-06-29 16:29                                                         ` Eli Zaretskii
2017-06-30  8:27                                                           ` martin rudalics
2017-06-30  9:33                                                             ` Eli Zaretskii
2017-07-01 10:31                                                               ` martin rudalics
2017-07-01 11:59                                                                 ` Eli Zaretskii
2017-07-01 13:22                                                                   ` martin rudalics
2017-07-01 13:33                                                                     ` Eli Zaretskii
2017-07-01 15:20                                                                       ` martin rudalics
2017-07-01 15:41                                                                         ` Eli Zaretskii
2017-07-02  7:54                                                                           ` martin rudalics
2017-07-02 14:10                                                                             ` Eli Zaretskii
2017-07-02 14:45                                                                               ` Dmitry Gutov
2017-07-02 15:18                                                                                 ` Eli Zaretskii
2017-07-03  0:22                                                                                   ` Dmitry Gutov
2017-07-03  2:29                                                                                     ` Eli Zaretskii
2017-07-06  7:08                                                                                 ` martin rudalics
2017-07-06 13:06                                                                                   ` Dmitry Gutov
2017-07-07  6:52                                                                                     ` martin rudalics
2017-07-06  7:08                                                                               ` martin rudalics
2017-07-06 15:21                                                                                 ` Eli Zaretskii
2017-07-07  6:52                                                                                   ` martin rudalics
2017-06-29  1:34                                                   ` Dmitry Gutov
2017-06-29 16:20                                                     ` Eli Zaretskii
2017-06-29 17:55                                                       ` Dmitry Gutov
2017-06-25 19:00                               ` Eli Zaretskii
2017-06-26  8:21                                 ` martin rudalics
2017-06-26 15:06                                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59527971.5000205@gmx.at \
    --to=rudalics@gmx.at \
    --cc=27427@debbugs.gnu.org \
    --cc=alexanderm@web.de \
    --cc=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).