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.