X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/ca001a562783538cad2762d90f8026896b4d6985..0d834ff627ae024cd1edfb21023f506737139f24:/packages/company/company-clang.el diff --git a/packages/company/company-clang.el b/packages/company/company-clang.el index a1a325125..8114b3b5b 100644 --- a/packages/company/company-clang.el +++ b/packages/company/company-clang.el @@ -51,7 +51,7 @@ and `c-electric-colon', for automatic completion right after \">\" and "Additional arguments to pass to clang when completing. Prefix files (-include ...) can be selected with `company-clang-set-prefix' or automatically through a custom `company-clang-prefix-guesser'." - :type '(repeat (string :tag "Argument" nil))) + :type '(repeat (string :tag "Argument"))) (defcustom company-clang-prefix-guesser 'company-clang-guess-prefix "A function to determine the prefix file for the current buffer." @@ -150,7 +150,13 @@ or automatically through a custom `company-clang-prefix-guesser'." ((string-match "[^:]:[^:]" meta) (substring meta (1+ (match-beginning 0)))) ((string-match "\\((.*)[ a-z]*\\'\\)" meta) - (match-string 1 meta))))) + (let ((paren (match-beginning 1))) + (if (not (eq (aref meta (1- paren)) ?>)) + (match-string 1 meta) + (with-temp-buffer + (insert meta) + (goto-char paren) + (substring meta (1- (search-backward "<")))))))))) (defun company-clang--strip-formatting (text) (replace-regexp-in-string @@ -182,7 +188,8 @@ or automatically through a custom `company-clang-prefix-guesser'." (defun company-clang--start-process (prefix callback &rest args) (let ((objc (derived-mode-p 'objc-mode)) - (buf (get-buffer-create "*clang-output*"))) + (buf (get-buffer-create "*clang-output*")) + (process-adaptive-read-buffering nil)) (with-current-buffer buf (erase-buffer)) (if (get-buffer-process buf) (funcall callback nil) @@ -320,7 +327,8 @@ passed via standard input." (insert anno) (if (string-match "\\`:[^:]" anno) (company-clang-objc-templatify anno) - (company-template-c-like-templatify anno))))))) + (company-template-c-like-templatify + (concat arg anno)))))))) (provide 'company-clang) ;;; company-clang.el ends here