[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Byte offset from point
From: |
Teemu Likonen |
Subject: |
Re: Byte offset from point |
Date: |
Wed, 12 Aug 2009 22:18:42 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
On 2009-08-12 12:06 (-0700), senny wrote:
> On 12 Aug., 20:57, Teemu Likonen <tliko...@iki.fi> wrote:
>> (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.
Maybe you can do the correction manually. Count newlines twice:
(+ (position-bytes (point))
(how-many "\n" 1 (point)))
Or something like that.