From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: senny Newsgroups: gmane.emacs.help Subject: Re: Byte offset from point Date: Wed, 12 Aug 2009 12:06:26 -0700 (PDT) Organization: http://groups.google.com Message-ID: <2c08d46a-482d-4c99-b815-f06a97f6e9de@d4g2000yqa.googlegroups.com> References: <87y6pouagb.fsf@iki.fi> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1250106215 7542 80.91.229.12 (12 Aug 2009 19:43:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Aug 2009 19:43:35 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 12 21:43:28 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MbJjL-0000eh-4D for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Aug 2009 21:43:27 +0200 Original-Received: from localhost ([127.0.0.1]:51928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbJjI-0001FF-P0 for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Aug 2009 15:43:24 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!d4g2000yqa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 14 Original-NNTP-Posting-Host: 89.236.143.64 Original-X-Trace: posting.google.com 1250103986 3708 127.0.0.1 (12 Aug 2009 19:06:26 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 12 Aug 2009 19:06:26 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d4g2000yqa.googlegroups.com; posting-host=89.236.143.64; posting-account=HpnstAoAAADdixpnvjy3qaoKJJO_Jdvb User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; de-de) AppleWebKit/530.19.2 (KHTML, like Gecko) Version/4.0.2 Safari/530.19, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:171922 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:67097 Archived-At: On 12 Aug., 20:57, Teemu Likonen wrote: > On 2009-08-12 11:44 (-0700), senny wrote: > > > I am looking for a way to get the exact byte-offset from the cursor > > position. I need this value to call an external service. Is there a > > way to achieve this in emacs? > > Perhaps this: > > =A0 =A0 (position-bytes (point)) I tried that but it gave me incorrect results when dealing with newlines on windows. The lisp function counted them as 1 byte but the service i was calling counted them as 2 bytes.