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 20:44:19 +0200 Message-ID: <55C25983.5040702@thregr.org> References: <83a8u6tplx.fsf@gnu.org> <55C1D323.50505@thregr.org> <831tfhu5ge.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 1438800309 21444 80.91.229.3 (5 Aug 2015 18:45:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Aug 2015 18:45:09 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 05 20:44:57 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 1ZN3gO-0006vK-LB for ged-emacs-devel@m.gmane.org; Wed, 05 Aug 2015 20:44:56 +0200 Original-Received: from localhost ([::1]:41722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZN3gO-0002WP-6D for ged-emacs-devel@m.gmane.org; Wed, 05 Aug 2015 14:44:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZN3gA-0002VS-Ol for emacs-devel@gnu.org; Wed, 05 Aug 2015 14:44:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZN3g7-00060U-I8 for emacs-devel@gnu.org; Wed, 05 Aug 2015 14:44:42 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:58540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZN3g7-00060D-5I for emacs-devel@gnu.org; Wed, 05 Aug 2015 14:44:39 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZN3g5-0006kX-8d for emacs-devel@gnu.org; Wed, 05 Aug 2015 20:44:37 +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 20:44:37 +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 20:44:37 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 24 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: <831tfhu5ge.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:188457 Archived-At: On 05/08/15 17:21, Eli Zaretskii wrote: >> 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?) > > The overlay strings are directly accessible via 'overlay-get', so why > would anyone need the feature you expected to exist? I don't think we're on the same line of thought. The usage scenario is pretty simple: assume a terminal display. I want to determine the current /visual/ column at point. (current-column) will not account for overlays that have a 'display property of a different length than the overlay range. It's really that simple. The second part is a consequence: if I want to have a string of the current line as seen by the user, I have to manually iterate through overlays, handle 'display manually and reassemble the line myself. There's no buffer-substring equivalent that gives me the string "with 'display overlays" between two points.