From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [elpa] 02/04: company-clang: handle multibyte chars between bol and point Date: Thu, 20 Mar 2014 06:10:09 +0200 Message-ID: <532A6A21.8040802@yandex.ru> References: <20140319033013.17542.14344@vcs.savannah.gnu.org> <87mwgm9t81.fsf@yandex.ru> <834n2u9lj7.fsf@gnu.org> <5329DA52.2030704@yandex.ru> <83vbva82cy.fsf@gnu.org> <532A08FF.8020001@yandex.ru> <87ior9pohp.fsf@yandex.ru> <83k3bp8qrz.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1395288633 7172 80.91.229.3 (20 Mar 2014 04:10:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Mar 2014 04:10:33 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 20 05:10:40 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 1WQUJR-0005r3-IN for ged-emacs-devel@m.gmane.org; Thu, 20 Mar 2014 05:10:37 +0100 Original-Received: from localhost ([::1]:45103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQUJR-0001Xe-2n for ged-emacs-devel@m.gmane.org; Thu, 20 Mar 2014 00:10:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQUJG-0001IP-6I for emacs-devel@gnu.org; Thu, 20 Mar 2014 00:10:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQUJA-00046m-6i for emacs-devel@gnu.org; Thu, 20 Mar 2014 00:10:26 -0400 Original-Received: from mail-ee0-x234.google.com ([2a00:1450:4013:c00::234]:54827) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQUJ3-00045S-Sp; Thu, 20 Mar 2014 00:10:14 -0400 Original-Received: by mail-ee0-f52.google.com with SMTP id e49so156786eek.39 for ; Wed, 19 Mar 2014 21:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=NPCDRn3xyszZWSC3PX83nFkbr6VTD7vrq8JHnOSri1Y=; b=E3bC0BPlHECwUdM7VKtmHwh5Xp0C1TB36m+TAJXbQ96fqirJBX38eSjEu1+jhqVwP6 sMJwKuRodVDPurwnZpRHmgzXvEBlyI7hhKri23OzIviWCILKprdIstqfNbVa5APzk2Wy LKtZpl3vk8YLHGJztM3sDSAfKjjQAyKaZ7MSW9ZTyFhGsKX6IYtBXou3esHwraBOJxaW 26H0w6rbRaxWveGcT3sCiWIFRmjhgddOHxZlyTJVdE6h2+mTTu5W5FdsFb8Y9C6OHiAX kkkM/fkgrKD3jMbsFeOmVCQ3+II2+PXg9Nx+196MKANA9lsLD9TJpX7aqgky5aGKO5t6 Twgw== X-Received: by 10.14.203.199 with SMTP id f47mr12279391eeo.75.1395288612955; Wed, 19 Mar 2014 21:10:12 -0700 (PDT) Original-Received: from [192.168.10.2] (62-122-52.netrun.cytanet.com.cy. [62.228.122.52]) by mx.google.com with ESMTPSA id m1sm1361530een.7.2014.03.19.21.10.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 21:10:11 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: <83k3bp8qrz.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::234 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:170597 Archived-At: On 20.03.2014 05:58, Eli Zaretskii wrote: > Please tell the details: what does "don't work" mean? It means that Clang returns a wrong list of completions. Take this test file, for example: === typedef struct test_s { int num_a; long num_b; char c; } test_t; int main(int args, char *argv[]) { test_t tt; /*ыыы*/tt.; return 0; } === Put point after `.', type `M-x company-clang'. The list of completions should include 3 items, from the struct test_t. "Doesn't work" usually means that it returns a different, much longer list. So, with the above file saved in UTF-8, either approach works. But when it's in UTF-16, only the current one succeeds. > The question is not what Clang uses, the question is how does it > expect the offsets to be supplied for files encoded in different > encodings. That is something that should be described in the Clang > manuals. Either it isn't, or I don't know what to search for. > I assumed that it needs offsets in bytes, but that > assumption was not based on anything except looking at your code. The docstring for the relevant function (http://clang.llvm.org/doxygen/group__CINDEX__CODE__COMPLET.html#ga50fedfa85d8d1517363952f2e10aa3bf) says "column", but apparently it has a special notion of columns. For example, it considers any tab character as taking only one column.