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: Wed, 5 Aug 2015 11:10:59 +0200 Message-ID: <55C1D323.50505@thregr.org> References: <83a8u6tplx.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 1438765892 26742 80.91.229.3 (5 Aug 2015 09:11:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Aug 2015 09:11:32 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 05 11:11:24 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 1ZMujJ-0005bK-4d for ged-emacs-devel@m.gmane.org; Wed, 05 Aug 2015 11:11:21 +0200 Original-Received: from localhost ([::1]:39691 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMujD-0000Ik-6G for ged-emacs-devel@m.gmane.org; Wed, 05 Aug 2015 05:11:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMujA-0000Id-Lz for emacs-devel@gnu.org; Wed, 05 Aug 2015 05:11:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMuj6-0008K6-7H for emacs-devel@gnu.org; Wed, 05 Aug 2015 05:11:12 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:50140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMuj6-0008J4-1l for emacs-devel@gnu.org; Wed, 05 Aug 2015 05:11:08 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZMuj3-0005WT-E7 for emacs-devel@gnu.org; Wed, 05 Aug 2015 11:11:05 +0200 Original-Received: from 193.106.183.18 ([193.106.183.18]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Aug 2015 11:11:05 +0200 Original-Received: from wavexx by 193.106.183.18 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Aug 2015 11:11:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 27 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 193.106.183.18 X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.0.1 In-Reply-To: <83a8u6tplx.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:188432 Archived-At: On 05/08/15 04:51, Eli Zaretskii wrote: >> From: Yuri D'Elia >> Date: Tue, 4 Aug 2015 22:01:24 +0200 >> >> Is there a quick way (without iterating through 'display overlays) to >> get the current column position for the displayed text? > > What is "the current column position"? How do you define a "column" > when text can include variable-size fonts and images? > > One answer to your question is posn-at-point, but I'm not sure that is > what you want. I expected such question ;) I'd like the equivalent of (current-column), or character length between (beginning-of-line) and cursor position [modulus tabs], but using the actual displayed overlays. I would almost have expected something to extract the visualized string between two points, like `buffer-substring' but iterating through overlays; but couldn't find any (did I miss it?) (posn-col-row (posn-at-point)) "would" work, but 1) seems inefficient, especially considering I don't care about variable-pitch fonts and 2) doesn't work if the point is not visible.