[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Getting column position accounting for overlays
From: |
Eli Zaretskii |
Subject: |
Re: Getting column position accounting for overlays |
Date: |
Sat, 08 Aug 2015 17:45:07 +0300 |
> From: Yuri D'Elia <address@hidden>
> Date: Sat, 8 Aug 2015 16:31:28 +0200
>
> On 07/08/15 20:19, Eli Zaretskii wrote:
> >> https://github.com/wavexx/rigid-tabs.el
> >
> > If you need to align text on display, you should use the the
> > (space :align-to POS) display spec, see the node "Specified Space"
> > in the ELisp manual. This lets the display engine do the job for
> > you, so you don't need to figure out the dimensions of the text
> > on display.
>
> Ah yes, but that's precisely the problem: I need to calculate POS
> beforehand.
Yes, of course. But you will have the same problem if you do get the
text dimensions: you need to compare that with something to do useful
things with the value. Right?
> >> If you're trying to display anything related to the /visual/ appearance,
> >> you'll have to consider the possibility of overlays and thus run into
> >> the same issue.
> >
> > Can you envision other use cases, besides alignment?
>
> Looking for solutions
I actually asked about the problems, not the solutions.
> I came across a few snippets in emacswiki that
> dump the content of the overlays into another buffer (sort of "save what
> you see"). But all other cases were about calculating the current visual
> column for alignment purposes.
>
> It's not so trivial, considering that you basically have to handle all
> 'display cases manually to replicate what emacs does, you might have
> overlapping overlays, and so on. I also think that it's bound to break
> if 'display gets extended to support new properties.
It's simply impossible, except in a few special cases. If we need
such a feature that should work everywhere, we will need to ask the
display engine to supply this information.
But I still am unsure when would this be needed.
- Getting column position accounting for overlays, Yuri D'Elia, 2015/08/04
- Re: Getting column position accounting for overlays, Eli Zaretskii, 2015/08/04
- Re: Getting column position accounting for overlays, Yuri D'Elia, 2015/08/05
- Re: Getting column position accounting for overlays, Eli Zaretskii, 2015/08/05
- Re: Getting column position accounting for overlays, Yuri D'Elia, 2015/08/05
- Re: Getting column position accounting for overlays, Eli Zaretskii, 2015/08/05
- Re: Getting column position accounting for overlays, Yuri D'Elia, 2015/08/07
- Re: Getting column position accounting for overlays, Eli Zaretskii, 2015/08/07
- Re: Getting column position accounting for overlays, Yuri D'Elia, 2015/08/08
- Re: Getting column position accounting for overlays,
Eli Zaretskii <=
- Re: Getting column position accounting for overlays, Yuri D'Elia, 2015/08/08
- Re: Getting column position accounting for overlays, Eli Zaretskii, 2015/08/08
- Re: Getting column position accounting for overlays, Yuri D'Elia, 2015/08/08
- Re: Getting column position accounting for overlays, Eli Zaretskii, 2015/08/08
- Re: Getting column position accounting for overlays, Yuri D'Elia, 2015/08/08