From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri D'Elia Newsgroups: gmane.emacs.devel Subject: Re: Getting column position accounting for overlays Date: Sat, 8 Aug 2015 16:31:28 +0200 Message-ID: References: <83a8u6tplx.fsf@gnu.org> <55C1D323.50505@thregr.org> <831tfhu5ge.fsf@gnu.org> <55C25983.5040702@thregr.org> <83vbctsgo6.fsf@gnu.org> <55C4E756.5020607@thregr.org> <83r3nfq7uq.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1439044315 24041 80.91.229.3 (8 Aug 2015 14:31:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Aug 2015 14:31:55 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 08 16:31:47 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZO5A2-00007R-8L for ged-emacs-devel@m.gmane.org; Sat, 08 Aug 2015 16:31:46 +0200 Original-Received: from localhost ([::1]:53015 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZO5A1-0000wH-Jp for ged-emacs-devel@m.gmane.org; Sat, 08 Aug 2015 10:31:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZO59y-0000wC-Ge for emacs-devel@gnu.org; Sat, 08 Aug 2015 10:31:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZO59v-0006vb-4U for emacs-devel@gnu.org; Sat, 08 Aug 2015 10:31:42 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:40815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZO59u-0006vX-Tv for emacs-devel@gnu.org; Sat, 08 Aug 2015 10:31:39 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZO59t-0008Qe-Eb for emacs-devel@gnu.org; Sat, 08 Aug 2015 16:31:37 +0200 Original-Received: from 151.34.138.232 ([151.34.138.232]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 08 Aug 2015 16:31:37 +0200 Original-Received: from wavexx by 151.34.138.232 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 08 Aug 2015 16:31:37 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 151.34.138.232 X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.1.0 In-Reply-To: <83r3nfq7uq.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:188611 Archived-At: 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. >> 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 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.