emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master ada2ede 128/173: Merge pull request #461 from rlph/patch-1


From: Dmitry Gutov
Subject: [elpa] master ada2ede 128/173: Merge pull request #461 from rlph/patch-1
Date: Thu, 23 Jun 2016 00:28:44 +0000 (UTC)

branch: master
commit ada2ede3ec75235ef0a6721e526b2fc94284093e
Merge: 99ce60b ec9f6c7
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Merge pull request #461 from rlph/patch-1
    
    Option to have tempo expand tags after completion.
---
 company-tempo.el |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/company-tempo.el b/company-tempo.el
index 0fa5c75..cba42c3 100644
--- a/company-tempo.el
+++ b/company-tempo.el
@@ -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))))
 
@@ -51,11 +60,11 @@
   "`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))
+    (post-completion (when company-tempo-expand (company-tempo-insert arg)))
     (sorted t)))
 
 (provide 'company-tempo)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]