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: /srv/bzr/emacs/elpa r395: * company.el (company-capf): Add support for `sorted' and `post-completion'. Date: Sun, 05 May 2013 21:18:58 -0400 Message-ID: References: <87vc6yz9r4.fsf@yandex.ru> <51861D6D.8030709@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1367803147 23351 80.91.229.3 (6 May 2013 01:19:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 May 2013 01:19:07 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 06 03:19:06 2013 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 1UZA53-0006bU-Vx for ged-emacs-devel@m.gmane.org; Mon, 06 May 2013 03:19:06 +0200 Original-Received: from localhost ([::1]:49449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZA53-0007UT-IP for ged-emacs-devel@m.gmane.org; Sun, 05 May 2013 21:19:05 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40751) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZA4z-0007UC-WD for emacs-devel@gnu.org; Sun, 05 May 2013 21:19:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZA4x-00079Q-SN for emacs-devel@gnu.org; Sun, 05 May 2013 21:19:01 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:20458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZA4x-00079M-O0 for emacs-devel@gnu.org; Sun, 05 May 2013 21:18:59 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFMCqRF/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYHCxQYDSSIHgbBLZEKA6R6gV6DEw X-IPAS-Result: Av4EABK/CFFMCqRF/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYHCxQYDSSIHgbBLZEKA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="11127498" Original-Received: from 76-10-164-69.dsl.teksavvy.com (HELO pastel.home) ([76.10.164.69]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 05 May 2013 21:18:54 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id BB3EE67A30; Sun, 5 May 2013 21:18:58 -0400 (EDT) In-Reply-To: <51861D6D.8030709@yandex.ru> (Dmitry Gutov's message of "Sun, 05 May 2013 12:50:53 +0400") 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.182 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:159354 Archived-At: >>>> ;; (defun company-my-backend (command &optional arg &rest ignored) >>>> -;; (case command >>>> -;; (prefix (when (looking-back "foo\\>") >>>> +;; (pcase command >>>> +;; (`prefix (when (looking-back "foo\\>") >>>> ;; (match-string 0))) >>>> -;; (candidates (list "foobar" "foobaz" "foobarbaz")) >>>> -;; (meta (format "This value is named %s" arg)))) >>>> +;; (`candidates (list "foobar" "foobaz" "foobarbaz")) >>>> +;; (`meta (format "This value is named %s" arg)))) >>> Like the header in company.el says, we still try to support Emacs 22 and >>> 23. `pcase' was only added in 23.3, I believe. >> But this is in a comment, so it's not a problem. > I'm not sure recommending to users to write new backends in a way > incompatible with older Emacs is good. It is in my interest to encourage all users to move to a more recent Emacs. And even more so to encourage them to move away from `cl' (which will be a long and arduous path, so every bit helps). > I guess I'll remove `(init nil)', then. > By the way, if you think that `init' is useless for all backends, I don't > believe that's true for `ropemacs' and `clang'. Retrying initialization once > per buffer is fairly useful. There are many ways to do initialization in the backend (once per session, once per buffer, once per blue moon, you name it) without using `init'. >> `completion-extra-properties' can have anything you want in it. >> Same for `completion-metadata'. Of course, new entries in these >> alists/plists won't be understood by other users of >> completion-at-point-functions, but that's not a problem in itself. > Ah okay, so I guess that section has everything to do with moving some > company backends to completion-at-point functions. Very much so, yes. > This is totally fine for `company-capf', but `company-begin-with' is an old > function/feature. But I'm only suggesting to change it in more recent versions of Company, so it won't affect old users. Stefan