]> code.delx.au - gnu-emacs-elpa/commitdiff
More cleanup
authorDmitry Gutov <dgutov@yandex.ru>
Thu, 6 Nov 2014 07:22:10 +0000 (09:22 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Thu, 6 Nov 2014 07:22:10 +0000 (09:22 +0200)
company-cmake.el

index 377c005e5d3fb2a0683c1d627321e22975906542..5e3b003e769a3313bf32da4b511905c2d29b6f19 100644 (file)
@@ -79,15 +79,16 @@ They affect which types of symbols we get completion candidates for.")
     ;; If hash is empty, fill it.
     (unless (gethash arg company-cmake--candidates-cache)
       (with-temp-buffer
-        (setq res (call-process company-cmake-executable nil t nil arg))
-        (unless (eq 0 res)
-          (message "cmake executable exited with error=%d" res))
+        (let ((res 0))
+          (setq res (call-process company-cmake-executable nil t nil arg))
+          (unless (eq 0 res)
+            (message "cmake executable exited with error=%d" res)))
         (setq rlt (buffer-string)))
       (setq rlt (company-cmake--replace-tags rlt))
       (puthash arg rlt company-cmake--candidates-cache))
     ))
 
-(defun company-cmake-find-match (pattern line)
+(defun company-cmake--find-match (pattern line cmd)
   (let (match)
      ;; General Flags
      (if (string-match pattern line)
@@ -101,17 +102,15 @@ They affect which types of symbols we get completion candidates for.")
                          (regexp-quote prefix)
                          (if (zerop (length prefix)) "+" "*")))
         (lines (split-string content "\n"))
-        (lang-patterns ())
         match
         rlt)
     (dolist (line lines)
-      (if (setq match (company-cmake-find-match pattern line))
+      (if (setq match (company-cmake--find-match pattern line cmd))
           (push match rlt)))
     rlt))
 
 (defun company-cmake--candidates (prefix)
-  (let ((res 0)
-        results
+  (let (results
         cmd-opts
         str)