branch: master
commit 287a5fb7bcd0644caadfc6e7f23bd8aee0830718
Author: Wilfred Hughes <[email protected]>
Commit: Wilfred Hughes <[email protected]>

    Make example backend interactive
    
    When writing your first company backend, it's really helpful to be able to 
run
    the example backend with M-x. Many real company backends are interactive 
too.
---
 company.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/company.el b/company.el
index 1721005..d129633 100644
--- a/company.el
+++ b/company.el
@@ -44,7 +44,9 @@
 ;; Here is a simple example completing "foo":
 ;;
 ;; (defun company-my-backend (command &optional arg &rest ignored)
+;;   (interactive (list 'interactive))
 ;;   (pcase command
+;;     (`interactive (company-begin-backend 'company-my-backend))
 ;;     (`prefix (company-grab-symbol))
 ;;     (`candidates (list "foobar" "foobaz" "foobarbaz"))
 ;;     (`meta (format "This value is named %s" arg))))

Reply via email to