From: Dmitry Gutov Date: Sun, 26 May 2013 02:59:04 +0000 (+0400) Subject: company-doc-buffer: Use the arg; rename the buffer X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/900a78dbaac691a6a852eb6e19bff16370de8add company-doc-buffer: Use the arg; rename the buffer --- diff --git a/company-ropemacs.el b/company-ropemacs.el index 73bb33d33..0ba26e68b 100644 --- a/company-ropemacs.el +++ b/company-ropemacs.el @@ -43,9 +43,7 @@ "Return buffer with docstring of CANDIDATE if it is available." (let ((doc (company-with-candidate-inserted candidate (rope-get-doc)))) (when doc - (with-current-buffer (company-doc-buffer) - (insert doc) - (current-buffer))))) + (company-doc-buffer doc)))) (defun company-ropemacs-location (candidate) "Return location of CANDIDATE in cons form (FILE . LINE) if it is available." diff --git a/company-semantic.el b/company-semantic.el index 92cd178e3..796cc9ec0 100644 --- a/company-semantic.el +++ b/company-semantic.el @@ -74,11 +74,10 @@ (defun company-semantic-doc-buffer (tag) (let ((doc (semantic-documentation-for-tag tag))) (when doc - (with-current-buffer (company-doc-buffer) - (insert (funcall semantic-idle-summary-function tag nil t) - "\n" - doc) - (current-buffer))))) + (company-doc-buffer + (concat (funcall semantic-idle-summary-function tag nil t) + "\n" + doc))))) (defsubst company-semantic-completions (prefix) (ignore-errors diff --git a/company.el b/company.el index ec6834b95..9a916c707 100644 --- a/company.el +++ b/company.el @@ -1458,9 +1458,12 @@ To show the number next to the candidates in some back-ends, enable (cons selected (company-call-backend 'meta selected)))) (cdr company-last-metadata))) -(defun company-doc-buffer (&optional _string) - (with-current-buffer (get-buffer-create "*Company meta-data*") +(defun company-doc-buffer (&optional string) + (with-current-buffer (get-buffer-create "*company-documentation*") (erase-buffer) + (when string + (save-excursion + (insert string))) (current-buffer))) (defvar company--electric-commands