I want to write backend for company-mode. I have this example:
(require 'company)
(require 'cl-lib)
(defun backend-name (command &optional arg &rest ignored)
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'backend-name))
(prefix (when (looking-back "git .*?\\([a-zA-Z-~]+ \\)$") (match-string 1)))
(candidates (cond
((string= arg "reset ) '("--hard" "--soft"))
(t nil)))))
This does not do what I want. Choosing "--hard" from list replaces word "reset ". It should append "--hard" to the end of word "reset ".