unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Sebastian Wiesner <lunaryorn@gmail.com>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
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	[thread overview]
Message-ID: <518630C1.9030708@yandex.ru> (raw)
In-Reply-To: <CALf2awSug9jSRiqhYG7mr-by0oE5AKxEvQ-JXCwG=ERbX-iALw@mail.gmail.com>

On 05.05.2013 14:05, Sebastian Wiesner wrote:
> 2013/5/5 Dmitry Gutov <dgutov@yandex.ru>:
>> 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!



  reply	other threads:[~2013-05-05 10:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1UW5x9-0001hw-8W@vcs.savannah.gnu.org>
2013-05-04 21:59 ` /srv/bzr/emacs/elpa r395: * company.el (company-capf): Add support for `sorted' and `post-completion' Dmitry Gutov
2013-05-05  6:32   ` Stefan Monnier
2013-05-05  8:50     ` Dmitry Gutov
2013-05-05 10:05       ` Sebastian Wiesner
2013-05-05 10:13         ` Dmitry Gutov [this message]
2013-05-06  1:18       ` Stefan Monnier
2013-05-06  2:43         ` Dmitry Gutov
2013-05-06  3:22           ` Stefan Monnier
2013-05-09 20:35             ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=518630C1.9030708@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=lunaryorn@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).