]> code.delx.au - gnu-emacs-elpa/commitdiff
Option to have tempo expand tags after completion.
authorRafael Sanchez <rafael.sanchez.aguilu@gmail.com>
Wed, 27 Jan 2016 18:32:33 +0000 (13:32 -0500)
committerRafael Sanchez <rafael.sanchez.aguilu@gmail.com>
Wed, 27 Jan 2016 18:32:33 +0000 (13:32 -0500)
company-tempo.el

index 0fa5c75c312f305f612f866cf5fd3f958822011b..aa3a9790888ecc8d8b946abc100aa64fc6479595 100644 (file)
 (require 'cl-lib)
 (require 'tempo)
 
+(defgroup company-tempo nil
+  "Tempo completion backend."
+  :group 'company)
+
+(defcustom company-tempo-expand nil
+  "Whether to expand a tempo tag after completion."
+  :type '(choice (const :tag "Off" nil)
+                 (const :tag "On" t)))
+
 (defsubst company-tempo-lookup (match)
   (cdr (assoc match (tempo-build-collection))))
 
@@ -56,6 +65,7 @@
     (prefix (or (car (tempo-find-match-string tempo-match-finder)) ""))
     (candidates (all-completions arg (tempo-build-collection)))
     (meta (company-tempo-meta arg))
+    (post-completion (when company-tempo-expand (tempo-expand-if-complete)))
     (sorted t)))
 
 (provide 'company-tempo)