]> code.delx.au - gnu-emacs-elpa/commitdiff
More robust clang version check.
authorNikolaj Schumacher <git@nschum.de>
Mon, 3 Oct 2011 07:42:20 +0000 (09:42 +0200)
committerNikolaj Schumacher <git@nschum.de>
Mon, 3 Oct 2011 07:42:20 +0000 (09:42 +0200)
company-clang.el

index 5bd55355610e01410f7259bdf3c3a79c02bfe552..73825f2482ba10c959293689239a6bd6e0e273f4 100644 (file)
@@ -172,10 +172,12 @@ Prefix files (-include ...) can be selected with
 (defsubst company-clang-version ()
   "Return the version of `company-clang-executable'."
   (with-temp-buffer
+    (switch-to-buffer (current-buffer))
     (call-process company-clang-executable nil t nil "--version")
     (goto-char (point-min))
-    (when (re-search-forward "\\`clang version \\([0-9.]+\\)" nil t)
-      (match-string-no-properties 1))))
+    (if (re-search-forward "\\clang version \\([0-9.]+\\)" nil t)
+        (match-string-no-properties 1)
+      "0")))
 
 (defun company-clang-objc-templatify (selector)
   (let* ((end (point))