From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: enabling company-capf support in cfengine.el Date: Fri, 17 Jan 2014 08:04:47 -0500 Message-ID: References: <87fvqtg02v.fsf@flea.lifelogs.com> <2518D79A-B9E4-45DF-A403-8330145DFD17@gmail.com> <87eh58j0x3.fsf@flea.lifelogs.com> <878uvg4ul2.fsf@yandex.ru> <87y53ghe94.fsf@flea.lifelogs.com> <87vbyk3497.fsf@yandex.ru> <87haa4gw69.fsf@flea.lifelogs.com> <87txe4usm1.fsf@yandex.ru> <87zjnvg2t2.fsf@flea.lifelogs.com> <87txe364q0.fsf@yandex.ru> <87r497fu0h.fsf@flea.lifelogs.com> <87haa1litl.fsf@yandex.ru> <87y53czx7e.fsf@yandex.ru> <87bo08bivm.fsf_-_@flea.lifelogs.com> <87sitkzahs.fsf@yandex.ru> <52D7DAAB.2070709@yandex.ru> <52D81960.2080408@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1389963905 7204 80.91.229.3 (17 Jan 2014 13:05:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Jan 2014 13:05:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 17 14:05:11 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 1W496i-0005aN-IA for ged-emacs-devel@m.gmane.org; Fri, 17 Jan 2014 14:05:08 +0100 Original-Received: from localhost ([::1]:38047 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W496h-0002L3-T1 for ged-emacs-devel@m.gmane.org; Fri, 17 Jan 2014 08:05:07 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W496Y-0002C9-3n for emacs-devel@gnu.org; Fri, 17 Jan 2014 08:05:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W496Q-0007sI-IT for emacs-devel@gnu.org; Fri, 17 Jan 2014 08:04:58 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:62211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W496Q-0007sE-E0 for emacs-devel@gnu.org; Fri, 17 Jan 2014 08:04:50 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFMCoyj/2dsb2JhbABEvw4Xc4IeAQEEAScvIwULCw4mEhQYDSSIHgbBLZEKA4hhnBmBXoMV X-IPAS-Result: Av4EABK/CFFMCoyj/2dsb2JhbABEvw4Xc4IeAQEEAScvIwULCw4mEhQYDSSIHgbBLZEKA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="45177692" Original-Received: from 76-10-140-163.dsl.teksavvy.com (HELO pastel.home) ([76.10.140.163]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 17 Jan 2014 08:04:49 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 4720E6028A; Fri, 17 Jan 2014 08:04:47 -0500 (EST) In-Reply-To: <52D81960.2080408@yandex.ru> (Dmitry Gutov's message of "Thu, 16 Jan 2014 19:39:44 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:168603 Archived-At: > And many of them still behave inappropriately, like > semantic-ia-complete-symbol' and `nxml-complete'. Whenever you bump into such problems, do report them. I'll take a look at the above two. >> BTW, the next step would be to supplant other company backends, like >> we've done with company-elisp: company-css, company-nxml, and >> company-semantic look like prime candidates. > Indeed. Although I'm not sure what would be an appropriate counterpart in > CAPF for `company-semantic--pre-prefix-length'. You mean, what should be the counterpart to: cannot \(e.g. if it is in the middle of a string\). Instead of a string, the back-end may return a cons where car is the prefix and cdr is used in `company-minimum-prefix-length' test. It's either number or t, in which case the test automatically succeeds. A straightforward option might be to have CAPF return a new :company-prefix-length-offset property which is then added to the prefix length by company-capf. >From a more CAPF-centric point of view, in the case of Semantic, another option is to return as prefix not "ch" but "fr->ch", and then specify a boundary between "fr->" and "ch". > With Semantic, we also have the question of alternatives. At the moment, > company-semantic' goes before `company-clang', so that if semantic-mode is > enabled, the former is used, and otherwise, the latter. That's easy to solve: turn company-clang into its CAPF equivalent, then place it within completion-at-point-functions after the Semantic one. Stefan