all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Unicode combining characters
Date: Tue, 25 May 2021 22:44:29 +0300	[thread overview]
Message-ID: <83a6oibntu.fsf@gnu.org> (raw)
In-Reply-To: <3e40bcd1-3d04-23c0-37a7-6a283ca4e3e4@gmail.com> (message from Clément Pit-Claudel on Tue, 25 May 2021 15:30:21 -0400)

> Cc: emacs-devel@gnu.org
> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
> Date: Tue, 25 May 2021 15:30:21 -0400
> 
> Based on the screenshot this is an issue with Company.  Company displays its "pop-ups" by putting a replacing 'display property on the text following the point (and on the next few lines).  So if the buffer contains
> 
> ABC XYZ DEF GHI
> JKL MNO PQR STU
> 
> and the point is after XYZ, then company puts a replacing display spec from " DEF" to "STU".
> To display completions "XYZ1233" and "XYZ456", the replacing display spec contains "123| GHI\nJKL XYZ456| STU", so the final display is
> 
> ABC XYZ123| GHI
> JKL XYZ456| STU
> 
> The OP's issue is that "123" and "456" don't have the same length.  As far as I know, there is no way to add extra space after 123 or 456 so that they reach the same X coordinate, given that they are already part of a display spec.

First, the OP said "overlay", and overlay strings can have display
properties.

And second, I'd expect the current code to use string-width to compute
how much whitespace will be needed after each completion candidate,
and string-width already accounts for composed (a.k.a "combined")
characters.  Yes, string-width provides only an approximation for the
true pixel width of the string, but that's not specific to
compositions, and the whole technique is somewhat of a kludge anyway,
for this reason and others.



  reply	other threads:[~2021-05-25 19:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25 15:56 Unicode combining characters Anand Tamariya
2021-05-25 17:22 ` Stefan Monnier
2021-05-25 17:24 ` Eli Zaretskii
2021-05-25 18:15   ` Clément Pit-Claudel
2021-05-25 18:39     ` Eli Zaretskii
2021-05-25 19:30       ` Clément Pit-Claudel
2021-05-25 19:44         ` Eli Zaretskii [this message]
2021-05-26  9:51   ` Anand Tamariya
2021-05-26 10:04     ` Joost Kremers
2021-05-26 12:54     ` Eli Zaretskii
2021-05-26 17:14       ` Eli Zaretskii
2021-05-27  7:00         ` Anand Tamariya
2021-05-27  9:40           ` Eli Zaretskii
2021-05-27 10:34             ` Basil L. Contovounesios
2021-05-27 12:30               ` Eli Zaretskii
2021-05-27 13:27             ` Anand Tamariya
2021-05-27 13:44               ` 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=83a6oibntu.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=cpitclaudel@gmail.com \
    --cc=emacs-devel@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 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.