From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Darren Hoo Newsgroups: gmane.emacs.devel Subject: Re: How to get column number relative to the beginning of a screen line? Date: Wed, 15 Jan 2014 03:24:34 +0800 Message-ID: References: <8338kq5r6k.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d043be23c7407f504eff3249a X-Trace: ger.gmane.org 1389727496 30322 80.91.229.3 (14 Jan 2014 19:24:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Jan 2014 19:24:56 +0000 (UTC) Cc: emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 14 20:25:03 2014 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 1W39bi-0003Ku-7Q for ged-emacs-devel@m.gmane.org; Tue, 14 Jan 2014 20:25:02 +0100 Original-Received: from localhost ([::1]:50289 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W39bh-0002wH-L0 for ged-emacs-devel@m.gmane.org; Tue, 14 Jan 2014 14:25:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W39bR-0002ca-J9 for emacs-devel@gnu.org; Tue, 14 Jan 2014 14:24:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W39bL-000305-Nr for emacs-devel@gnu.org; Tue, 14 Jan 2014 14:24:45 -0500 Original-Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:48140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W39bJ-0002zI-PT; Tue, 14 Jan 2014 14:24:37 -0500 Original-Received: by mail-wi0-f169.google.com with SMTP id e4so2977941wiv.4 for ; Tue, 14 Jan 2014 11:24:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=pthbK4/aReIag+l7HYpLh7nwE/Sh6ZI2wvB21/JG8Qw=; b=ZgDDrcnDzJYHTppfZ0g1eUB2O3qa/VaX2KZBxweRWX4Df6jRpadJ12aOyn1l6g4UB/ gXPQNrefOTH7QDe2ReTHJp8AXjeIG5mnCZAMwc7uW3+K8GyRUMot+m12lZFsjTCb1WW6 Q5o4twTBlmTwY5YZn49kaj0I3JzoKv15Ff4CmnqTkcJ04h5QntM92zrkoac/TQc4eGGY /D68STA7BqMhXn5NMOuQThtlyoXEsyus4sHM6DY8khqjU3odc1nS1Wy93VuZsYE7VY8q OcJIYPKtIbZxp878eB8j4JjiesMW7ICWMPNbYrdmPb7WDR5cXO9O9KcsIGQhFI1xL8Rr J0oQ== X-Received: by 10.180.75.115 with SMTP id b19mr22266595wiw.19.1389727474516; Tue, 14 Jan 2014 11:24:34 -0800 (PST) Original-Received: by 10.194.104.231 with HTTP; Tue, 14 Jan 2014 11:24:34 -0800 (PST) In-Reply-To: <8338kq5r6k.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::229 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:168383 Archived-At: --f46d043be23c7407f504eff3249a Content-Type: text/plain; charset=ISO-8859-1 Thanks! It is what I want. On Wed, Jan 15, 2014 at 2:55 AM, Eli Zaretskii wrote: > > From: Darren Hoo > > Date: Wed, 15 Jan 2014 01:59:32 +0800 > > > > if a line wrap or truncation happens how can I get the column number > > relative to the beginning of the line displayed? for example: > > > > ------------------------------------------------------------- > > This is a a loooooooooooooooooooooooooooooooooooooooooog line > > start of the continuation line > > ------------------------------------------------------------- > > > > If point stays at , some function `current-screen-column' should > > return the relative column number to "start". > > I think you want posn-at-point. > --f46d043be23c7407f504eff3249a Content-Type: text/html; charset=ISO-8859-1
Thanks! It is what I want.


On Wed, Jan 15, 2014 at 2:55 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> From: Darren Hoo <darren.hoo@gmail.com>
> Date: Wed, 15 Jan 2014 01:59:32 +0800
>
> if a line wrap or truncation happens how can I get the column number
> relative to the beginning of the line displayed? for example:
>
> -------------------------------------------------------------
> This is a a loooooooooooooooooooooooooooooooooooooooooog line
> start of the continuation <!> line
> -------------------------------------------------------------
>
> If point stays at <!>, some function `current-screen-column' should
> return the relative column number to "start".

I think you want posn-at-point.

--f46d043be23c7407f504eff3249a--