emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: /srv/bzr/emacs/elpa r395: * company.el (company-capf): Add support f


From: Dmitry Gutov
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
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5

On 05.05.2013 14:05, Sebastian Wiesner wrote:
2013/5/5 Dmitry Gutov <address@hidden>:
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 via email to

[Prev in Thread] Current Thread [Next in Thread]