From: Dmitry Gutov Date: Fri, 9 Aug 2013 14:16:50 +0000 (+0300) Subject: Fix company-cmake-doc-buffer X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/15a5062a17805a8d3a7a6b31ce3f3f805ad9b724 Fix company-cmake-doc-buffer --- diff --git a/company-cmake.el b/company-cmake.el index d4f557788..cf3ff23da 100644 --- a/company-cmake.el +++ b/company-cmake.el @@ -96,18 +96,17 @@ They affect which types of symbols we get completion candidates for.") (setq result (replace-regexp-in-string "^[ \t\n\r]+" "" result)) result))) -(defun company-cmake-doc-buffer (candidates) - (let ((cmd-opts (gethash prefix company-cmake--meta-command-cache)) - result) +(defun company-cmake-doc-buffer (prefix) + (let ((cmd-opts (gethash prefix company-cmake--meta-command-cache))) (with-temp-buffer (call-process company-cmake-executable nil t nil cmd-opts prefix) - ;; Go to the third line, trim it and return the result. + ;; Go to the third line, trim it and return the doc buffer. ;; Tested with cmake 2.8.9. (goto-char (point-min)) (forward-line 2) - (setq result (buffer-substring-no-properties (line-beginning-position) - (point-max))) - result))) + (company-doc-buffer + (buffer-substring-no-properties (line-beginning-position) + (point-max)))))) (defun company-cmake (command &optional arg &rest ignored) "`company-mode' completion back-end for CMake.