From: Nikolaj Schumacher Date: Mon, 3 Oct 2011 07:42:20 +0000 (+0200) Subject: More robust clang version check. X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/042838fb0ba16758f60a164048c0b792b3ec3ecd More robust clang version check. --- diff --git a/company-clang.el b/company-clang.el index 5bd553556..73825f248 100644 --- a/company-clang.el +++ b/company-clang.el @@ -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))