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

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

[elpa] 23/31: Define company-version


From: Dmitry Gutov
Subject: [elpa] 23/31: Define company-version
Date: Tue, 18 Mar 2014 05:19:38 +0000

dgutov pushed a commit to branch master
in repository elpa.

commit 641657ff12ed986d4896a2ff5ef7bd586d95bd73
Author: Dmitry Gutov <address@hidden>
Date:   Fri Mar 14 02:30:42 2014 +0200

    Define company-version
    
    Closes #77
---
 NEWS.md    |    1 +
 company.el |   12 ++++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index 7403af4..3b4ae78 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,7 @@
 
 ## Next
 
+* New function `company-version`.
 * New bundled back-end `company-yasnippet`.
 * Completion candidates returned from grouped back-ends are tagged to remember
   which back-end each came from.
diff --git a/company.el b/company.el
index 6367cba..da2e940 100644
--- a/company.el
+++ b/company.el
@@ -1820,6 +1820,18 @@ Example: \(company-begin-with '\(\"foo\" \"foobar\" 
\"foobarbaz\"\)\)"
         ,require-match)))
    callback))
 
+(defun company-version (&optional show-version)
+  "Get the Company version as string.
+
+If SHOW-VERSION is non-nil, show the version in the echo area."
+  (interactive (list t))
+  (with-temp-buffer
+    (insert-file-contents (find-library-name "company"))
+    (require 'lisp-mnt)
+    (if show-version
+        (message "Company version: %s" (lm-version))
+      (lm-version))))
+
 ;;; pseudo-tooltip 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (defvar company-pseudo-tooltip-overlay nil)



reply via email to

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