From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sebastian Wiesner Newsgroups: gmane.emacs.devel Subject: Re: /srv/bzr/emacs/elpa r395: * company.el (company-capf): Add support for `sorted' and `post-completion'. Date: Sun, 5 May 2013 12:05:22 +0200 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; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1367748331 6660 80.91.229.3 (5 May 2013 10:05:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 May 2013 10:05:31 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 05 12:05:29 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 1UYvov-0006jq-JQ for ged-emacs-devel@m.gmane.org; Sun, 05 May 2013 12:05:29 +0200 Original-Received: from localhost ([::1]:60134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYvov-0001aF-6a for ged-emacs-devel@m.gmane.org; Sun, 05 May 2013 06:05:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYvoq-0001a9-L0 for emacs-devel@gnu.org; Sun, 05 May 2013 06:05:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UYvop-0006ym-FV for emacs-devel@gnu.org; Sun, 05 May 2013 06:05:24 -0400 Original-Received: from mail-qe0-f47.google.com ([209.85.128.47]:39408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYvop-0006y5-C1 for emacs-devel@gnu.org; Sun, 05 May 2013 06:05:23 -0400 Original-Received: by mail-qe0-f47.google.com with SMTP id w7so1590387qeb.6 for ; Sun, 05 May 2013 03:05:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=qPR1zsPdNSN4PbMSaNQ8jsGo9qGEu6y8nzMhjIDw1TA=; b=n/5WSyFyuZnN937+ce9Z3YYQBIiCG/+3J0bR3cjkoaKqwEjFZZHriGYVV3iIZ/A1zp pjcMoBhWBLgddNP6czkLSRqvCN1QAqeW4G7+nDvvw4wwcu4DxzpkbK52wmNu5F/xmuBK /yTMnOyVLVvuSKOVWxia6GBbDT+zwT5l7h2y8WuQrGvREO/Lk6wO/R90cqBNeTW7jhKr 9bS3vqwY/oI9bnDrJBCBkqRzUX24sNuMloe2HQSZgXSbyvsHoWBJwagGDhz6RgGS7APd tks7nO5rSghhJtgryQIwUhwl1ZA+eC/cSFTbEF0e5T5fE7pvlFDjmPjKVQ7zR2rrs70p OVzg== X-Received: by 10.49.73.202 with SMTP id n10mr21641202qev.55.1367748322759; Sun, 05 May 2013 03:05:22 -0700 (PDT) Original-Received: by 10.224.218.132 with HTTP; Sun, 5 May 2013 03:05:22 -0700 (PDT) In-Reply-To: <51861D6D.8030709@yandex.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.128.47 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:159327 Archived-At: 2013/5/5 Dmitry Gutov : > On 05.05.2013 10:32, Stefan Monnier wrote: >>>> >>>> ;; (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)))) >> > [=E2=80=A6] > > By the way, is there a reason to use backquotes here? I remember you > removing quotes from all backends' `case' forms, and using unquoted symbo= ls > in `pcase' seems to work just as well: > > (pcase 'boo (boo 'bah)) =3D> 'bah This clause does **not** match the symbol 'boo. It matches **anything** and binds it to "boo". See (pcase 'boo (foo foo) (boo 'bah)) =3D> 'boo compared to: (pcase 'boo (`foo foo) (`boo 'bah)) =3D> 'bah So the backquote is actually mandatory here.