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: /srv/bzr/emacs/elpa r395: * company.el (company-capf): Add support for `sorted' and `post-completion'. Date: Sun, 05 May 2013 14:13:21 +0400 Message-ID: <518630C1.9030708@yandex.ru> 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; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1367748815 11005 80.91.229.3 (5 May 2013 10:13:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 May 2013 10:13:35 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Sebastian Wiesner Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 05 12:13:34 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 1UYvwj-00035Q-Sa for ged-emacs-devel@m.gmane.org; Sun, 05 May 2013 12:13:33 +0200 Original-Received: from localhost ([::1]:33851 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYvwj-00037A-C4 for ged-emacs-devel@m.gmane.org; Sun, 05 May 2013 06:13:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYvwc-000357-OU for emacs-devel@gnu.org; Sun, 05 May 2013 06:13:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UYvwY-0000MS-P2 for emacs-devel@gnu.org; Sun, 05 May 2013 06:13:26 -0400 Original-Received: from mail-la0-x22f.google.com ([2a00:1450:4010:c03::22f]:64058) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYvwY-0000L4-Hc for emacs-devel@gnu.org; Sun, 05 May 2013 06:13:22 -0400 Original-Received: by mail-la0-f47.google.com with SMTP id fh20so2604657lab.34 for ; Sun, 05 May 2013 03:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding:x-antivirus:x-antivirus-status; bh=ETaRbY/MThsI9BnZQdD58Qcla0oidApK7xUO6m5tJb0=; b=qYtXqNIcG+Wv3RzLrjDtw5cxusiJ88jjCeP96EVA5RQiXft3rX7wYJwHOFi++i3jAS DgXB1a5TPB/zJaRR1cDlCZI5jjBjvBCu68dBwSII/aQOd8P/aDQTOverPVtpIvzAh3SN LxN8D8QOTuLodZUHK+ioVOrqtPkPfwPAINQS5MVHbpIhvYaerP4Gj2v+/7G7+qHBDWfP HyHC/r8hQmoNRyBhQDLJf4ouYHZz+VeXa22w/bIcbTTGXrJRhKN0mtiuQI5KwCBVV9JH JrX4AZqS/mYID5Z8DvWDthDkvcHuX4+iUw85ifvDCYdXBTVsdG5fMWT2rNRkIEOYDFuT tuFA== X-Received: by 10.112.181.163 with SMTP id dx3mr6439828lbc.126.1367748801625; Sun, 05 May 2013 03:13:21 -0700 (PDT) Original-Received: from [127.0.0.1] ([178.252.98.87]) by mx.google.com with ESMTPSA id c15sm6794545lbj.17.2013.05.05.03.13.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 05 May 2013 03:13:20 -0700 (PDT) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 In-Reply-To: X-Antivirus: avast! (VPS 130505-0, 05.05.2013), Outbound message X-Antivirus-Status: Clean X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22f 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:159328 Archived-At: On 05.05.2013 14:05, Sebastian Wiesner wrote: > 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)))) >>> >> […] >> >> By the way, is there a reason to use backquotes here? I remember you >> removing quotes from all backends' `case' forms, and using unquoted symbols >> in `pcase' seems to work just as well: >> >> (pcase 'boo (boo 'bah)) => 'bah > > This clause does **not** match the symbol 'boo. It matches > **anything** and binds it to "boo". See > > (pcase 'boo (foo foo) (boo 'bah)) => 'boo > > compared to: > > (pcase 'boo (`foo foo) (`boo 'bah)) => 'bah > > So the backquote is actually mandatory here. Oh, I see. Thanks!