Hey all!
I'm attempting to write my own custom backend which reads from an org file, grabs all the top-level headings and displays them in the company-mode popup as selection candidates.
I have this working pretty well, but I was wondering if it was possible to (once the candidate has been selected) have the insert text (what actually gets placed _into_ the buffer) changed or otherwise manipulated in some other way so that the value is different from the selection candidate.
I was under the impression `post-completion` would allow this, but it doesn't seem to work. Here's my `defun`:
(defun company-sample-backend (command &optional arg &rest ignored)
(interactive (list 'interactive))
(let ((people (org-ql-select (concat org-dir "/contacts.org") '(level 1)
:action #'org-get-heading)))
(cl-case command
(interactive (company-begin-backend 'company-sample-backend))
(prefix
(and (eq major-mode 'org-mode)
(company-grab-symbol)))
(candidates (my/contacts-candidates arg))
(post-completion (company-thing arg)))))