|
From: | Dmitry Gutov |
Subject: | Re: [elpa] 02/04: company-clang: handle multibyte chars between bol and point |
Date: | Wed, 19 Mar 2014 19:56:34 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
On 19.03.2014 18:54, Eli Zaretskii wrote:
Sorry, maybe I'm missing something, but I don't see how this could be a reasonable assumption. Don't you need to produce the same byte stream as would be found in the file when saved to disk?
Since we only need to count the bytes between the bol and point (on disk, yes), and multibyte chars are relatively rare, we can afford not to be very accurate.
But if you could point out an easy way to obtain that byte count more correctly, that would be quite welcome.
If so, then you need to produce data about byte counts as they will be in that encoding, which is defined by buffer-file-coding-system.
So, um, do I use something like (length (encode-coding-string STR buffer-file-coding-system)) ?
[Prev in Thread] | Current Thread | [Next in Thread] |