From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#16334: 24.3.50; company-capf eats the first char in IELM filename completions Date: Mon, 06 Jan 2014 09:33:41 +0400 Message-ID: <52CA4035.2020302@yandex.ru> References: <87sit4ejpq.fsf@yandex.ru> <52C8C18A.3010501@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1388986455 27841 80.91.229.3 (6 Jan 2014 05:34:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Jan 2014 05:34:15 +0000 (UTC) Cc: 16334@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 06 06:34:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1W02pQ-0007tx-Ur for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Jan 2014 06:34:21 +0100 Original-Received: from localhost ([::1]:60805 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W02pQ-0001kf-HO for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Jan 2014 00:34:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W02pF-0001hD-TO for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2014 00:34:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W02p8-0002fX-F0 for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2014 00:34:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51832) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W02p8-0002fT-B1 for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2014 00:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W02p7-0007MX-Vj for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2014 00:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Jan 2014 05:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16334 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16334-submit@debbugs.gnu.org id=B16334.138898642828276 (code B ref 16334); Mon, 06 Jan 2014 05:34:01 +0000 Original-Received: (at 16334) by debbugs.gnu.org; 6 Jan 2014 05:33:48 +0000 Original-Received: from localhost ([127.0.0.1]:37618 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W02ot-0007Ly-JO for submit@debbugs.gnu.org; Mon, 06 Jan 2014 00:33:47 -0500 Original-Received: from mail-lb0-f181.google.com ([209.85.217.181]:62134) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W02or-0007Lm-LV for 16334@debbugs.gnu.org; Mon, 06 Jan 2014 00:33:46 -0500 Original-Received: by mail-lb0-f181.google.com with SMTP id q8so9466912lbi.40 for <16334@debbugs.gnu.org>; Sun, 05 Jan 2014 21:33:44 -0800 (PST) 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=LUS+g4fcm6HtwkGX8NuPqYxCNwMXzS5671WIOoicUMM=; b=RqsridUgcK7hp2Or4fCct3VI9cR1TCRh7VrzMoqQmNjFlhozMLV5ds6grvSurldO+g 9MKj2EvtF9TGt9mioOeY3ASTplmW7CSg5x5Og8j4K9/3imLv3wNnwJEbxhLyMKjMb1ve umtTf5MQvbv7YbzN8/k+MiCA1lJPme+H4K7otWoEplTzb9LZUNquc4M2HcJm2vfJdhgR OLslI9aB9G4IUG8YLtTe9j7LCGO1Gb5GEUvIVlfZ8lUb59lPKp8kMdp/BkgKnuPYkGPe 8/mYXxH0gPTztMIJvzlx4knaMR5y7fhotoDTIQWOl7+m73Za6JCggZIZAmCVllJd4yuM MZOg== X-Received: by 10.112.151.74 with SMTP id uo10mr209298lbb.45.1388986424430; Sun, 05 Jan 2014 21:33:44 -0800 (PST) Original-Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id np10sm42012626lbb.7.2014.01.05.21.33.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 05 Jan 2014 21:33:43 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:83050 Archived-At: On 05.01.2014 08:53, Stefan Monnier wrote: >> `completion-file-name-table' is more of an exception, I think. But if >> it was only passed the segment of STRING after the last path >> separator, it could still look behind it in the buffer and see the >> full path. > > But the completion may actually want to *change* the text before > the boundary. E.g. completion of /u/s/d to /usr/share/doc. In that case, "/usr/share/doc" is the completion candidate, not "doc", right? Then, "/u/s/d" can be considered a "generalized" prefix, or the entity to complete, in c-a-p-f terms. And during completion we delete the latter and insert the former. > The completion table itself does not know how to do that, but some > completion styles do (e.g. partial-completion). > So the completion-at-point-function needs to indicate the boundaries of > "/u/s/d" which indicate which text can be affected by the completion, > while `completion-boundaries' tells the lower-level completion code > (e.g. the one in partial-completion) how to split the completion field > into sub-fields. To be clear, I'm not convinced that the notion of "sub-fields" is useful. Defining limits to the text that can be affected by completion only looks good to me from the presentation point of view: if the candidate strings can be shorter, we can show more of them in the *Candidates* buffer, whereas it's less useful for popup-style UIs where the candidates are displayed vertically anyway. IOW, if I were to add a `boundaries' action to company-backends API, it would only be used for presentation: the popup will cut off that many characters from the candidate strings, and it will be rendered that many columns to the right. And maybe do the same for suffix boundary, when/if we support that kind of completion. Come to think of it, though, this new action may be incompatible with the notion of merged backends. If we have candidates that come from backends that return the same prefix but different boundaries, there's no way to reflect the boundaries in the popup.