all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sebastian Wiesner <lunaryorn@gmail.com>
To: Dmitry Gutov <dgutov@yandex.ru>
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, 5 May 2013 12:05:22 +0200	[thread overview]
Message-ID: <CALf2awSug9jSRiqhYG7mr-by0oE5AKxEvQ-JXCwG=ERbX-iALw@mail.gmail.com> (raw)
In-Reply-To: <51861D6D.8030709@yandex.ru>

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.



  reply	other threads:[~2013-05-05 10:05 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 [this message]
2013-05-05 10:13         ` Dmitry Gutov
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

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

  git send-email \
    --in-reply-to='CALf2awSug9jSRiqhYG7mr-by0oE5AKxEvQ-JXCwG=ERbX-iALw@mail.gmail.com' \
    --to=lunaryorn@gmail.com \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.