X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/1de79de6691409bbc044c614991a0c01bb72521f..212c8fc3101781a2f1c55ca61772eb75a2046e87:/company-tempo.el diff --git a/company-tempo.el b/company-tempo.el index ac9198862..cba42c3e3 100644 --- a/company-tempo.el +++ b/company-tempo.el @@ -1,6 +1,6 @@ -;;; company-tempo.el --- company-mode completion back-end for tempo +;;; company-tempo.el --- company-mode completion backend for tempo -;; Copyright (C) 2009-2011 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011, 2015 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -29,6 +29,15 @@ (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)))) @@ -48,15 +57,14 @@ ;;;###autoload (defun company-tempo (command &optional arg &rest ignored) - "`company-mode' completion back-end for tempo." + "`company-mode' completion backend for tempo." (interactive (list 'interactive)) (cl-case command - (interactive (company-begin-backend 'company-tempo - 'company-tempo-insert)) + (interactive (company-begin-backend 'company-tempo)) (prefix (or (car (tempo-find-match-string tempo-match-finder)) "")) (candidates (all-completions arg (tempo-build-collection))) (meta (company-tempo-meta arg)) - (require-match t) + (post-completion (when company-tempo-expand (company-tempo-insert arg))) (sorted t))) (provide 'company-tempo)