all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: 18195@debbugs.gnu.org, dgutov@yandex.ru
Subject: bug#18195: 24.3.92; window-screen-lines is not accurate
Date: Wed, 06 Aug 2014 19:30:09 +0300	[thread overview]
Message-ID: <83a97hpomm.fsf@gnu.org> (raw)
In-Reply-To: <53E25484.8050909@gmx.at>

> Date: Wed, 06 Aug 2014 18:15:00 +0200
> From: martin rudalics <rudalics@gmx.at>
> 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.





  reply	other threads:[~2014-08-06 16:30 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-05  2:00 bug#18195: 24.3.92; window-screen-lines is not accurate Dmitry
2014-08-05  8:38 ` martin rudalics
2014-08-05 10:03   ` Dmitry Gutov
2014-08-05 10:16     ` martin rudalics
2014-08-05 10:24       ` Dmitry Gutov
2014-08-05 12:20         ` martin rudalics
2014-08-05 13:05           ` Dmitry Gutov
2014-08-05 13:50             ` martin rudalics
2014-08-05 14:06               ` Eli Zaretskii
2014-08-06 11:55               ` Dmitry Gutov
2014-08-06 16:13                 ` martin rudalics
2014-08-05 14:01             ` Eli Zaretskii
2014-08-05 13:58           ` Eli Zaretskii
2014-08-05 14:08             ` martin rudalics
2014-08-05 14:13               ` Eli Zaretskii
2014-08-05 13:57         ` Eli Zaretskii
2014-08-05 13:51       ` Eli Zaretskii
2014-08-05 13:57         ` martin rudalics
2014-08-05 14:09           ` Eli Zaretskii
2014-08-05 14:12             ` martin rudalics
2014-08-05 14:23               ` Eli Zaretskii
2014-08-05 14:38                 ` martin rudalics
2014-08-05 15:08                   ` Eli Zaretskii
2014-08-05 15:45                     ` martin rudalics
2014-08-05 17:57                       ` Eli Zaretskii
2014-08-06  9:41                         ` martin rudalics
2014-08-06 14:39                           ` Eli Zaretskii
2014-08-06 14:41                             ` Dmitry Gutov
2014-08-06 16:23                               ` Eli Zaretskii
2014-08-06 16:26                                 ` Dmitry Gutov
2014-08-06 17:24                                   ` Eli Zaretskii
2014-08-06 18:02                                     ` Dmitry Gutov
2014-08-06 18:36                                       ` Eli Zaretskii
2014-08-06 21:09                                         ` Dmitry Gutov
2014-08-06 16:15                             ` martin rudalics
2014-08-06 16:30                               ` Eli Zaretskii [this message]
2014-08-06 17:46                                 ` martin rudalics
2014-08-06 18:03                                   ` Eli Zaretskii
2014-08-07 15:08                                     ` martin rudalics
2014-08-07 15:35                                       ` Eli Zaretskii
2014-08-07 15:39                                         ` martin rudalics
2014-08-07 16:36                                           ` Eli Zaretskii
2014-08-08  8:41                                             ` martin rudalics
2014-08-08  9:16                                               ` Eli Zaretskii
2014-08-08 10:10                                                 ` martin rudalics
2014-08-08 10:25                                                   ` Eli Zaretskii
2014-08-05 13:46     ` Eli Zaretskii
2014-08-05 21:21       ` Dmitry Gutov
2014-08-06  2:52         ` Eli Zaretskii
2014-08-06 12:09           ` Dmitry Gutov
2014-08-06 14:45             ` Eli Zaretskii
2014-08-06 15:07               ` Dmitry Gutov
2014-08-06 16:25                 ` Eli Zaretskii
2014-08-06 16:37                   ` Dmitry Gutov
2014-08-06 17:26                     ` Eli Zaretskii
2014-08-06 12:40           ` Layered display API (was: bug#18195: 24.3.92; window-screen-lines is not accurate) Dmitry Gutov
2014-08-06 17:19             ` Eli Zaretskii
2014-08-06 18:20               ` Alp Aker
2014-08-06 18:39                 ` Eli Zaretskii
2014-08-06 20:48                   ` Layered display API Stefan Monnier
2014-08-07  2:45                     ` Eli Zaretskii
2014-08-06 20:49               ` Dmitry Gutov
2014-08-07 15:39                 ` Eli Zaretskii
2014-08-11  1:14                   ` Dmitry Gutov
2014-08-11 15:01                     ` Eli Zaretskii
2014-08-13  2:42                       ` Dmitry Gutov
2014-08-13 12:46                         ` Stefan Monnier
2014-08-13 15:29                           ` Eli Zaretskii
2014-08-13 16:27                           ` Dmitry Gutov
2014-08-13 17:07                             ` Eli Zaretskii
2014-08-13 17:45                             ` Stefan Monnier
2014-08-13 15:28                         ` Eli Zaretskii
2014-08-14  2:35                           ` Dmitry Gutov
2014-08-14  2:53                             ` Eli Zaretskii
2014-08-14 13:12                               ` Dmitry Gutov
2014-08-14 15:20                                 ` Eli Zaretskii
2014-08-15  1:20                                   ` Dmitry Gutov
2014-08-15  6:39                                     ` Eli Zaretskii
2014-08-15 23:03                                       ` Dmitry Gutov
2014-08-16  7:41                                         ` Eli Zaretskii
2014-08-16  9:17                                           ` Dmitry Gutov
2014-08-14  2:06                       ` Bo Lin
2014-08-14  2:49                         ` Eli Zaretskii
2014-08-14 16:08                           ` Bo Lin
2014-08-14 16:19                             ` Eli Zaretskii
2014-08-14 16:42                               ` Bo Lin
2014-08-06 20:56               ` Stefan Monnier
2014-08-05 13:35 ` bug#18195: 24.3.92; window-screen-lines is not accurate 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

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

  git send-email \
    --in-reply-to=83a97hpomm.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=18195@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=rudalics@gmx.at \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.